remove unnecessary codes
authorkyeongwoo.lee <kyeongwoo.lee@samsung.com>
Wed, 8 May 2013 10:46:07 +0000 (19:46 +0900)
committerkyeongwoo.lee <kyeongwoo.lee@samsung.com>
Wed, 8 May 2013 10:46:07 +0000 (19:46 +0900)
Change-Id: I86ff5fa61ccb4c6c5997fa9816ddca2d2b792ed1

12 files changed:
inc/FShell_AppWidgetContext.h
inc/FShell_AppWidgetContextBase.h
inc/FShell_AppWidgetManagerService.h
inc/FShell_AppWidgetManagerStub.h
inc/FShell_AppWidgetPopupContext.h
inc/OspAppWidgetService.h
src/FShell_AppWidgetContext.cpp
src/FShell_AppWidgetContextBase.cpp
src/FShell_AppWidgetManagerService.cpp
src/FShell_AppWidgetManagerStub.cpp
src/FShell_AppWidgetPopupContext.cpp
src/OspAppWidgetService.cpp

index 283af6a..d2f14d9 100644 (file)
 #ifndef _FSHELL_INTERNAL_APPWIDGET_CONTEXT_H_
 #define _FSHELL_INTERNAL_APPWIDGET_CONTEXT_H_
 
-#include <provider.h>
 #include <provider_buffer.h>
-#include <FAppTypes.h>
 #include <FBaseRtTimer.h>
-#include <FBaseObject.h>
 #include <FBaseColArrayListT.h>
 #include "FShell_AppWidgetContextBase.h"
 
+namespace Tizen { namespace Base  { namespace Collection
+{
+class HashMap;
+}}}
+
 namespace Tizen { namespace Shell  { namespace App
 {
 
@@ -39,28 +41,29 @@ class _AppWidgetPopupContext;
 extern const int UPDATE_PERIOD_MSEC_MIN;
 
 class _AppWidgetContext
-        : public _AppWidgetContextBase
-         ,public Tizen::Base::Runtime::ITimerEventListener
+       : public _AppWidgetContextBase
+       public Tizen::Base::Runtime::ITimerEventListener
 {
 public:
-       _AppWidgetContext(const Tizen::Base::String& name, const Tizen::Base::String& appId, const Tizen::Base::String& instanceId,
-                                               int width, int height, int period, int priority);
-       virtual ~_AppWidgetContext();
+       _AppWidgetContext(const Tizen::Base::String& name, const Tizen::Base::String& appId, const Tizen::Base::String& instanceId, int width, int height, int period, int priority);
+       virtual ~_AppWidgetContext(void);
+
        void OnAdded(void);
        void OnUpdate(const Tizen::Base::String& argument);
        void OnResize(int width, int height);
-       void OnRemoved();
-       void OnForeground();
-       void OnBackground();
+       void OnRemoved(void);
+
+       bool IsPaused(void) const;
+       void OnForeground(void);
+       void OnBackground(void);
 
        virtual void OnPopupCreated(double x, double y, int width, int height);
        virtual void OnPopupDestoyed(void);
-       virtual result SendTouchEvent(buffer_event event, double timestamp, double x, double y);
+       _AppWidgetPopupContext* GetAppWidgetPopup(void) const;
 
+       virtual result SendTouchEvent(buffer_event event, double timestamp, double x, double y);
        result RequestUpdateRemote(int width, int height);
-       _AppWidgetPopupContext* GetAppWidgetPopup() const;
 
-       bool IsPaused(void) const;
        int GetPeriod(void) const;
        long long GetLastUpdatedTime(void) const;
 
@@ -68,18 +71,15 @@ private:
        result SendAddRequest(int width, int height);
        result SendUpdateRequest(int width, int height, const Tizen::Base::String& argument);
        result SendResizeRequest(int width, int height);
-       result SendRemoveRequest();
-
+       result SendRemoveRequest(void);
        result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
        void SendPendingTouchEvent(void);
 
        virtual Tizen::Base::Collection::HashMap* CreateRequestArgsN(void);
-
        virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
 
        struct PendingTouchEvent
        {
-       public:
                PendingTouchEvent(int eventType, double timeStamp, double       x, double       y)
                 : eventType(eventType), timeStamp(timeStamp), x(x), y(y) {  }
 
@@ -95,10 +95,11 @@ private:
        int __updateMillis;
        long long __lastUpdatedTime;
        Tizen::Base::Collection::ArrayListT<PendingTouchEvent*>* __pPendingTouchEventList;
-       Tizen::Base::String __pendedArgument;
+       Tizen::Base::String __pendingArgument;
        bool __hasPendingRequest;
-};
 
-} } } // Tizen::Shell::App {
+};     // class _AppWidgetContext
+
+}}} // Tizen::Shell::App
 
 #endif // _FSHELL_INTERNAL_APPWIDGET_CONTEXT_H_
index 1d8fbde..1f9666a 100644 (file)
 #ifndef _FSHELL_INTERNAL_APPWIDGET_CONTEXT_BASE_H_
 #define _FSHELL_INTERNAL_APPWIDGET_CONTEXT_BASE_H_
 
-#include <provider.h>
+#include <provider_buffer.h>
 #include <FAppTypes.h>
-#include <FBaseObject.h>
-#include <FBaseColHashMap.h>
 
 #define APPWIDGET_PROVIDER_ID_ENABLE true
 
-typedef struct _bundle_t bundle;       //TODO: move code to osp-appfw
+namespace Tizen { namespace Base  { namespace Collection
+{
+class HashMap;
+}}}
 
 namespace Tizen { namespace Shell  { namespace App
 {
@@ -49,56 +50,60 @@ protected:
 
 public:
        _AppWidgetContextBase(target_type type, const Tizen::Base::String& userInfo, const Tizen::Base::String& providerId, const Tizen::Base::String& instanceId, int width, int height, int priority);
-       virtual ~_AppWidgetContextBase();
-
+       virtual ~_AppWidgetContextBase(void);
        virtual void OnPopupCreated(double x, double y, int width, int height) = 0;
        virtual void OnPopupDestoyed(void) = 0;
        virtual result SendTouchEvent(buffer_event event, double timestamp, double x, double y) = 0;
-
        void SetIpcClientId(int clientId);
        bool HasValidClientId(void) const;
-
        // for buffered appWidget
        int GetSharedMemId(int w, int h);
        result ReleaseSharedMem(void);
-
        void Suspend(void);
+       Tizen::Base::String GetInstanceId(void) const;
+       int GetWidth(void) const;
+       int GetHeight(void) const;
+       Tizen::Base::String GetProviderId(void) const;
        Tizen::Base::String GetAppId(void) const;
+       int GetPriority(void) const;
        Tizen::Base::String GetProviderName(void) const;
 
 protected:
        bool IsRunning(void) const;
        bool IsSharedMemCreated(void) const;
-
        virtual Tizen::Base::Collection::HashMap* CreateRequestArgsN(void) = 0;
        result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
+       void SetForeground(bool forground);
+       bool IsForeground(void) const;
+       Tizen::Base::String GetUserInfo(void) const;
+       int GetClientId(void) const;
 
-public:
+       void SetWidth(int width);
+       void SetHeight(int height);
+
+private:
        target_type __type;
        Tizen::Base::String __userInfo;
-       Tizen::Base::String __appId;
-       Tizen::Base::String __providerName;
        Tizen::Base::String __providerId;
        Tizen::Base::String __instanceId;
        int __width;
        int __height;
        int __priority;
-
-protected:
-       bool __isForeground;// LB only?
+       bool __isForeground;
        int __ipcClientId;
-
-private:
+       Tizen::Base::String __appId;
+       Tizen::Base::String __providerName;
        struct livebox_buffer *__buffer_info;
        void *__buffer;
        _AppWidgetProviderState __providerState;
-};
+
+};     // class _AppWidgetContextBase
 
 class _AppWidgetRequestHelper
 {
 public:
        static result SendRequestToApp(const Tizen::App::AppId& appId, const Tizen::Base::String& operation, Tizen::Base::Collection::HashMap* pArgs);
-};
+};     // class _AppWidgetRequestHelper
 
 extern const wchar_t ARG_KEY_INSTANCE_ID[];
 extern const wchar_t ARG_KEY_PROVIDER_NAME[];
