From cf532ec9225b807d13b4346a07cf2283e64ee161 Mon Sep 17 00:00:00 2001 From: Woowon Date: Wed, 17 Apr 2013 13:44:47 +0900 Subject: [PATCH] Add example code to NdefPushManager header Change-Id: Ie5659ddab8fcdd9a6fe321e62d40dd7379b02e1e Signed-off-by: Woowon --- inc/FNetNfcNdefPushManager.h | 81 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/inc/FNetNfcNdefPushManager.h b/inc/FNetNfcNdefPushManager.h index 6c90136..05e0c4a 100755 --- a/inc/FNetNfcNdefPushManager.h +++ b/inc/FNetNfcNdefPushManager.h @@ -58,6 +58,87 @@ class _NdefPushManagerImpl; * For more information on the class features, see * NFC Guide. * + * The following example demonstrates how to use the %NdefPushManager class. + * + * @code + * // MyClass.h + * #include + + * class MyClass + * : public Tizen::Net::Nfc::INfcManagerEventListener + * , public Tizen::Net::Nfc::INdefPushManagerListener + * , public Tizen::Net::Nfc::INfcDeviceDiscoveryEventListener + * { + * public: + * // The method declarations are hidden for the sake of simplicity + * + * private: + * Tizen::Net::Nfc::NfcManager* __pNfcManager; + * Tizen::Net::Nfc::NdefPushManager* __pNdefPushManager; + * }; + * + * // MyClass.cpp + * #include "MyClass.h" + * + * using namespace Tizen::Net::Nfc; + * + * MyClass::MyClass(void) + * : __pNfcManager(null) + * , __pNdefPushManager(null) + * { + * __pNfcManager = new NfcManager(); + * __pNdefPushManager = new NdefPushManager(); + * } + * + * MyClass::~MyClass(void) + * { + * // Removes the device discovery event listener instance. + * __pNfcManager->RemoveDeviceDiscoveryEventListener(*this); + * + * delete __pNfcManager; + * delete __pNdefPushManager; + * } + * + * void + * MyClass::PushNdefMessageSample(void) + * { + * // Creates the NfcManager instance and registers the manager event listener + * __pNfcManager->Construct(*this); + * + * // Adds the device discovery event listener instance for the device discovery events. + * __pNfcManager->AddDeviceDiscoveryEventListener(*this); + * + * // Sets a listener for receiving the result of pushing an NDEF message. + * __pNdefPushManager->SetNdefPushManagerListener(this); + * } + * + * // This method is invoked when a NFC device is detected + * void + * MyClass::OnNfcDeviceDetected(void) + * { + * NdefMessage message; + * // Fills up the NdefMessage object here + * + * __pNdefPushManager->Push(message); + * } + * + * // This method is invoked when the NFC device is lost + * void + * MyClass::OnNfcDeviceLost(void) + * { + * + * } + * + * // This method is invoked when the push operation to the target device is completed. + * void + * MyClass::OnNdefPushMessageSent(result r) + * { + * if (r == E_SUCCESS) + * { + * // Pushing NdefMessage is successful + * } + * } + * @endcode */ class _OSP_EXPORT_ NdefPushManager : public Tizen::Base::Object -- 2.7.4