2 // Open Service Platform
3 // Copyright (c) 2012-2013 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.
18 * @file FNetNfcINdefTagConnectionListener.h
19 * @brief This is the header file for the %INdefTagConnectionListener interface.
21 * This header file contains the declarations of the %INdefTagConnectionListener interface.
24 #ifndef _FNET_NFC_INDEF_TAG_CONNECTION_LISTENER_H_
25 #define _FNET_NFC_INDEF_TAG_CONNECTION_LISTENER_H_
27 #include <FBaseRtIEventListener.h>
28 #include <FBaseResult.h>
30 namespace Tizen { namespace Net { namespace Nfc
36 * @interface INdefTagConnectionListener
37 * @brief This interface provides a listener for the events related to the NDEF tag connection.
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.
44 * For more information on the class features, see
45 * <a href="../org.tizen.native.appprogramming/html/guide/net/nfc.htm">NFC Guide</a>.
47 class _OSP_EXPORT_ INdefTagConnectionListener
48 : public Tizen::Base::Runtime::IEventListener
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.
57 virtual ~INdefTagConnectionListener(void) {}
60 * Called to notify the application when the read operation from the target tag is completed.
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 * @see NdefTagConnection::Read()
73 * @remarks The input NdefMessage object must be deleted by the application after use, even outside this
74 * method. The NdefMessage::RemoveAllRecords() method must be called with @c true as the input value
75 * right before the %NdefMessage object is deleted.
77 virtual void OnNdefReadCompletedN(NdefMessage* pMessage, result r) = 0;
80 * Called to notify the application when the write operation on the target tag is completed.
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()
93 virtual void OnNdefWriteCompleted(result r) = 0;
97 // This method is for internal use only. Using this method can cause behavioral, security-related, and
98 // consistency-related issues in the application.
100 // This method is reserved and may change its name at any time without prior notice.
104 virtual void INdefTagConnectionListener_Reserved1(void) {}
107 // This method is for internal use only. Using this method can cause behavioral, security-related, and
108 // consistency-related issues in the application.
110 // This method is reserved and may change its name at any time without prior notice.
114 virtual void INdefTagConnectionListener_Reserved2(void) {}
117 // This method is for internal use only. Using this method can cause behavioral, security-related, and
118 // consistency-related issues in the application.
120 // This method is reserved and may change its name at any time without prior notice.
124 virtual void INdefTagConnectionListener_Reserved3(void) {}
125 }; // INdefTagConnectionListener
127 } } } // Tizen::Net::Nfc
129 #endif // _FNET_NFC_INDEF_TAG_CONNECTION_LISTENER_H_