@@ -113,7 +118,6 @@ extern const wchar_t ARG_KEY_ARGUMENT[];
 extern const wchar_t ARG_KEY_EVENT_TYPE[];
 extern const wchar_t ARG_KEY_TIME_STAMP[];
 
-} /* namespace App */
-} /* namespace AppWidget */
-} /* namespace Samsung */
+}}}     // Tizen::Shell::App
+
 #endif // _FSHELL_INTERNAL_APPWIDGET_CONTEXT_BASE_H_
index 7eb4230..a62ae74 100644 (file)
 #ifndef _FSHELL_INTERNAL_APPWIDGET_MANAGER_SERVICE_H_
 #define _FSHELL_INTERNAL_APPWIDGET_MANAGER_SERVICE_H_
 
-#include <FBaseObject.h>
-#include <FBaseString.h>
 #include <FBaseRtTimer.h>
+#include <FBaseRtThread.h>
 #include <FBaseColArrayListT.h>
-#include <FBaseColArrayList.h>
-
 #include "FShell_AppWidgetContext.h"
 #include "FShell_AppWidgetManagerStub.h"
 
+namespace Tizen { namespace Base  { namespace Collection
+{
+class IList;
+}}}
+
 namespace Tizen { namespace Shell  { namespace App {
 
 class AppWidgetManagerService
@@ -45,7 +47,7 @@ public:
        result RemoveAppWidget(const char* pPackageName, const char* pId, bool free);
 
 private:
-       result Construct();
+       result Construct(void);
        result InitializeMasterDaemonEventReceiver(const char* pServiceExecutableName);
        result DeinitializeMasterDaemonEventReceiver(void);
 
@@ -77,8 +79,8 @@ private:
        virtual result RequestReleaseSharedMemoryForPD(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId);
 
        // internal functions
-       AppWidgetManagerService();
-       virtual ~AppWidgetManagerService();
+       AppWidgetManagerService(void);
+       virtual ~AppWidgetManagerService(void);
 
        virtual void OnIpcClientConnected(const Tizen::Io::_IpcServer& server, int clientId);
        virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer&server, int clientId);
@@ -87,7 +89,7 @@ private:
        result SetIpcClientIds(const Tizen::App::AppId& appId, int clientId);
        int UpdateAllAppWidgetsByAppId(const Tizen::Base::String& appId);
 
-       void StartPingTimer();
+       void StartPingTimer(void);
        virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
        _AppWidgetContext* Find(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId) const;
 
@@ -104,8 +106,9 @@ private:
        Tizen::Base::Collection::ArrayListT<_AppWidgetContext*> __appWidgetContextList;
        Tizen::Base::Runtime::Timer __pingTimer;
        _TaskHandlerThread      __handlerThread;
-};
 
-} } } // Tizen::Shell::App {
+};     // class AppWidgetManagerService
+
+}}} // Tizen::Shell::App
 
 #endif // _FSHELL_INTERNAL_APPWIDGET_MANAGER_SERVICE_H_
index 03d537a..80566bb 100644 (file)
 #ifndef _FSHELL_INTERNAL_APPWIDGET_MANAGER_STUB_H_
 #define _FSHELL_INTERNAL_APPWIDGET_MANAGER_STUB_H_
 
-#include <FBaseObject.h>
-#include <FBaseString.h>
 #include <FBaseRtIEventListener.h>
-#include <FSystem.h>
-#include <FIo.h>
-
 #include <FIo_IIpcServerEventListener.h>
-//#include <FApp_IAppManager.h>
-
 
 namespace Tizen { namespace Shell  { namespace App {
 
@@ -91,8 +84,9 @@ private:
 
 protected:
        Tizen::Io::_IpcServer *__pIpcServer;
-};     //_AppWidgetManagerStub
 
-}}}
+};     // class _AppWidgetManagerStub
+
+}}}    // Tizen::Shell::App
 
 #endif//_FSHELL_INTERNAL_APPWIDGET_MANAGER_STUB_H_
index fc4b0af..02daa51 100644 (file)
@@ -36,7 +36,7 @@ class _AppWidgetPopupContext
 {
 public:
        _AppWidgetPopupContext(const Tizen::Base::String& userInfo, const Tizen::Base::String& appId, const Tizen::Base::String& instanceId, int width, int height, int priority, _AppWidgetContext* pParent);
-       virtual ~_AppWidgetPopupContext();
+       virtual ~_AppWidgetPopupContext(void);
 
        // event handler
        void OnPopupCreated(double x, double y, int width, int height);
@@ -44,9 +44,8 @@ public:
 
        // request to app
        result SendPopupCreateRequest(double x, double y, int width, int height);
-       result SendPopupDestroyRequest();
+       result SendPopupDestroyRequest(void);
        virtual result SendTouchEvent(buffer_event event, double timestamp, double x, double y);
-
        result RequestUpdateRemote(void);
 
 private:
@@ -54,10 +53,9 @@ private:
 
 private:
        _AppWidgetContext* __pParent;
-};
 
+};     // class _AppWidgetPopupContext
+
+}}}    // Tizen::Shell::App
 
-} /* namespace App */
-} /* namespace AppWidget */
-} /* namespace Samsung */
 #endif // _FSHELL_INTERNAL_APPWIDGET_POPUP_CONTEXT_H_
index f9493d2..58e4a3d 100644 (file)
@@ -44,8 +44,8 @@ public:
 
 public:
 
-       OspAppWidgetService();
-       ~OspAppWidgetService();
+       OspAppWidgetService(void);
+       ~OspAppWidgetService(void);
 
 public:
 
@@ -67,6 +67,6 @@ public:
        // Called when the battery level changes.
        void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
 
-};
+};     // class OspAppWidgetService
 
-#endif // _$(baseName_upper)_H_
+#endif // _OSP_APPWIDGET_SERVICE_H_
index 5dad3b4..c9aa39a 100644 (file)
  * @brief      This is the implementation for the _AppWidgetContext class.
  */
 
