Merge "fixed wrong link page" into tizen_2.1
[platform/framework/native/nfc.git] / inc / FNetNfcINdefTagConnectionListener.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    FNetNfcINdefTagConnectionListener.h
19  * @brief   This is the header file for the %INdefTagConnectionListener interface.
20  *
21  * This header file contains the declarations of the %INdefTagConnectionListener interface.
22  */
23
24 #ifndef _FNET_NFC_INDEF_TAG_CONNECTION_LISTENER_H_
25 #define _FNET_NFC_INDEF_TAG_CONNECTION_LISTENER_H_
26
27 #include <FBaseRtIEventListener.h>
28 #include <FBaseResult.h>
29
30 namespace Tizen { namespace Net { namespace Nfc
31 {
32
33 class NdefMessage;
34
35 /**
36  * @interface   INdefTagConnectionListener
37  * @brief       This interface provides a listener for the events related to the NDEF tag connection.
38  *
39  * @since       2.0
40  *
41  * The %INdefTagConnectionListener interface specifies the methods used for creating the notifications about the result
42  * of an action for the NdefTagConnection, such as reading and writing the NDEF data.
43  *
44  * For more information on the class features, see
45  * <a href="../org.tizen.native.appprogramming/html/guide/net/nfc.htm">NFC Guide</a>.
46  */
47 class _OSP_EXPORT_ INdefTagConnectionListener
48         : public Tizen::Base::Runtime::IEventListener
49 {
50 public:
51         /**
52          * This polymorphic destructor should be overridden if required. @n
53          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
54          *
55          * @since       2.0
56          */
57         virtual ~INdefTagConnectionListener(void) {}
58
59         /**
60          * Called to notify the application when the read operation from the target tag is completed.
61          *
62          * @since       2.0
63          *
64          * @param[in]   pMessage                The read NdefMessage object, @n
65          *                                      else @c null if the method is not successful
66          * @param[in]   r                       An error code
67          * @exception   E_SUCCESS               The method is successful.
68          * @exception   E_DATA_NOT_FOUND        The target tag has no NDEF record.
69          * @exception   E_INVALID_FORMAT        The read data cannot be formulated to the NDEF message.
70          * @exception   E_NOT_RESPONDING        The target tag is not responding.
71          * @exception   E_SYSTEM                A system error has occurred.
72          * @remarks     The input NdefMessage object must be deleted by the application after use, even outside this
73          *              method. The NdefMessage::RemoveAllRecords() method must be called with @c true as the input value
74          *              right before the %NdefMessage object is deleted.
75          * @see         NdefTagConnection::Read()
76          */
77         virtual void OnNdefReadCompletedN(NdefMessage* pMessage, result r) = 0;
78
79         /**
80          * Called to notify the application when the write operation on the target tag is completed.
81          *
82          * @since       2.0
83          *
84          * @param[in]   r                       An error code
85          * @exception   E_SUCCESS               The method is successful.
86          * @exception   E_ILLEGAL_ACCESS        The write operation on the target tag is denied. @n
87          *                                      The target tag is locked or protected for the write operation.
88          * @exception   E_STORAGE_FULL          The storage capacity of the target tag is full.
89          * @exception   E_NOT_RESPONDING        The target tag is not responding.
90          * @exception   E_SYSTEM                A system error has occurred.
91          * @see         NdefTagConnection::Write()
92          */
93         virtual void OnNdefWriteCompleted(result r) = 0;
94
95 protected:
96         //
97         // This method is for internal use only. Using this method can cause behavioral, security-related, and
98         // consistency-related issues in the application.
99         //
100         // This method is reserved and may change its name at any time without prior notice.
101         //
102         // @since    2.0
103         //
104         virtual void INdefTagConnectionListener_Reserved1(void) {}
105
106         //
107         // This method is for internal use only. Using this method can cause behavioral, security-related, and
108         // consistency-related issues in the application.
109         //
110         // This method is reserved and may change its name at any time without prior notice.
111         //
112         // @since    2.0
113         //
114         virtual void INdefTagConnectionListener_Reserved2(void) {}
115
116         //
117         // This method is for internal use only. Using this method can cause behavioral, security-related, and
118         // consistency-related issues in the application.
119         //
120         // This method is reserved and may change its name at any time without prior notice.
121         //
122         // @since    2.0
123         //
124         virtual void INdefTagConnectionListener_Reserved3(void) {}
125 }; // INdefTagConnectionListener
126
127 } } } // Tizen::Net::Nfc
128
129 #endif // _FNET_NFC_INDEF_TAG_CONNECTION_LISTENER_H_