2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FShellLiveboxManager.cpp
20 * @brief This is the implementation for the LiveboxManager class.
23 #include <unique_ptr.h>
26 #include <livebox-service/livebox-service.h>
28 #include <FBaseSysLog.h>
30 #include <FGraphics.h>
32 #include <FAppPkgPackageInfo.h>
33 #include <FApp_Types.h>
34 #include <FApp_AppInfo.h>
37 #include <FShellLiveboxManager.h>
38 #include <FShellLiveboxProviderInfo.h>
39 #include "FShell_LiveboxManagerImpl.h"
42 using namespace Tizen::App;
43 using namespace Tizen::App::Package;
44 using namespace Tizen::Base;
45 using namespace Tizen::Base::Collection;
46 using namespace Tizen::Graphics;
49 namespace Tizen { namespace Shell
52 LiveboxManager::LiveboxManager()
53 :__pLiveboxManagerImpl(null)
58 LiveboxManager::~LiveboxManager()
63 LiveboxManager::GetInstance()
65 static LiveboxManager* pLiveboxManager = null;
66 if( pLiveboxManager == null)
68 pLiveboxManager = new (std::nothrow) LiveboxManager;
69 SysTryReturn(NID_APP, pLiveboxManager, null, E_OUT_OF_MEMORY, "E_OUT_OF_MEMORY" );
71 result r = pLiveboxManager->Construct();
72 // SysTryReturn(NID_APP, !IsFailed(r), null, r, "[%s] Propagating.", GetErrorMessage(r));
73 SysAssertf(!IsFailed(r), "Failed to construct LiveboxManager!!");
74 SysLog(NID_APP, "LiveboxManager instance is created.");
77 return pLiveboxManager;
81 LiveboxManager::Construct()
83 SysAssert(__pLiveboxManagerImpl == null);
85 SysLog(NID_APP, "Enter.");
86 __pLiveboxManagerImpl = _LiveboxManagerImpl::GetInstance();
87 SysAssertf(__pLiveboxManagerImpl, "Failed to construct _LiveboxManagerImpl!!");
89 SysLog(NID_APP, "Exit.");
94 Tizen::Base::Collection::IList*
95 LiveboxManager::GetLiveboxProviderInfoListN()
97 return __pLiveboxManagerImpl->GetLiveboxProviderInfoListN();
101 LiveboxManager::GetLiveboxProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName)
103 // TODO : set configurationAppcontrolAppId
104 return __pLiveboxManagerImpl->GetLiveboxProviderInfoN(appId, providerName);
108 LiveboxManager::SetLiveboxAddRequestListener(ILiveboxAddRequestListener* pListener)
110 return __pLiveboxManagerImpl->SetLiveboxAddRequestListener(pListener);