-#include <stdlib.h>
+#include <provider.h>
 #include <unique_ptr.h>
-#include <FBase.h>
 #include <FBaseSysLog.h>
+#include <FBaseInteger.h>
+#include <FBaseDouble.h>
+#include <FBaseColHashMap.h>
 #include <FSysSystemTime.h>
+#include <FBaseColAllElementsDeleter.h>
 #include <FBase_StringConverter.h>
-#include <FApp_AppControlManager.h>
 #include "FShell_AppWidgetManagerService.h"
 #include "FShell_AppWidgetPopupContext.h"
-#include "FShell_AppWidgetContextBase.h"
 #include "FShell_AppWidgetContext.h"
 
 namespace Tizen { namespace Shell  { namespace App
@@ -55,7 +56,7 @@ _AppWidgetContext::_AppWidgetContext(const String& info, const String& providerI
        ,__pPendingTouchEventList(null)
        , __hasPendingRequest(false)
 {
-       if__updateMillis > 0)
+       if (__updateMillis > 0)
        {
                __updateMillis = (__updateMillis > UPDATE_PERIOD_MSEC_MIN) ? __updateMillis : UPDATE_PERIOD_MSEC_MIN;
                SysLog(NID_SHELL, "period(%d)", __updateMillis);
@@ -70,9 +71,9 @@ _AppWidgetContext::_AppWidgetContext(const String& info, const String& providerI
        __pPendingTouchEventList->Construct();
 }
 
-_AppWidgetContext::~_AppWidgetContext()
+_AppWidgetContext::~_AppWidgetContext(void)
 {
-       SysLog(NID_SHELL, "appId(%ls), instanceId(%ls), width(%d), height(%d), priority(%d)", __providerId.GetPointer(), __instanceId.GetPointer(), __width, __height, __priority);
+       SysLog(NID_SHELL, "appId(%ls), instanceId(%ls), width(%d), height(%d), priority(%d)", GetProviderId().GetPointer(), GetInstanceId().GetPointer(), GetWidth(), GetHeight(), GetPriority());
 
        __updateTimer.Cancel();
 
@@ -97,7 +98,7 @@ _AppWidgetContext::~_AppWidgetContext()
 }
 
 _AppWidgetPopupContext*
-_AppWidgetContext::GetAppWidgetPopup() const
+_AppWidgetContext::GetAppWidgetPopup(void) const
 {
        return __pAppWidgetPopup;
 }
@@ -105,11 +106,11 @@ _AppWidgetContext::GetAppWidgetPopup() const
 void
 _AppWidgetContext::OnAdded(void)
 {
-       SendAddRequest(__width, __height);
+       SendAddRequest(GetWidth(), GetHeight());
 }
 
 void
-_AppWidgetContext::OnRemoved()
+_AppWidgetContext::OnRemoved(void)
 {
        SendRemoveRequest();
 }
@@ -128,7 +129,7 @@ _AppWidgetContext::OnUpdate(const String& argument)
                // Saving the data
                if (!argument.IsEmpty())
                {
-                       __pendedArgument = argument;
+                       __pendingArgument = argument;
                }
 
                __hasPendingRequest = true;
@@ -136,42 +137,43 @@ _AppWidgetContext::OnUpdate(const String& argument)
        }
        else
        {
-               this->SendUpdateRequest(__width, __height, argument);
+               this->SendUpdateRequest(GetWidth(), GetHeight(), argument);
 
                SystemTime::GetTicks(this->__lastUpdatedTime);
                SysLog(NID_SHELL, "The last updated time is %lld.", this->__lastUpdatedTime);
 
                __hasPendingRequest = false;
-               __pendedArgument.Clear();
+               __pendingArgument.Clear();
        }
 }
 
 void
 _AppWidgetContext::OnResize(int width, int height)
 {
-       SysLog(NID_SHELL, "appId(%ls), instanceId(%ls), width(%d), height(%d), priority(%d)", __providerId.GetPointer(), __instanceId.GetPointer(), __width, __height, __priority);
+       SysLog(NID_SHELL, "appId(%ls), instanceId(%ls), width(%d), height(%d), priority(%d)", GetProviderId().GetPointer(), GetInstanceId().GetPointer(), GetWidth(), GetHeight(), GetPriority());
 
-       __width = width;
-       __height = height;
-       SendResizeRequest(__width, __height);
+       SetWidth(width);
+       SetHeight(height);
+
+       SendResizeRequest(width, height);
 }
 
 void
-_AppWidgetContext::OnForeground()
+_AppWidgetContext::OnForeground(void)
 {
        SysLog(NID_SHELL, "OnForeground");
 
-       if (__isForeground)
+       if (!IsPaused())
        {
                SysLog(NID_SHELL, "%ls is already resumed.", (this->GetAppId()).GetPointer());
                return;
        }
 
-       __isForeground = true;
+       this->SetForeground(true);
 
        if (__hasPendingRequest == true)
        {
-               OnUpdate(__pendedArgument);
+               OnUpdate(__pendingArgument);
        }
        else
        {
@@ -194,29 +196,29 @@ _AppWidgetContext::OnForeground()
 }
 
 void
-_AppWidgetContext::OnBackground()
+_AppWidgetContext::OnBackground(void)
 {
        SysLog(NID_SHELL, "OnBackground");
 
-       if (!__isForeground)
+       if (IsPaused())
        {
                SysLog(NID_SHELL, "%ls is already paused.", (this->GetAppId()).GetPointer());
                return;
        }
-       __isForeground = false;
+       SetForeground(false);
 }
 
 bool
 _AppWidgetContext::IsPaused(void) const
 {
-       return __isForeground ? false : true;
+       return IsForeground() ? false : true;
 }
 
 void
 _AppWidgetContext::OnPopupCreated(double x, double y, int width, int height)
 {
-       __pAppWidgetPopup = new (std::nothrow) _AppWidgetPopupContext(__userInfo, __providerId, __instanceId, width, height, __priority, this);
-       __pAppWidgetPopup->SetIpcClientId(__ipcClientId);
+       __pAppWidgetPopup = new (std::nothrow) _AppWidgetPopupContext(GetUserInfo(), GetProviderId(), GetInstanceId(), GetWidth(), GetHeight(), GetPriority(), this);
+       __pAppWidgetPopup->SetIpcClientId(GetClientId());
        __pAppWidgetPopup->OnPopupCreated(x, y, width, height);
 }
 
@@ -236,19 +238,19 @@ _AppWidgetContext::OnPopupDestoyed(void)
 result
 _AppWidgetContext::SendAddRequest(int width, int height)
 {
-       std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN() );
+       std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN());
 
-       return SendRequestToApp( __appId, APPWIDGET_ON_ADD, pArgs.get());
+       return SendRequestToApp(GetAppId(), APPWIDGET_ON_ADD, pArgs.get());
 }
 
 result
 _AppWidgetContext::SendUpdateRequest(int width, int height, const String& argument)
 {
-       std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN() );
+       std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN());
 
        pArgs->Add(new String(ARG_KEY_ARGUMENT), new String(argument));
 
