Update change log and spec for wrt-plugins-tizen_0.4.13
[framework/web/wrt-plugins-tizen.git] / src / NFC / NFCAdapter.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18
19
20 #ifndef _NFCADAPTER_H_
21 #define _NFCADAPTER_H_
22
23 #include <dpl/shared_ptr.h>
24 #include <Commons/Emitters.h>
25
26 #include "INFCAdapter.h"
27 #include "NFCFactory.h"
28 #include "EventNFCChanged.h"
29
30
31
32 namespace DeviceAPI {
33 namespace NFC {
34 class NFCAdapter : public INFCAdapter
35 {
36         friend class  NFCFactory;
37     public:
38                 NFCAdapter();
39         virtual  ~NFCAdapter();
40
41 public:
42      /**
43      * watchNFCTag
44      */
45         virtual int setTagListener(const EventNFCChangedEmitterPtr& emitter, const TagFilterPtr& filter);
46         virtual int setPeerListener(const EventNFCChangedEmitterPtr& emitter);
47         /**
48      * clearWatch
49      */
50         virtual void unsetTagListener();
51         virtual void unsetPeerListener();
52
53         void NFCTagHasDetected(void *props);
54         void NFCTargetHasDetected(void *props);
55
56         virtual void *getCachedMessage();
57
58         virtual bool getPowerState();
59         virtual void setPowered(const EventNFCChangedSetPoweredPtr& event);
60         void setPoweredManualAnswer(int error);
61 private:
62         EventNFCChangedEmitterPtr m_NFCTagEmitterPtr;
63         EventNFCChangedEmitterPtr m_NFCTargetEmitterPtr;
64         EventNFCChangedSetPoweredPtr m_EventNFCChangedSetPoweredPtr;
65         TagFilterPtr m_tagFilter;
66   protected:
67         virtual void OnRequestReceived(const EventNFCChangedSetPoweredPtr& event);
68 };
69
70 }
71 }
72
73 #endif /* _NFCADAPTER_H_ */