Fixed LiveboxId
authorHeeJu Kang <mobum.kang@samsung.com>
Fri, 4 Jan 2013 05:49:13 +0000 (14:49 +0900)
committerHeeJu Kang <mobum.kang@samsung.com>
Fri, 4 Jan 2013 05:49:13 +0000 (14:49 +0900)
Change-Id: Ie9e7bb22f368a426e56637ae6535bcb6fa971b36
Signed-off-by: HeeJu Kang <mobum.kang@samsung.com>
inc/FShellLiveboxView.h
src/FShellLiveboxView.cpp
src/FShell_LiveboxView.cpp
src/FShell_LiveboxView.h
src/FShell_LiveboxViewImpl.cpp
src/FShell_LiveboxViewImpl.h
src/FShell_LiveboxViewManager.cpp
src/FShell_LiveboxViewModel.cpp
src/FShell_LiveboxViewModel.h
src/FShell_LiveboxViewPresenter.cpp
src/FShell_LiveboxViewPresenter.h

index a1feee0..6fceb7e 100644 (file)
@@ -24,6 +24,7 @@
 #ifndef _FSHELL_LIVEBOX_VIEW_H_
 #define _FSHELL_LIVEBOX_VIEW_H_
 
+#include <FAppTypes.h>
 #include <FUiContainer.h>
 
 namespace Tizen { namespace Base
@@ -31,7 +32,6 @@ namespace Tizen { namespace Base
 class String;
 }} //Tizen::Base
 
