ed7af5d8ee155a36df51e267880d5af661ac8faf
[framework/osp/nfc.git] / inc / FNetNfcITagConnectionListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 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  * @file    FNetNfcITagConnectionListener.h
19  * @brief   This is the header file for the %ITagConnectionListener interface.
20  *
21  * This header file contains the declarations of the %ITagConnectionListener interface.
22  */
23
24 #ifndef _FNET_NFC_ITAG_CONNECTION_LISTENER_H_
25 #define _FNET_NFC_ITAG_CONNECTION_LISTENER_H_
26
27 #include <FBaseRtIEventListener.h>
28 #include <FBaseResult.h>
29
30 namespace Tizen { namespace Base
31 {
32 class ByteBuffer;
33 } }
34
35 namespace Tizen { namespace Net { namespace Nfc
36 {
37
38 /**
39  * @interface    ITagConnectionListener
40  * @brief        This interface provides a listener for the events related to the tag connection.
41  *
42  * @since        2.0
43  *
44  * The %ITagConnectionListener interface provides methods that are used for creating notifications for the result of
45  * the actions of the TagConnection, such as sending a command.
46  *
47  * For more information on the class features, see
48  * <a href="../org.tizen.native.appprogramming/html/guide/net/nfc.htm">NFC Guide</a>.
49  */
50 class _OSP_EXPORT_ ITagConnectionListener
51         : public Tizen::Base::Runtime::IEventListener
52 {
53 public:
54         /**
55          * This polymorphic destructor should be overridden if required. @n
56          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
57          *
58          * @since       2.0
59          */
60         virtual ~ITagConnectionListener(void) {}
61
62         /**
63          * Called to notify the application when the response is received from the remote tag.
64          *
65          * @since       2.0
66          *
67          * @param[in]   pResponse           The response of the command as the ByteBuffer object, @n
68          *                                  else @c null if the method is not successful
69          * @param[in]   r                   An error code
70          * @exception   E_SUCCESS           The method is successful.
71          * @exception   E_ILLEGAL_ACCESS    The sent command is denied by the target. @n
72          *                                  The target tag is locked or protected for executing the command.
73          * @exception   E_NOT_RESPONDING    The target tag is not responding.
74          * @exception   E_SYSTEM            A system error has occurred.
75          * @see         TagConnection::SendCommand()
76          * @remarks     The input response (@c pResponse) must be deleted by the application to prevent memory leak.
77          */
78         virtual void OnNfcResponseReceivedN(Tizen::Base::ByteBuffer* pResponse, result r) = 0;
79
80 protected:
81         //
82         // This method is for internal use only. Using this method can cause behavioral, security-related, and
83         // consistency-related issues in the application.
84         //
85         // This method is reserved and may change its name at any time without prior notice.
86         //
87         // @since    2.0
88         //
89         virtual void ITagConnectionListener_Reserved1(void) {}
90
91         //
92         // This method is for internal use only. Using this method can cause behavioral, security-related, and
93         // consistency-related issues in the application.
94         //
95         // This method is reserved and may change its name at any time without prior notice.
96         //
97         // @since    2.0
98         //
99         virtual void ITagConnectionListener_Reserved2(void) {}
100
101         //
102         // This method is for internal use only. Using this method can cause behavioral, security-related, and
103         // consistency-related issues in the application.
104         //
105         // This method is reserved and may change its name at any time without prior notice.
106         //
107         // @since    2.0
108         //
109         virtual void ITagConnectionListener_Reserved3(void) {}
110 }; // ITagConnectionListener
111
112 } } } // Tizen::Net::Nfc
113
114 #endif // _FNET_NFC_ITAG_CONNECTION_LISTENER_H_