2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
20 #ifndef _NFCADAPTER_H_
21 #define _NFCADAPTER_H_
23 #include <dpl/shared_ptr.h>
24 #include <Commons/Emitters.h>
26 #include "INFCAdapter.h"
27 #include "NFCFactory.h"
28 #include "EventNFCChanged.h"
34 class NFCAdapter : public INFCAdapter
36 friend class NFCFactory;
39 virtual ~NFCAdapter();
45 virtual int setTagListener(const EventNFCChangedEmitterPtr& emitter, const TagFilterPtr& filter);
46 virtual int setPeerListener(const EventNFCChangedEmitterPtr& emitter);
50 virtual void unsetTagListener();
51 virtual void unsetPeerListener();
53 void NFCTagHasDetected(void *props);
54 void NFCTargetHasDetected(void *props);
56 virtual void *getCachedMessage();
58 virtual bool getPowerState();
59 virtual void setPowered(const EventNFCChangedSetPoweredPtr& event);
60 void setPoweredManualAnswer(int error);
62 virtual EventNFCSEType getSEType();
63 virtual void setCardEmulation(const EventNFCSetCardEmulationPtr& event);
64 void setCardEmulationManualAnswer(int error);
66 virtual void setCardEmulationChangeListener(const EventNFCChangedCardEmulationEmitterPtr& event);
67 void seChanged(EventNFCSEType seType);
68 virtual void unsetCardEmulationChangeListener();
70 EventNFCChangedEmitterPtr m_NFCTagEmitterPtr;
71 EventNFCChangedEmitterPtr m_NFCTargetEmitterPtr;
72 EventNFCChangedSetPoweredPtr m_EventNFCChangedSetPoweredPtr;
73 EventNFCSetCardEmulationPtr m_eventNFCSetCardEmulationPtr;
74 EventNFCChangedCardEmulationEmitterPtr m_NFCChangedCardEmulations;
75 TagFilterPtr m_tagFilter;
77 virtual void OnRequestReceived(const EventNFCChangedSetPoweredPtr& event);
78 virtual void OnRequestReceived(const EventNFCSetCardEmulationPtr& event);
84 #endif /* _NFCADAPTER_H_ */