From 940c463749f19319b8e8cf8175121fb9a0b3a359 Mon Sep 17 00:00:00 2001 From: "eh1112.kim" Date: Fri, 12 Apr 2013 12:32:05 +0900 Subject: [PATCH] Modified doxygen @code for pushmanager. Change-Id: I79495687a928c657da5874f98ba80e8f529dcf90 Signed-off-by: eh1112.kim --- inc/FMsgPushManager.h | 167 ++++++++++++++++++++++++++++---------------------- 1 file changed, 94 insertions(+), 73 deletions(-) diff --git a/inc/FMsgPushManager.h b/inc/FMsgPushManager.h index 2ee48ca..31af935 100755 --- a/inc/FMsgPushManager.h +++ b/inc/FMsgPushManager.h @@ -53,79 +53,100 @@ class _PushManagerImpl; * * @code * - // Creates a listener to override the methods of IPushManagerListener and IPushEventListener. - - class PushListener : public IPushManagerListener, public IPushEventListener, public Object - { - public: - void OnPushServiceRegistered(RequestId reqId, const Tizen::Base::String& registrationId, result r, const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMsg); - void OnPushServiceUnregistered(RequestId reqId, result r, const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMsg); - void OnPushMessageReceived(const PushMessage& message); - }; - void PushListener::OnPushServiceRegistered(RequestId reqId, const Tizen::Base::String& registrationId, result r, const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMsg) - { - if (E_SUCCESS == r) { - // The application must send registrationId to the application server. - } else { - // Error - } - } - void PushListener::OnPushServiceUnregistered(RequestId reqId, result r, const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMsg) - { - // Do something - } - void PushListener::OnPushMessageReceived(const PushMessage& message) - { - // Do something - } - - class PushManagerSample : public Object - { - public: - void Initialize(void); - void EnablePushService(void); - void DisablePushService(void); - private: - PushListener* pPushListener; - PushManager* pPushManager; - }; - void PushManagerSample::Initialize(void) - { - // Creates a PushListener instance. - pPushListener = new PushListener(); - - // Creates a PushManager instance. - pPushManager = new PushManager(); - pPushManager->Construct(*pPushListener, *pPushListener); - } - void PushManagerSample::EnablePushService(void) - { - RequestId reqId; - result r = E_SUCCESS; - - r = pPushManager->RegisterPushService(reqId); - if (IsFailed(r)) { - // Error - return; - } - - // The result of registration will be notified by IPushManagerListener::OnPushServiceRegistered(). - } - void PushManagerSample::DisablePushService(void) - { - // The application must notify the application server to stop sending push messages for this device. - - RequestId reqId; - result r = E_SUCCESS; - - r = pPushManager->UnregisterPushService(reqId); - if (IsFailed(r)) { - // Error - return; - } - - // The result of unregistration will be notified by IPushManagerListener::OnPushServiceUnregistered(). - } + #include + #include + + using namespace Tizen::Base; + using namespace Tizen::Messaging; + + // Creates a listener to override the methods of IPushManagerListener and IPushEventListener. + class MyClass + : public Object + , public IPushEventListener + , public IPushManagerListener + { + public: + MyClass(void) {} + ~MyClass(void) {} + + //IPushManagerListener and IPushEventListener + void OnPushServiceRegistered(RequestId reqId, const String& registrationId, result r, const String& errorCode, const String& errorMsg); + void OnPushServiceUnregistered(RequestId reqId, result r, const String& errorCode, const String& errorMsg); + void OnPushMessageReceived(const PushMessage& message); + + void Initialize(void); + void EnablePushService(void); + void DisablePushService(void); + + private: + PushManager* pPushManager; + }; + + void + MyClass::OnPushServiceRegistered(RequestId reqId, const String& registrationId, result r, const String& errorCode, const String& errorMsg) + { + if (E_SUCCESS == r) + { + // The application must send registrationId to the application server. + } + else + { + // Error + } + } + + void + MyClass::OnPushServiceUnregistered(RequestId reqId, result r, const String& errorCode, const String& errorMsg) + { + // Do something + } + + void + MyClass::OnPushMessageReceived(const PushMessage& message) + { + // Do something + } + + void + MyClass::Initialize(void) + { + // Creates a PushManager instance. + pPushManager = new PushManager(); + pPushManager->Construct(*this, *this); + } + + void + MyClass::EnablePushService(void) + { + RequestId reqId; + result r = E_SUCCESS; + + r = pPushManager->RegisterPushService(reqId); + if (IsFailed(r)) + { + return; + } + + // The result of registration will be notified by IPushManagerListener::OnPushServiceRegistered(). + } + + void + MyClass::DisablePushService(void) + { + // The application must notify the application server to stop sending push messages for this device. + + RequestId reqId; + result r = E_SUCCESS; + + r = pPushManager->UnregisterPushService(reqId); + if (IsFailed(r)) + { + return; + } + + // The result of unregistration will be notified by IPushManagerListener::OnPushServiceUnregistered(). + } + * * @endcode */ -- 2.7.4