-
 namespace Tizen { namespace Shell
 {
 
@@ -77,7 +77,7 @@ public:
         * @exception   E_APP_NOT_INSTALLED     The application is not installed.\r
         * @exception   E_OBJ_NOT_FOUND         The specified Livebox provider is not found.
         */
-       result Construct(const Tizen::Base::String& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect);
+       result Construct(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect);
 
        /**
         * Initializes this instance of %LiveboxView with the specified parameter.
@@ -95,7 +95,7 @@ public:
         * @exception   E_APP_NOT_INSTALLED     The application is not installed.\r
         * @exception   E_OBJ_NOT_FOUND         The specified Livebox provider is not found.
         */
-       result Construct(const Tizen::Base::String& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const Tizen::Base::String& userInfo);
+       result Construct(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const Tizen::Base::String& userInfo);
 
 protected:
        //
index 0ea475b..baf4d67 100644 (file)
@@ -27,6 +27,7 @@
 #include "FShell_LiveboxViewImpl.h"
 
 using namespace std;
+using namespace Tizen::App;
 using namespace Tizen::Base;
 using namespace Tizen::Graphics;
 
@@ -42,13 +43,13 @@ LiveboxView::~LiveboxView(void)
 }
 
 result
-LiveboxView::Construct(const String& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect)
+LiveboxView::Construct(const AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect)
 {
        return Construct(appId, providerName, rect, L"default");
 }
 
 result
-LiveboxView::Construct(const String& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const String& userInfo)
+LiveboxView::Construct(const AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const String& userInfo)
 {
        SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
 
index 408d435..b724f91 100644 (file)
@@ -98,8 +98,13 @@ _LiveboxView::CreateLiveboxViewN(void)
 }
 
 result
-_LiveboxView::Initialize(const String& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const String& userInfo)
+_LiveboxView::Initialize(const AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const String& userInfo)
 {
+       SysLog(NID_UI_CTRL, "appId [%ls]", appId.GetPointer());
+       SysLog(NID_UI_CTRL, "providerName [%ls]", providerName.GetPointer());
+       SysLog(NID_UI_CTRL, "[%d %d %d %d]", rect.x, rect.y, rect.width, rect.height);
+       SysLog(NID_UI_CTRL, "userInfo [%ls]", userInfo.GetPointer());
+
        result r = SetBounds(rect);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -147,6 +152,12 @@ _LiveboxView::GetAppId(void) const
        return __pLiveboxViewPresenter->GetAppId();
 }
 
+String
+_LiveboxView::GetLiveboxId(void) const
+{
+       return __pLiveboxViewPresenter->GetLiveboxId();
+}
+
 Bitmap*
 _LiveboxView::GetAppIconBitmap(void) const
 {
index 6867f1c..6ce119b 100644 (file)
@@ -27,6 +27,7 @@
 #include <Evas.h>
 #include <Ecore.h>
 #include <Ecore_X.h>
+#include <FAppTypes.h>
 #include "FUi_Control.h"
 #include "FUi_ITouchFlickGestureEventListener.h"
 #include "FUiAnim_VisualElement.h"
@@ -69,9 +70,10 @@ public:
        static _LiveboxView* CreateLiveboxViewN(void);
        virtual ~_LiveboxView(void);
 
-       result Initialize(const Tizen::Base::String& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const Tizen::Base::String& userInfo);
+       result Initialize(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const Tizen::Base::String& userInfo);
        _LiveboxPopupView* GetLiveboxPopup(void) const;
        Tizen::Base::String GetAppId(void) const;
+       Tizen::Base::String GetLiveboxId(void) const;
        Tizen::Graphics::Bitmap* GetAppIconBitmap(void) const;
        Tizen::Graphics::Bitmap* GetBitmap(void) const;
        bool IsUpdated(void) const;
index b3e5ac2..87be3c6 100644 (file)
@@ -23,6 +23,7 @@
 #include "FShell_LiveboxViewImpl.h"
 
 using namespace std;
+using namespace Tizen::App;
 using namespace Tizen::Base;
 using namespace Tizen::Graphics;
 
@@ -99,7 +100,7 @@ _LiveboxViewImpl::GetCore(void)
 }
 
 result
-_LiveboxViewImpl::Initialize(const String& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const String& userInfo)
+_LiveboxViewImpl::Initialize(const AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const String& userInfo)
 {
        result r = GetCore().Initialize(appId, providerName, rect, userInfo);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
index fff3497..eb5d8d9 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef _FSHELL_INTERNAL_LIVEBOX_VIEW_IMPL_H_
 #define _FSHELL_INTERNAL_LIVEBOX_VIEW_IMPL_H_
 
+#include <FAppTypes.h>
 #include <FShellLiveboxView.h>
 #include "FUi_ContainerImpl.h"
 #include "FShell_LiveboxView.h"
@@ -50,7 +51,7 @@ public:
        virtual const _LiveboxView& GetCore(void) const;
        virtual _LiveboxView& GetCore(void);
 
-       result Initialize(const Tizen::Base::String& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const Tizen::Base::String& userInfo);
+       result Initialize(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::Rectangle& rect, const Tizen::Base::String& userInfo);
 
 protected:
        _LiveboxViewImpl(LiveboxView* pPublic, _LiveboxView* pCore);
index d2e1f0b..6bfaa10 100644 (file)
@@ -348,8 +348,8 @@ _LiveboxViewManager::AddLiveboxView(_LiveboxView* pLiveboxView, const String& us
 {
        SysTryReturn(NID_UI_CTRL, pLiveboxView, null, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 
-       unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(pLiveboxView->GetAppId()));
-       SysTryReturn(NID_UI_CTRL, pAppId, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+       unique_ptr<char[]> pLiveboxId(_StringConverter::CopyToCharArrayN(pLiveboxView->GetLiveboxId()));
+       SysTryReturn(NID_UI_CTRL, pLiveboxId, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
 
        unique_ptr<char[]> pContent(_StringConverter::CopyToCharArrayN(userInfo));
        SysTryReturn(NID_UI_CTRL, pContent, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
@@ -357,7 +357,7 @@ _LiveboxViewManager::AddLiveboxView(_LiveboxView* pLiveboxView, const String& us
        const char* pCluster = "user,created";
        const char* pCategory = "default";
 
-       livebox* pLivebox = livebox_add_with_size(pAppId.get(), pContent.get(), pCluster, pCategory, GetLiveboxSizeType(pLiveboxView->GetSize()), 1, OnLiveboxAdded, this);
+       livebox* pLivebox = livebox_add_with_size(pLiveboxId.get(), pContent.get(), pCluster, pCategory, GetLiveboxSizeType(pLiveboxView->GetSize()), 1, OnLiveboxAdded, this);
        SysTryReturn(NID_UI_CTRL, pLivebox, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
 
        __pViewMap->Add(pLivebox, pLiveboxView);
@@ -768,12 +768,12 @@ _LiveboxViewManager::OnLiveboxEventReceived(livebox* pLivebox, livebox_event_typ
 }
 
 int
-_LiveboxViewManager::OnLiveboxFaultReceived(livebox_fault_type faultType, const char* pAppId, const char* pFilename, const char* pFuncName, void* pData)
+_LiveboxViewManager::OnLiveboxFaultReceived(livebox_fault_type faultType, const char* pLiveboxId, const char* pFilename, const char* pFuncName, void* pData)
 {
        if (faultType == LB_FAULT_DEACTIVATED)
        {
-               SysLog(NID_UI_CTRL, "type (%d) packageName (%s) fileName (%s) funcName (%s)", faultType, pAppId, pFilename, pFuncName);
-               livebox_activate(pAppId, OnLiveboxActivated, pData);
+               SysLog(NID_UI_CTRL, "type (%d) packageName (%s) fileName (%s) funcName (%s)", faultType, pLiveboxId, pFilename, pFuncName);
+               livebox_activate(pLiveboxId, OnLiveboxActivated, pData);
        }
 
        return EXIT_SUCCESS;
index e159158..bd604c6 100644 (file)
@@ -41,10 +41,13 @@ _LiveboxViewModel::~_LiveboxViewModel(void)
 }
 
 void
-_LiveboxViewModel::Initialize(const Tizen::Base::String& appId, const Tizen::Base::String& providerName)
+_LiveboxViewModel::Initialize(const AppId& appId, const Tizen::Base::String& providerName)
 {
        __appId = appId;
        __providerName = providerName;
+       __liveboxId = __appId + L"." + __providerName;
+
+       SysLog(NID_UI_CTRL, "(%ls %ls %ls)", __appId.GetPointer(), __providerName.GetPointer(), __liveboxId.GetPointer());
 
        LiveboxProviderInfo* pLiveboxProviderInfo = LiveboxManager::GetInstance()->GetLiveboxProviderInfoN(appId, providerName);
        SysTryReturnVoidResult(NID_UI_CTRL, pLiveboxProviderInfo, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
@@ -55,14 +58,21 @@ _LiveboxViewModel::Initialize(const Tizen::Base::String& appId, const Tizen::Bas
 
        SysLog(NID_UI_CTRL, "ProviderInfo(%ls %ls %ls %ls)", __pLiveboxProviderInfo->GetName().GetPointer(), __pLiveboxProviderInfo->GetDisplayName().GetPointer(),
                __pLiveboxProviderInfo->GetIconPath().GetPointer(), __pLiveboxProviderInfo->GetCongiturationAppControlAppId().GetPointer());
+
 }
 
-String
+AppId
 _LiveboxViewModel::GetAppId(void) const
 {
        return __appId;
 }
 
+String
+_LiveboxViewModel::GetLiveboxId(void) const
+{
+       return __liveboxId;
+}
+
 Tizen::Base::String
 _LiveboxViewModel::GetProviderName(void) const
 {
index 271453d..abaa415 100644 (file)
@@ -24,6 +24,7 @@
 #define _FSHELL_INTERNAL_LIVEBOX_VIEW_MODEL_H_
 
 #include <unique_ptr.h>
+#include <FAppTypes.h>
 #include <FBaseObject.h>
 #include <FBaseString.h>
 
@@ -40,8 +41,9 @@ public:
        virtual ~_LiveboxViewModel(void);
 
 public:
-       void Initialize(const Tizen::Base::String& appId, const Tizen::Base::String& providerName);
-       Tizen::Base::String GetAppId(void) const;
+       void Initialize(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
+       Tizen::App::AppId GetAppId(void) const;
+       Tizen::Base::String GetLiveboxId(void) const;
        Tizen::Base::String GetProviderName(void) const;
        Tizen::Base::String GetDisplayName(void) const;
        Tizen::Base::String GetAppIconPath(void) const;
@@ -52,6 +54,7 @@ private:
 
 private:
        Tizen::Base::String __appId;
+       Tizen::Base::String __liveboxId;
        Tizen::Base::String __providerName;
        std::unique_ptr<LiveboxProviderInfo> __pLiveboxProviderInfo;
 }; // _LiveboxViewModel
index 98f9e7d..14bcf7e 100644 (file)
@@ -32,6 +32,7 @@
 #include "FShell_LiveboxViewModel.h"
 
 using namespace std;
+using namespace Tizen::App;
 using namespace Tizen::Base;
 using namespace Tizen::Graphics;
 using namespace Tizen::Graphics::_Text;
@@ -52,7 +53,7 @@ _LiveboxViewPresenter::~_LiveboxViewPresenter(void)
 }
 
 result
-_LiveboxViewPresenter::Initialize(const String& appId, const Tizen::Base::String& providerName)
+_LiveboxViewPresenter::Initialize(const AppId& appId, const Tizen::Base::String& providerName)
 {
        const int FONT_SIZE = 10;
 
@@ -79,13 +80,20 @@ _LiveboxViewPresenter::Initialize(const String& appId, const Tizen::Base::String
        return r;
 }
 
-String
+AppId
 _LiveboxViewPresenter::GetAppId(void) const
 {
        return __pLiveboxViewModel->GetAppId();
 }
 
 String
+_LiveboxViewPresenter::GetLiveboxId(void) const
+{
+       return __pLiveboxViewModel->GetLiveboxId();
+}
+
+
+String
 _LiveboxViewPresenter::GetDisplayName(void) const
 {
        return __pLiveboxViewModel->GetDisplayName();
index d0db1ad..ca98099 100644 (file)
@@ -24,6 +24,7 @@
 #define _FSHELL_INTERNAL_LIVEBOX_VIEW_PRESENTER_H_
 
 #include <unique_ptr.h>
+#include <FAppTypes.h>
 
 namespace Tizen { namespace Graphics
 {
@@ -48,8 +49,9 @@ public:
        _LiveboxViewPresenter(const _LiveboxView& liveBoxView);
        virtual ~_LiveboxViewPresenter(void);
 
-       result Initialize(const Tizen::Base::String& appId, const Tizen::Base::String& providerName);
-       Tizen::Base::String GetAppId(void) const;
+       result Initialize(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
+       Tizen::App::AppId GetAppId(void) const;
+       Tizen::Base::String GetLiveboxId(void) const;
        Tizen::Base::String GetDisplayName(void) const;
        Tizen::Base::String GetAppIconPath(void) const;