-       return SendRequestToApp( __appId, APPWIDGET_ON_UPDATE, pArgs.get());
+       return SendRequestToApp(GetAppId(), APPWIDGET_ON_UPDATE, pArgs.get());
 }
 
 result
@@ -256,25 +258,25 @@ _AppWidgetContext::SendResizeRequest(int width, int height)
 {
        std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN() );
 
-       return SendRequestToApp( __appId, APPWIDGET_ON_RESIZE, pArgs.get());
+       return SendRequestToApp(GetAppId(), APPWIDGET_ON_RESIZE, pArgs.get());
 }
 
 result
-_AppWidgetContext::SendRemoveRequest()
+_AppWidgetContext::SendRemoveRequest(void)
 {
-       std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN() );
+       std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN());
 
-       return SendRequestToApp( __appId, APPWIDGET_ON_REMOVE, pArgs.get());
+       return SendRequestToApp(GetAppId(), APPWIDGET_ON_REMOVE, pArgs.get());
 }
 
 void
 _AppWidgetContext::SendPendingTouchEvent(void)
 {
-       for(int i =0; i< __pPendingTouchEventList->GetCount(); i++)
+       for (int i =0; i< __pPendingTouchEventList->GetCount(); i++)
        {
                PendingTouchEvent* pTouchEvent = null;
                __pPendingTouchEventList->GetAt(i, pTouchEvent);
-               AppWidgetManagerService::GetInstance()->SendTouchEvent(__ipcClientId, __instanceId, pTouchEvent->eventType, pTouchEvent->timeStamp, pTouchEvent->x, pTouchEvent->y);
+               AppWidgetManagerService::GetInstance()->SendTouchEvent(GetClientId(), GetInstanceId(), pTouchEvent->eventType, pTouchEvent->timeStamp, pTouchEvent->x, pTouchEvent->y);
                delete pTouchEvent;
        }
        __pPendingTouchEventList->RemoveAll();
@@ -283,11 +285,11 @@ _AppWidgetContext::SendPendingTouchEvent(void)
 result
 _AppWidgetContext::SendTouchEvent(buffer_event eventType, double timeStamp, double x, double y)
 {
-       if( HasValidClientId() && IsRunning() )
+       if (HasValidClientId() && IsRunning())
        {
                SysAssert(IsSharedMemCreated() == true);
                SysLog(NID_SHELL, "send IPC message");
-               AppWidgetManagerService::GetInstance()->SendTouchEvent(__ipcClientId, __instanceId, eventType, timeStamp, x, y);
+               AppWidgetManagerService::GetInstance()->SendTouchEvent(GetClientId(), GetInstanceId(), eventType, timeStamp, x, y);
        }
        else
        {
@@ -301,7 +303,7 @@ _AppWidgetContext::SendTouchEvent(buffer_event eventType, double timeStamp, doub
                pArgs->Add(new String(ARG_KEY_X), new String(Double::ToString(x)));
                pArgs->Add(new String(ARG_KEY_Y), new String(Double::ToString(y)));
 
-               return SendRequestToApp( __appId, APPWIDGET_ON_TOUCH, pArgs.get());
+               return SendRequestToApp(GetAppId(), APPWIDGET_ON_TOUCH, pArgs.get());
        }
        return E_SUCCESS;
 }
@@ -315,11 +317,11 @@ _AppWidgetContext::SendRequestToApp(const AppId& appId, const String& operation,
 result
 _AppWidgetContext::RequestUpdateRemote(int width, int height)
 {
-       std::unique_ptr<char[]> packageName(_StringConverter::CopyToCharArrayN(__providerId));
-       std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(__instanceId));
-       std::unique_ptr<char[]> content_info(_StringConverter::CopyToCharArrayN(__userInfo));
+       std::unique_ptr<char[]> packageName(_StringConverter::CopyToCharArrayN(GetProviderId()));
+       std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(GetInstanceId()));
+       std::unique_ptr<char[]> content_info(_StringConverter::CopyToCharArrayN(GetUserInfo()));
 
-       int ret = provider_send_updated(packageName.get(), id.get(), width, height, __priority, content_info.get(), null);
+       int ret = provider_send_updated(packageName.get(), id.get(), width, height, GetPriority(), content_info.get(), null);
        SysTryReturnResult(NID_SHELL, ret >= 0 , E_SYSTEM, "[E_SYSTEM] failed to provider_send_updated");
 
        SendPendingTouchEvent();
@@ -332,11 +334,11 @@ _AppWidgetContext::CreateRequestArgsN(void)
 {
        HashMap* pArgs = new (std::nothrow) HashMap(SingleObjectDeleter);
        pArgs->Construct();
-       pArgs->Add(new String(ARG_KEY_INSTANCE_ID), new String(__instanceId));
-       pArgs->Add(new String(ARG_KEY_PROVIDER_NAME), new String(__providerName));
-       pArgs->Add(new String(ARG_KEY_USER_INFO), new String(__userInfo));
-       pArgs->Add(new String(ARG_KEY_WIDTH), new String(Integer::ToString(__width)));
-       pArgs->Add(new String(ARG_KEY_HEIGHT), new String(Integer::ToString(__height)));
+       pArgs->Add(new String(ARG_KEY_INSTANCE_ID), new String(GetInstanceId()));
+       pArgs->Add(new String(ARG_KEY_PROVIDER_NAME), new String(GetProviderName()));
+       pArgs->Add(new String(ARG_KEY_USER_INFO), new String(GetUserInfo()));
+       pArgs->Add(new String(ARG_KEY_WIDTH), new String(Integer::ToString(GetWidth())));
+       pArgs->Add(new String(ARG_KEY_HEIGHT), new String(Integer::ToString(GetHeight())));
 
        return pArgs;
 }
@@ -359,10 +361,9 @@ _AppWidgetContext::OnTimerExpired(Tizen::Base::Runtime::Timer& timer)
 {
        if (&timer == &__updateTimer)
        {
-               SysLog(NID_SHELL, "update timer is expired for appWidget app(%ls)..", __providerId.GetPointer());
+               SysLog(NID_SHELL, "update timer is expired for appWidget app(%ls).", GetProviderId().GetPointer());
                OnUpdate(L"");
        }
 }
 
-} } } // Tizen::Shell::App
-
+}}}  // Tizen::Shell::App
index 70901b1..5b471de 100644 (file)
 
 #include <stdlib.h>
 #include <unique_ptr.h>
-#include <provider_buffer.h>
-#include <FBase.h>
+#include <provider.h>
+#include <FBaseColHashMap.h>
 #include <FBaseSysLog.h>
 #include <FBase_StringConverter.h>
 #include <FApp_AppMessageImpl.h>
 #include <FApp_AppArg.h>
 #include <FApp_AppControlManager.h>
-#include <FShell_TemplateUtil.h>
-#include <FShell_AppWidgetManagerImpl.h>
+#include "FShell_AppWidgetManagerImpl.h"
 #include "FShell_AppWidgetContextBase.h"
 
 // provider/src/fb.c
@@ -69,8 +68,7 @@ struct livebox_buffer {
        void *data;
 };
 
