gecko/dom/nfc/gonk/NfcService.h
Yoshi Huang c47835efd2 Bug 933141 - Move NFC files out of system/gonk. r=gps, dimi
--HG--
rename : dom/system/gonk/NfcContentHelper.js => dom/nfc/NfcContentHelper.js
rename : dom/system/gonk/Nfc.js => dom/nfc/gonk/Nfc.js
rename : dom/system/gonk/Nfc.manifest => dom/nfc/gonk/Nfc.manifest
rename : dom/system/gonk/NfcGonkMessage.h => dom/nfc/gonk/NfcGonkMessage.h
rename : dom/system/gonk/NfcMessageHandler.cpp => dom/nfc/gonk/NfcMessageHandler.cpp
rename : dom/system/gonk/NfcMessageHandler.h => dom/nfc/gonk/NfcMessageHandler.h
rename : dom/system/gonk/NfcOptions.h => dom/nfc/gonk/NfcOptions.h
rename : dom/system/gonk/NfcService.cpp => dom/nfc/gonk/NfcService.cpp
rename : dom/system/gonk/NfcService.h => dom/nfc/gonk/NfcService.h
rename : dom/system/gonk/nfc_consts.js => dom/nfc/gonk/nfc_consts.js
rename : dom/system/gonk/nsINfcService.idl => dom/nfc/gonk/nsINfcService.idl
rename : dom/system/gonk/nsINfcContentHelper.idl => dom/nfc/nsINfcContentHelper.idl
2014-08-01 17:23:14 +08:00

52 lines
1.2 KiB
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NfcService_h
#define NfcService_h
#include "mozilla/ipc/Nfc.h"
#include "mozilla/ipc/UnixSocket.h"
#include "nsCOMPtr.h"
#include "nsINfcService.h"
#include "NfcMessageHandler.h"
class nsIThread;
namespace mozilla {
namespace dom {
class NfcEventOptions;
} // namespace dom
class NfcService MOZ_FINAL : public nsINfcService,
public mozilla::ipc::NfcSocketListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSINFCSERVICE
static already_AddRefed<NfcService> FactoryCreate();
void DispatchNfcEvent(const mozilla::dom::NfcEventOptions& aOptions);
virtual void
ReceiveSocketData(nsAutoPtr<mozilla::ipc::UnixSocketRawData>& aData) MOZ_OVERRIDE;
nsCOMPtr<nsIThread> GetThread() {
return mThread;
}
private:
NfcService();
~NfcService();
nsCOMPtr<nsIThread> mThread;
nsCOMPtr<nsINfcEventListener> mListener;
nsRefPtr<mozilla::ipc::NfcConsumer> mConsumer;
nsAutoPtr<NfcMessageHandler> mHandler;
};
} // namespace mozilla
#endif // NfcService_h