Add example code to NdefPushManager header
authorWoowon <woowon.park@samsung.com>
Wed, 17 Apr 2013 04:44:47 +0000 (13:44 +0900)
committerWoowon <woowon.park@samsung.com>
Wed, 17 Apr 2013 08:17:50 +0000 (17:17 +0900)
Change-Id: Ie5659ddab8fcdd9a6fe321e62d40dd7379b02e1e
Signed-off-by: Woowon <woowon.park@samsung.com>
inc/FNetNfcNdefPushManager.h

index 6c90136..05e0c4a 100755 (executable)
@@ -58,6 +58,87 @@ class _NdefPushManagerImpl;
  * For more information on the class features, see
  * <a href="../org.tizen.native.appprogramming/html/guide/net/nfc.htm">NFC Guide</a>.
  *
+ * The following example demonstrates how to use the %NdefPushManager class.
+ *
+ * @code
+ * // MyClass.h
+ * #include <FNet.h>
+
+ * 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