-static int AppWidgetHandleBufferEventCallback(struct livebox_buffer *info, enum buffer_event event,
-               double timestamp, double x, double y, void* data);
+static int AppWidgetHandleBufferEventCallback(struct livebox_buffer *info, enum buffer_event event, double timestamp, double x, double y, void* data);
 
 namespace Tizen { namespace Shell  { namespace App
 {
@@ -92,7 +90,6 @@ const wchar_t ARG_KEY_ARGUMENT[] = L"_Argument";
 const wchar_t ARG_KEY_EVENT_TYPE[] = L"_EventType";
 const wchar_t ARG_KEY_TIME_STAMP[] = L"_TimeStamp";
 
-
 _AppWidgetContextBase::_AppWidgetContextBase(target_type type, const String& userInfo, const String& providerId, const String& instanceId, int width, int height, int priority)
        :__type(type)
        ,__userInfo(userInfo)
@@ -112,13 +109,12 @@ _AppWidgetContextBase::_AppWidgetContextBase(target_type type, const String& use
        SysLog(NID_SHELL, "appId(%ls), providerId(%ls), instanceId(%ls), width(%d), height(%d), priority(%d)", __appId.GetPointer(), __providerId.GetPointer(), __instanceId.GetPointer(), __width, __height, __priority);
 }
 
-_AppWidgetContextBase::~_AppWidgetContextBase()
+_AppWidgetContextBase::~_AppWidgetContextBase(void)
 {
        SysLog(NID_SHELL, "providerId(%ls), instanceId(%ls), width(%d), height(%d), priority(%d)", __providerId.GetPointer(), __instanceId.GetPointer(), __width, __height, __priority);
        ReleaseSharedMem();
 }
 
-
 void
 _AppWidgetContextBase::SetIpcClientId(int clientId)
 {
@@ -172,19 +168,19 @@ _AppWidgetContextBase::GetSharedMemId(int w, int h)
 
 
 void
-_AppWidgetContextBase::Suspend()
+_AppWidgetContextBase::Suspend(void)
 {
        __providerState = SUSPENDED;
 }
 
 bool
-_AppWidgetContextBase::IsRunning() const
+_AppWidgetContextBase::IsRunning(void) const
 {
        return (__providerState == RUNNING);
 }
 
 result
-_AppWidgetContextBase::ReleaseSharedMem()
+_AppWidgetContextBase::ReleaseSharedMem(void)
 {
        SysLog(NID_SHELL, "Enter");
 
@@ -229,6 +225,72 @@ _AppWidgetContextBase::GetProviderName(void) const
        return __providerName;
 }
 
+String
+_AppWidgetContextBase::GetUserInfo(void) const
+{
+       return __userInfo;
+}
+
+void
+_AppWidgetContextBase::SetForeground(bool foreground)
+{
+       __isForeground = foreground;
+}
+
+bool
+_AppWidgetContextBase::IsForeground(void) const
+{
+       return __isForeground;
+}
+
+int
+_AppWidgetContextBase::GetClientId(void) const
+{
+       return __ipcClientId;
+}
+
+int
+_AppWidgetContextBase::GetWidth(void) const
+{
+       return __width;
+}
+
+int
+_AppWidgetContextBase::GetHeight(void) const
+{
+       return __height;
+}
+
+String
+_AppWidgetContextBase::GetInstanceId(void) const
+{
+       return __instanceId;
+}
+
+String
+_AppWidgetContextBase::GetProviderId(void) const
+{
+       return __providerId;
+}
+
+int
+_AppWidgetContextBase::GetPriority(void) const
+{
+       return __priority;
+}
+
+void
+_AppWidgetContextBase::SetWidth(int width)
+{
+       __width = width;
+}
+
+void
+_AppWidgetContextBase::SetHeight(int height)
+{
+       __height = height;
+}
+
 result
 _AppWidgetRequestHelper::SendRequestToApp(const AppId& appId, const String& operation, HashMap* pArgs)
 {
@@ -241,40 +303,41 @@ _AppWidgetRequestHelper::SendRequestToApp(const AppId& appId, const String& oper
        std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId) );
        std::unique_ptr<char[]> pOperation(_StringConverter::CopyToCharArrayN(operation) );
 
-       return Tizen::App::_AppControlManager::GetInstance()->LaunchPkg(msg, pAppId.get(), pOperation.get(), null, null, null, null);
-}
+       result r = Tizen::App::_AppControlManager::GetInstance()->LaunchPkg(msg, pAppId.get(), pOperation.get(), null, null, null, null);
+       SysLog(NID_SHELL, "The result of SendRequestToApp [%s]", GetErrorMessage(r));
 
-} } } // Tizen::Shell::App {
+       return r;
+}
 
+}}} // Tizen::Shell::App
 
 ////////////////////////////////////////////
 // callback
 ////////////////////////////////////////////
-static int AppWidgetHandleBufferEventCallback( struct livebox_buffer *info, enum buffer_event event,
-               double timestamp, double x, double y, void* data)
+static int AppWidgetHandleBufferEventCallback( struct livebox_buffer *info, enum buffer_event event, double timestamp, double x, double y, void* data)
 {
     SysLog(NID_SHELL, "timestamp(%f), x(%f), y(%f)", timestamp, x, y);
 
     Tizen::Shell::App::_AppWidgetContextBase *pAppWidgetBase = static_cast<Tizen::Shell::App::_AppWidgetContextBase*>(data);
     SysTryReturn(NID_SHELL, pAppWidgetBase != null, 0, E_SYSTEM, "[E_SYSTEM] retrieved pAppWidgetBase is null");
 
-    ifevent ==  BUFFER_EVENT_ENTER)
+    if (event ==  BUFFER_EVENT_ENTER)
     {
        SysLog(NID_SHELL, "BUFFER_EVENT_ENTER");
     }
-    else if(   event ==  BUFFER_EVENT_LEAVE)
+    else if (event ==  BUFFER_EVENT_LEAVE)
     {
        SysLog(NID_SHELL, "BUFFER_EVENT_LEAVE");
     }
-    else if(   event ==  BUFFER_EVENT_DOWN)
+    else if (event ==  BUFFER_EVENT_DOWN)
        {
                SysLog(NID_SHELL, "BUFFER_EVENT_DOWN");
        }
-    else if(   event ==  BUFFER_EVENT_MOVE)
+    else if (event ==  BUFFER_EVENT_MOVE)
     {
                SysLog(NID_SHELL, "BUFFER_EVENT_MOVE");
        }
-    else if(   event ==  BUFFER_EVENT_UP)
+    else if(event ==  BUFFER_EVENT_UP)
        {
                SysLog(NID_SHELL, "BUFFER_EVENT_UP");
        }
index 1f51a0b..81bf33b 100644 (file)
  * @brief      This is the implementation for the AppWidgetManagerService class.
  */
 
-#include <stdlib.h>
-#include <unistd.h>
 #include <unique_ptr.h>
 #include <provider.h>
-#include <aul.h>
-
-#include <FBase.h>
 #include <FBaseSysLog.h>
