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 _NFCDEFAULTADAPTER_H_
21 #define _NFCDEFAULTADAPTER_H_
24 #include <dpl/shared_ptr.h>
25 #include <dpl/singleton.h>
26 #include <Commons/Emitters.h>
28 #include "EventNFCChanged.h"
29 #include "NFCAdapter.h"
34 class NFCDefaultAdapter
38 virtual ~NFCDefaultAdapter();
44 int setTagListener(NFCAdapter* adapter);
45 int setPeerListener(NFCAdapter * adapter);
49 void unsetTagListener(NFCAdapter * adapter);
50 void unsetPeerListener(NFCAdapter * adapter);
52 void NFCTagHasDetected(void *props);
53 void NFCTargetHasDetected(void *props);
55 void *getCachedMessage();
59 void setPowered(const bool state, NFCAdapter * adapter);
60 void setPoweredManualAnswer(int error);
62 EventNFCSEType getSEType();
63 void setCardEmulation(const EventNFCSEType seType, NFCAdapter * adapter);
64 void setCardEmulationManualAnswer(int error, void *adapter);
66 void setCardEmulationChangeListener(NFCAdapter *adapter);
68 void unsetCardEmulationChangeListener(NFCAdapter * adapter);
78 std::vector<NFCAdapter *> m_NFCTagListeners;
79 std::vector<NFCAdapter *> m_NFCTargetListeners;
80 std::vector<NFCAdapter *> m_NFCChangedSETypes;
82 NFCAdapter * m_poweredAdapter;
84 EventNFCSEType m_seType;
86 friend class DPL::Singleton<NFCDefaultAdapter>;
89 typedef DPL::Singleton<NFCDefaultAdapter> NFCDefaultAdapterSingleton;
94 #endif /* _NFCDEFAULTADAPTER_H_ */