-#include <FApp.h>
+#include <FBaseColIList.h>
+#include <FAppApp.h>
 #include <FApp_AppManagerImpl.h>
 #include <FIo_IpcServer.h>
 #include <FBase_StringConverter.h>
-
 #include "FShell_AppWidgetContext.h"
 #include "FShell_AppWidgetPopupContext.h"
 #include "FShell_AppWidgetManagerStub.h"
-
 #include "FShell_AppWidgetManagerService.h"
 
 namespace Tizen { namespace Shell  { namespace App {
@@ -55,12 +49,12 @@ static const RequestId      LOCAL_EVENT_REQUEST_UPDATE = 0;
 
 extern const int UPDATE_PERIOD_MSEC_MIN;
 
-AppWidgetManagerService::AppWidgetManagerService()
+AppWidgetManagerService::AppWidgetManagerService(void)
 {
 
 }
 
-AppWidgetManagerService::~AppWidgetManagerService()
+AppWidgetManagerService::~AppWidgetManagerService(void)
 {
        __pingTimer.Cancel();
        DeinitializeMasterDaemonEventReceiver();
@@ -83,7 +77,7 @@ AppWidgetManagerService::GetInstance(void)
 }
 
 result
-AppWidgetManagerService::Construct()
+AppWidgetManagerService::Construct(void)
 {
        _AppWidgetManagerStub::StartIpcServer();
 
@@ -118,14 +112,13 @@ int
 AppWidgetManagerService::AppWidgetDisconnected(struct event_arg *arg, void* data)
 {
        SysLog(NID_SHELL, "success to be disconnected with master daemon");
-//     aul_terminate_pid(getpid());
     return 0;
 }
 
 void
-AppWidgetManagerService::StartPingTimer()
+AppWidgetManagerService::StartPingTimer(void)
 {
-       __pingTimer.Construct(*this);//, true);
+       __pingTimer.Construct(*this);
        __pingTimer.StartAsRepeatable(120000);
 }
 
@@ -140,12 +133,12 @@ AppWidgetManagerService::OnTimerExpired(Timer& timer)
 _AppWidgetContext*
 AppWidgetManagerService::Find(const String& appId, const String& instanceId) const
 {
-       for( int i = 0; i < __appWidgetContextList.GetCount(); i++ )
+       for (int i = 0; i < __appWidgetContextList.GetCount(); i++)
        {
                _AppWidgetContext* pAppWidgetContext = null;
                __appWidgetContextList.GetAt(i, pAppWidgetContext);
 
-               if ( pAppWidgetContext->__instanceId == instanceId )
+               if (pAppWidgetContext->GetInstanceId() == instanceId)
                {
                        return pAppWidgetContext;
                }
@@ -156,14 +149,14 @@ AppWidgetManagerService::Find(const String& appId, const String& instanceId) con
 result
 AppWidgetManagerService::SetIpcClientIds(const Tizen::App::AppId& appId, int clientId)
 {
-       for( int i = 0; i < __appWidgetContextList.GetCount(); i++ )
+       for (int i = 0; i < __appWidgetContextList.GetCount(); i++)
        {
                _AppWidgetContext* pAppWidgetContext = null;
                __appWidgetContextList.GetAt(i, pAppWidgetContext);
-               SysLog(NID_SHELL, "%ls", pAppWidgetContext->__instanceId.GetPointer());
-               SysLog(NID_SHELL, "%ls, %ls", pAppWidgetContext->__providerId.GetPointer(), appId.GetPointer());
+               SysLog(NID_SHELL, "%ls", pAppWidgetContext->GetInstanceId().GetPointer());
+               SysLog(NID_SHELL, "%ls, %ls", pAppWidgetContext->GetProviderId().GetPointer(), appId.GetPointer());
 
-               if ( pAppWidgetContext->__appId == appId )
+               if (pAppWidgetContext->GetAppId() == appId)
                {
                        SysLog(NID_SHELL,"");
                        pAppWidgetContext->SetIpcClientId(clientId);
@@ -203,7 +196,7 @@ AppWidgetManagerService::OnIpcClientDisconnected(const _IpcServer& server, int c
 result
 AppWidgetManagerService::AddAppWidget(_AppWidgetContext* pAppWidgetContext)
 {
-       SysLog(NID_SHELL, "%ls, %ls, count(%d)", pAppWidgetContext->__providerId.GetPointer(), pAppWidgetContext->__instanceId.GetPointer(), __appWidgetContextList.GetCount());
+       SysLog(NID_SHELL, "%ls, %ls, count(%d)", pAppWidgetContext->GetProviderId().GetPointer(), pAppWidgetContext->GetInstanceId().GetPointer(), __appWidgetContextList.GetCount());
 
        return __appWidgetContextList.Add(pAppWidgetContext);
 }
@@ -230,7 +223,6 @@ AppWidgetManagerService::RemoveAppWidget(const char* pPackageName, const char* p
        return r;
 }
 
-
 ///////////////////////////////////////////////////////
 // MasterDaemonEventReceiver implementation
 ///////////////////////////////////////////////////////
@@ -254,9 +246,9 @@ AppWidgetManagerService::OnAppWidgetCreate(struct event_arg *arg, int *width, in
        pAppWidgetService->AddAppWidget(pAppWidgetContext);
        pAppWidgetContext->OnAdded();
 
-       *priority = pAppWidgetContext->__priority;
-       *height= pAppWidgetContext->__height;
-       *width = pAppWidgetContext->__width;
+       *priority = pAppWidgetContext->GetPriority();
+       *height= pAppWidgetContext->GetHeight();
+       *width = pAppWidgetContext->GetWidth();
 
        SysLog(NID_SHELL, "Exit. %d appWidget(es)", pAppWidgetService->__appWidgetContextList.GetCount());
     return 0;
@@ -289,7 +281,7 @@ AppWidgetManagerService::UpdateAllAppWidgetsByAppId(const String& providerId)
                _AppWidgetContext* pAppWidgetContext = null;
                __appWidgetContextList.GetAt(i, pAppWidgetContext);
 
-               if ( pAppWidgetContext->__providerId == providerId )
+               if ( pAppWidgetContext->GetProviderId() == providerId )
                {
                        pAppWidgetContext->OnUpdate(L"");
                }
@@ -490,7 +482,7 @@ AppWidgetManagerService::InitializeMasterDaemonEventReceiver(const char *pServic
 }
 
 result
-AppWidgetManagerService::DeinitializeMasterDaemonEventReceiver()
+AppWidgetManagerService::DeinitializeMasterDaemonEventReceiver(void)
 {
        SysLog(NID_SHELL, "Enter.");
     provider_fini();
@@ -499,9 +491,8 @@ AppWidgetManagerService::DeinitializeMasterDaemonEventReceiver()
 }
 
 ///////////////////////////////////////////////////////
-// stub implmentation
+// stub implementation
 ///////////////////////////////////////////////////////
-
 result
 AppWidgetManagerService::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument)
 {
@@ -513,7 +504,7 @@ AppWidgetManagerService::RequestUpdate(const Tizen::App::AppId& appId, const Tiz
                _AppWidgetContext* pAppWidgetContext = null;
                __appWidgetContextList.GetAt(i, pAppWidgetContext);
 
-               if ( pAppWidgetContext->__appId == appId && pAppWidgetContext->__providerName == providerName)
+               if ( pAppWidgetContext->GetAppId() == appId && pAppWidgetContext->GetProviderName() == providerName)
                {
                        SysLog(NID_SHELL, "OK");
 
@@ -539,12 +530,12 @@ AppWidgetManagerService::RequestUpdateInstance(const Tizen::Base::String& instan
 {
        SysLog(NID_SHELL, "%ls, %ls", instanceId.GetPointer(), argument.GetPointer() );
 
-       forint i = 0; i < __appWidgetContextList.GetCount(); i++ )
+       for (int i = 0; i < __appWidgetContextList.GetCount(); i++ )
        {
                _AppWidgetContext* pAppWidgetContext = null;
                __appWidgetContextList.GetAt(i, pAppWidgetContext);
 
-               if ( pAppWidgetContext->__instanceId == instanceId)
+               if (pAppWidgetContext->GetInstanceId() == instanceId)
                {
                        SysLog(NID_SHELL, "OK");
 
@@ -571,12 +562,6 @@ AppWidgetManagerService::RequestSharedMemoryId(const Tizen::App::AppId& appId, c
        _AppWidgetContext* pAppWidgetContext = this->Find(appId, instanceId);
        SysTryReturnResult(NID_SHELL, pAppWidgetContext , E_SYSTEM, "[E_SYSTEM] pAppWidgetContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
 
-//     if(pAppWidgetContext->HasValidClientId() == false)
-//     {
-//             String fullAppId = __pIpcServer->GetClientApplicationId();
-//             this->SetIpcClientIds(fullAppId, __pIpcServer->GetClientId());
-//     }
-
        shmId = pAppWidgetContext->GetSharedMemId(width, height);
        SysTryReturnResult(NID_SHELL, pAppWidgetContext , shmId != -1, "[E_SYSTEM] failed to GetSharedMemId for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
 
@@ -626,27 +611,12 @@ AppWidgetManagerService::RequestSyncSharedMemoryForPD(const Tizen::App::AppId& a
 result
 AppWidgetManagerService::RequestReleaseSharedMemory(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId)
 {
-//     std::unique_ptr<char[]> pkgname(_StringConverter::CopyToCharArrayN(appId));
-//     std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(instanceId));
-//
-//     _AppWidgetContext* pAppWidgetContext = this->Find(appId, instanceId);
-//     SysTryReturnResult(NID_SHELL, pAppWidgetContext , E_SYSTEM, "[E_SYSTEM] pAppWidgetContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
-//
-//     return pAppWidgetContext->ReleaseSharedMem();
        return E_SUCCESS;
 }
 
 result
 AppWidgetManagerService::RequestReleaseSharedMemoryForPD(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId)
 {
-//     std::unique_ptr<char[]> pkgname(_StringConverter::CopyToCharArrayN(appId));
-//     std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(instanceId));
-//
-//     _AppWidgetContext* pAppWidgetContext = this->Find(appId, instanceId);
-//     SysTryReturnResult(NID_SHELL, pAppWidgetContext , E_SYSTEM, "[E_SYSTEM] pAppWidgetContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
-//     SysTryReturnResult(NID_SHELL, pAppWidgetContext->GetAppWidgetPopup(), E_SYSTEM, "[E_SYSTEM] GetAppWidgetPopup() returns null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
-//
-//     return pAppWidgetContext->GetAppWidgetPopup()->ReleaseSharedMem();
        return E_SUCCESS;
 }
 
@@ -684,7 +654,8 @@ AppWidgetManagerService::_TaskHandlerThread::OnUserEventReceivedN(RequestId reqI
                SysAssertf(false, "never get here!");
                break;
        }
+
        SysLog(NID_SHELL, "Exit.");
 }
 
-} } } //namespace Tizen { namespace Shell  { namespace App {
+}}}    // Tizen::Shell::App
index 729426c..6060529 100644 (file)
  * @brief      This is the implementation for the _AppWidgetManagerStub class.
  */
 
-#include <FBase.h>
 #include <FBaseSysLog.h>
 #include <FIo_IpcServer.h>
-#include <FShell_AppWidgetManagerIpcMessage.h>
+#include "FShell_AppWidgetManagerIpcMessage.h"
 #include "FShell_AppWidgetManagerStub.h"
 
 namespace Tizen { namespace Shell  { namespace App {
@@ -38,7 +37,6 @@ using namespace Tizen::Io;
 using namespace Tizen::Text;
 using namespace Tizen::Security;
 
-
 _AppWidgetManagerStub::_AppWidgetManagerStub(void)
 :__pIpcServer(null)
 {
@@ -79,13 +77,6 @@ CATCH:
        return r;
 }
 
-
-/////////////////////////////////////////////
-// handlers
-/////////////////////////////////////////////
-
-
-
 bool
 _AppWidgetManagerStub::OnRequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument, result* pRes)
 {
@@ -181,7 +172,6 @@ _AppWidgetManagerStub::SendTouchEventForPD(const int clientId, const String& ins
        return true;
 }
 
-
 void
 _AppWidgetManagerStub::OnIpcRequestReceived(_IpcServer& server, const IPC::Message& message)
 {
@@ -226,5 +216,4 @@ _AppWidgetManagerStub::OnIpcClientDisconnected(const _IpcServer& server, int cli
        SysLog(NID_SHELL, "(appId:%ls, clientId:%d)\n", server.GetClientApplicationId().GetPointer(), clientId);
 }
 
-
-}}}//namespace Tizen { namespace Shell  { namespace App {
+}}}    // Tizen::Shell::App
index 23cc7d5..e328f39 100644 (file)
 
 #include <stdlib.h>
 #include <unique_ptr.h>
-
-#include "provider_buffer.h"
-
-#include <FBase.h>
+#include <provider.h>
 #include <FBaseSysLog.h>
+#include <FBaseInteger.h>
+#include <FBaseDouble.h>
+#include <FBaseColHashMap.h>
+#include <FBaseColAllElementsDeleter.h>
 #include <FBase_StringConverter.h>
-
 #include <FApp_AppControlManager.h>
-
 #include "FShell_AppWidgetManagerService.h"
 #include "FShell_AppWidgetContext.h"
 #include "FShell_AppWidgetPopupContext.h"
@@ -40,25 +39,22 @@ namespace Tizen { namespace Shell  { namespace App
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 
-
-const char APPWIDGET_POPUP_ON_CREATE[] = "http://tizen.org/appcontrol/appwidgetpopup/create";
-const char APPWIDGET_POPUP_ON_DESTROY[] = "http://tizen.org/appcontrol/appwidgetpopup/destroy";
-const char APPWIDGET_POPUP_ON_TOUCH[] = "http://tizen.org/appcontrol/appwidgetpopup/touch";
-
+const wchar_t APPWIDGET_POPUP_ON_CREATE[] = L"http://tizen.org/appcontrol/appwidgetpopup/create";
+const wchar_t APPWIDGET_POPUP_ON_DESTROY[] = L"http://tizen.org/appcontrol/appwidgetpopup/destroy";
+const wchar_t APPWIDGET_POPUP_ON_TOUCH[] = L"http://tizen.org/appcontrol/appwidgetpopup/touch";
 
 _AppWidgetPopupContext::_AppWidgetPopupContext(const String& info, const String& appId, const String& instanceId, int width, int height, int priority, _AppWidgetContext* pParent)
 :_AppWidgetContextBase(TYPE_PD, info, appId, instanceId, width, height, priority)
 {
        __pParent = pParent;
-       SysLog(NID_SHELL, "appId(%ls), instanceId(%ls), width(%d), height(%d)", __providerId.GetPointer(), __instanceId.GetPointer(), __width, __height);
+       SysLog(NID_SHELL, "appId(%ls), instanceId(%ls), width(%d), height(%d)", GetProviderId().GetPointer(), GetInstanceId().GetPointer(), GetWidth(), GetHeight());
 }
 
-_AppWidgetPopupContext::~_AppWidgetPopupContext()
+_AppWidgetPopupContext::~_AppWidgetPopupContext(void)
 {
-       SysLog(NID_SHELL, "appId(%ls), instanceId(%ls), width(%d), height(%d))", __providerId.GetPointer(), __instanceId.GetPointer(), __width, __height);
+       SysLog(NID_SHELL, "appId(%ls), instanceId(%ls), width(%d), height(%d))", GetProviderId().GetPointer(), GetInstanceId().GetPointer(), GetWidth(), GetHeight());
 }
 
-
 void
 _AppWidgetPopupContext::OnPopupCreated(double x, double y, int width, int height)
 {
@@ -67,7 +63,7 @@ _AppWidgetPopupContext::OnPopupCreated(double x, double y, int width, int height
 }
 
 void
-_AppWidgetPopupContext::OnPopupDestoyed()
+_AppWidgetPopupContext::OnPopupDestoyed(void)
 {
        SysLog(NID_SHELL, "");
        SendPopupDestroyRequest();
@@ -83,47 +79,30 @@ _AppWidgetPopupContext::SendPopupCreateRequest(double x, double y, int width, in
        pArgs->Add(new String(ARG_KEY_POPUP_WIDTH), new String(Integer::ToString(width)));
        pArgs->Add(new String(ARG_KEY_POPUP_HEIGHT), new String(Integer::ToString(height)));
 
-       return SendRequestToApp( __appId, APPWIDGET_POPUP_ON_CREATE, pArgs.get());
+       return SendRequestToApp(GetAppId(), APPWIDGET_POPUP_ON_CREATE, pArgs.get());
 }
 
 result
-_AppWidgetPopupContext::SendPopupDestroyRequest()
+_AppWidgetPopupContext::SendPopupDestroyRequest(void)
 {
        std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgsN() );
 
-       return SendRequestToApp( __appId, APPWIDGET_POPUP_ON_DESTROY, pArgs.get());
+       return SendRequestToApp(GetAppId(), APPWIDGET_POPUP_ON_DESTROY, pArgs.get());
 }
 
 result
 _AppWidgetPopupContext::SendTouchEvent(buffer_event event, double timestamp, double x, double y)
 {
        SysLog(NID_SHELL, "");
-       /*if( HasValidClientId() == false )
-       {
-               std::unique_ptr<ArrayList, AllElementsDeleter> pArgs (new (std::nothrow) ArrayList);
-               pArgs->Construct();
-               pArgs->Add(*new String(__instanceId));
-               pArgs->Add(*new String(__info));
-               pArgs->Add(*new String(Integer::ToString(event)));
-               pArgs->Add(*new String(Double::ToString(timestamp)));
-               pArgs->Add(*new String(Double::ToString(x)));
-               pArgs->Add(*new String(Double::ToString(y)));
-
-               return SendRequestToApp( __appId, APPWIDGET_POPUP_ON_TOUCH, pArgs.get());
-       }
-       else*/
-       {
-//             SysAssertf( Tizen::App::AppManager::GetInstance()->IsRunning(__appId) == false, "application isn't running");
-               AppWidgetManagerService::GetInstance()->SendTouchEventForPD(__ipcClientId, __instanceId, event, timestamp, x, y);
-       }
+       AppWidgetManagerService::GetInstance()->SendTouchEventForPD(GetClientId(), GetInstanceId(), event, timestamp, x, y);
        return E_SUCCESS;
 }
 
 result
-_AppWidgetPopupContext::RequestUpdateRemote()
+_AppWidgetPopupContext::RequestUpdateRemote(void)
 {
-       std::unique_ptr<char[]> packageName(_StringConverter::CopyToCharArrayN(__providerId));
-       std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(__instanceId));
+       std::unique_ptr<char[]> packageName(_StringConverter::CopyToCharArrayN(GetProviderId()));
+       std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(GetInstanceId()));
 
        int ret = provider_send_desc_updated(packageName.get(), id.get(), null);
        SysTryReturnResult(NID_SHELL, ret >= 0 , E_SYSTEM, "[E_SYSTEM] failed to provider_send_updated");
@@ -137,14 +116,13 @@ _AppWidgetPopupContext::CreateRequestArgsN(void)
 {
        HashMap* pArgs = new (std::nothrow) HashMap(SingleObjectDeleter);
        pArgs->Construct();
-       pArgs->Add(new String(ARG_KEY_INSTANCE_ID), new String(__instanceId));
-       pArgs->Add(new String(ARG_KEY_PROVIDER_NAME), new String(__providerName));
-       pArgs->Add(new String(ARG_KEY_USER_INFO), new String(__userInfo));
-       pArgs->Add(new String(ARG_KEY_WIDTH), new String(Integer::ToString(__pParent->__width)));
-       pArgs->Add(new String(ARG_KEY_HEIGHT), new String(Integer::ToString(__pParent->__height)));
+       pArgs->Add(new String(ARG_KEY_INSTANCE_ID), new String(GetInstanceId()));
+       pArgs->Add(new String(ARG_KEY_PROVIDER_NAME), new String(GetProviderName()));
+       pArgs->Add(new String(ARG_KEY_USER_INFO), new String(GetUserInfo()));
+       pArgs->Add(new String(ARG_KEY_WIDTH), new String(Integer::ToString(__pParent->GetWidth())));
+       pArgs->Add(new String(ARG_KEY_HEIGHT), new String(Integer::ToString(__pParent->GetHeight())));
 
        return pArgs;
 }
 
-} } } // Tizen::Shell::App {
-
+}}} // Tizen::Shell::App
index 097d9d0..1cdc1f6 100644 (file)
@@ -27,12 +27,11 @@ using namespace Tizen::Base;
 using namespace Tizen::System;
 using namespace Tizen::Shell::App;
 
-
-OspAppWidgetService::OspAppWidgetService()
+OspAppWidgetService::OspAppWidgetService(void)
 {
 }
 
-OspAppWidgetService::~OspAppWidgetService()
+OspAppWidgetService::~OspAppWidgetService(void)
 {
 }