2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FAppPkg_PackageAppInfoImpl.cpp
19 * @brief This is the implementation for the _PackageAppInfoImpl class.
25 #include <unique_ptr.h>
27 #include <pkgmgr-info.h>
29 #include <FAppPkgPackageManager.h>
30 #include <FAppPkgPackageAppInfo.h>
31 #include <FBaseSysLog.h>
32 #include <FIoDatabase.h>
33 #include <FIoDbEnumerator.h>
34 #include <FIoDbStatement.h>
35 #include <FBase_StringConverter.h>
37 #include "FAppPkg_PackageManagerImpl.h"
38 #include "FApp_TemplateUtil.h"
40 using namespace Tizen::Base;
41 using namespace Tizen::Base::Collection;
42 using namespace Tizen::Graphics;
43 using namespace Tizen::Io;
45 namespace Tizen { namespace App { namespace Package
49 _PackageAppInfoImpl::GetAppId(void) const
55 _PackageAppInfoImpl::SetAppId(const AppId& appId)
62 _PackageAppInfoImpl::GetAppName(void) const
68 _PackageAppInfoImpl::SetAppName(const String& appName)
75 _PackageAppInfoImpl::GetAppDisplayName(void) const
77 return __appDiplayName;
81 _PackageAppInfoImpl::SetAppDisplayName(const String& appDiplayName)
83 __appDiplayName = appDiplayName;
88 _PackageAppInfoImpl::GetAppMenuIconPath(void) const
94 _PackageAppInfoImpl::SetAppMenuIconPath(const String& iconPath)
96 __appIconPath = iconPath;
101 _PackageAppInfoImpl::GetAppSettingIconPath(void) const
103 return __appSettingIconPath;
107 _PackageAppInfoImpl::SetAppSettingIconPath(const Tizen::Base::String& appSettingIcon)
109 __appSettingIconPath = appSettingIcon;
114 _PackageAppInfoImpl::GetAppNotificationIconPath(void) const
116 return __appNotificationIconPath;
120 _PackageAppInfoImpl::SetAppNotificationIconPath(const String& notificationIconPath)
122 __appNotificationIconPath = notificationIconPath;
127 _PackageAppInfoImpl::GetAppMenuIconN(void) const
129 SysTryReturn(NID_APP, __appIconPath.IsEmpty() == false, null, E_FILE_NOT_FOUND, "appIconPath() is empty.");
135 _PackageAppInfoImpl::GetAppMetadataListN(void) const
137 HashMap* pMap = null;
141 SysTryReturn(NID_APP, __pAppInfoHandle, null, E_SYSTEM, "__pAppInfoHandle is null.");
143 result r = E_SUCCESS;
144 int res = PMINFO_R_OK;
146 pMap = new (std::nothrow) HashMap();
147 SysTryReturn(NID_APP, pMap, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
150 res = pkgmgrinfo_appinfo_foreach_metadata(__pAppInfoHandle, MetadataHandler, pMap);
151 if (res != PMINFO_R_OK)
153 SysLog(NID_APP, "pkgmgrinfo_appinfo_foreach_metadata() is failed. result = [%d]", res);
156 pMap->RemoveAll(true);
164 SysLog(NID_APP, "GetAppMetadataListN() is not available.");
171 _PackageAppInfoImpl::GetAppCategoryListN(void) const
173 ArrayList* pList = null;
177 SysTryReturn(NID_APP, __pAppInfoHandle, null, E_SYSTEM, "[E_SYSTEM] __pAppInfoHandle is null.");
179 result r = E_SUCCESS;
180 int res = PMINFO_R_OK;
182 pList = new (std::nothrow) ArrayList();
183 SysTryReturn(NID_APP, pList, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
186 res = pkgmgrinfo_appinfo_foreach_category(__pAppInfoHandle, CategoryHandler, pList);
187 if (res != PMINFO_R_OK)
189 SysLog(NID_APP, "pkgmgrinfo_appinfo_foreach_category() is failed. result = [%d]", res);
192 pList->RemoveAll(true);
201 SysLog(NID_APP, "GetAppCategoryListN() is not available.");
208 _PackageAppInfoImpl::IsMenuIconVisible(void) const
210 return __launchingIconVisible;
214 _PackageAppInfoImpl::SetMenuIconVisible(bool visible)
216 __launchingIconVisible = visible;
221 _PackageAppInfoImpl::IsMainApp(void) const
227 _PackageAppInfoImpl::SetMainApp(bool mainApp)
234 _PackageAppInfoImpl::AddCategory(String* pCategory)
236 result r = E_SUCCESS;
237 r = __pAppCategoryList->Add(*pCategory);
238 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pAppCategoryList->Add() is failed.");
244 _PackageAppInfoImpl::GetInstance(PackageAppInfo* pPackageAppInfo)
248 return pPackageAppInfo->__pPackageAppInfoImpl;
255 _PackageAppInfoImpl::Construct(const AppId& appId)
257 int res = PMINFO_R_OK;
258 char* pExePath = null;
259 char* pDisplayName = null;
260 char* pMenuIcon = null;
261 char* pSettingIcon = null;
262 char* pNotificationIcon = null;
263 bool mainApp = false;
264 bool menuIconVisible = false;
266 std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
267 SysTryReturnResult(NID_APP, pAppId, E_OUT_OF_MEMORY, "pAppId is null");
269 res = pkgmgrinfo_appinfo_get_appinfo(pAppId.get(), &__pAppInfoHandle);
270 SysTryReturnResult(NID_APP, res == 0, E_SYSTEM, "pkgmgrinfo_appinfo_get_appinfo failed, res = [%d]", res);
272 __fromDatabase = true;
276 res = pkgmgrinfo_appinfo_get_exec(__pAppInfoHandle, &pExePath);
277 if (res == PMINFO_R_OK)
279 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_exec(): exe = [%s]", pExePath);
281 String exePath(pExePath);
282 int startIndex = exePath.GetLength() - 1;
284 result r = exePath.LastIndexOf(L'/', startIndex, indexOf);
288 exePath.SubString(indexOf + 1, appName);
290 SysLog(NID_APP, "appName = [%ls]", appName.GetPointer());
294 SysLog(NID_APP, "LastIndexOf is failed.");
299 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_exec() is failed. result = [%d]", res);
302 res = pkgmgrinfo_appinfo_get_label(__pAppInfoHandle, &pDisplayName);
303 if (res == PMINFO_R_OK)
305 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_label(): displayName = [%s]", pDisplayName);
306 String displayName(pDisplayName);
307 SetAppDisplayName(displayName);
311 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_label() is failed. result = [%d]", res);
314 res = pkgmgrinfo_appinfo_get_icon(__pAppInfoHandle, &pMenuIcon);
315 if (res == PMINFO_R_OK)
317 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_icon(): MenuIcon = [%s]", pMenuIcon);
318 String menuIcon(pMenuIcon);
319 SetAppMenuIconPath(menuIcon);
323 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_icon() is failed. result = [%d]", res);
326 res = pkgmgrinfo_appinfo_get_setting_icon(__pAppInfoHandle, &pSettingIcon);
327 if (res == PMINFO_R_OK)
329 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_setting_icon(): SettingIcon = [%s]", pSettingIcon);
330 String settingIcon(pSettingIcon);
331 SetAppSettingIconPath(settingIcon);
335 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_setting_icon() is failed. result = [%d]", res);
338 res = pkgmgrinfo_appinfo_get_notification_icon(__pAppInfoHandle, &pNotificationIcon);
339 if (res == PMINFO_R_OK)
341 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_notification_icon(): NotificationIcon = [%s]", pNotificationIcon);
342 String notificationIcon(pNotificationIcon);
343 SetAppNotificationIconPath(notificationIcon);
347 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_notification_icon() is failed. result = [%d]", res);
350 res = pkgmgrinfo_appinfo_is_mainapp(__pAppInfoHandle, &mainApp);
351 if (res == PMINFO_R_OK)
353 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_mainapp(): mainApp = [%d]", mainApp);
358 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_mainapp() is failed. result = [%d]", res);
361 res = pkgmgrinfo_appinfo_is_nodisplay(__pAppInfoHandle, &menuIconVisible);
362 if (res == PMINFO_R_OK)
364 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_nodisplay(): menuIconVisible = [%d]", menuIconVisible);
365 SetMenuIconVisible(!menuIconVisible);
369 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_nodisplay() is failed. result = [%d]", res);
376 _PackageAppInfoImpl::CategoryHandler(const char* pCategoryName, void* pUserData)
378 SysTryReturn(NID_APP, pCategoryName != null, 0, E_SYSTEM, "[E_SYSTEM] pCategoryName must not be null.");
380 SysLog(NID_APP, "Category = [%s]", pCategoryName);
381 ArrayList* pList = (ArrayList*) pUserData;
383 String* pCategory = new (std::nothrow) String (pCategoryName);
384 SysTryReturn(NID_APP, pCategory != null, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] pCategory instance must not be null.");
386 pList->Add(*pCategory);
392 _PackageAppInfoImpl::MetadataHandler(const char* pKey, const char* pValue, void* pUserData)
394 SysTryReturn(NID_APP, pKey, 0, E_SYSTEM, "pKey must not be null.");
395 SysTryReturn(NID_APP, pValue, 0, E_SYSTEM, "pValue must not be null.");
396 SysTryReturn(NID_APP, pUserData, 0, E_SYSTEM, "pUserData must not be null.");
398 SysLog(NID_APP, "Key = [%s], Value = [%s]", pKey, pValue);
400 MultiHashMap* pMultiMap = (MultiHashMap*) pUserData;
401 pMultiMap->Add(*(new (std::nothrow) String(pKey)), *(new (std::nothrow) String(pValue)));
407 _PackageAppInfoImpl::_PackageAppInfoImpl(void)
408 : __launchingIconVisible(true)
410 , __fromDatabase(false)
411 , __pLaunchConditionImplList(null)
412 , __pNotificationImplList(null)
413 , __pAppFeatureImplList(null)
414 , __pDataControlImplList(null)
415 , __pAppControlImplList(null)
416 , __pAppCategoryList(null)
420 ,__pAppInfoHandle(null)
422 __pLaunchConditionImplList = new (std::nothrow) ArrayList;
423 SysTryReturnVoidResult(NID_APP, __pLaunchConditionImplList != null, E_OUT_OF_MEMORY, "__pLaunchConditionImplList instance must not be null.");
424 __pLaunchConditionImplList->Construct();
426 __pNotificationImplList = new (std::nothrow) ArrayList;
427 SysTryReturnVoidResult(NID_APP, __pNotificationImplList != null, E_OUT_OF_MEMORY, "__pNotificationImplList instance must not be null.");
428 __pNotificationImplList->Construct();
430 __pAppFeatureImplList = new (std::nothrow) ArrayList;
431 SysTryReturnVoidResult(NID_APP, __pAppFeatureImplList != null, E_OUT_OF_MEMORY, "__pAppFeatureImplList instance must not be null.");
432 __pAppFeatureImplList->Construct();
434 __pDataControlImplList = new (std::nothrow) ArrayList;
435 SysTryReturnVoidResult(NID_APP, __pDataControlImplList != null, E_OUT_OF_MEMORY, "__pDataControlImplList instance must not be null.");
436 __pDataControlImplList->Construct();
438 __pAppControlImplList = new (std::nothrow) ArrayList;
439 SysTryReturnVoidResult(NID_APP, __pAppControlImplList != null, E_OUT_OF_MEMORY, "__pAppControlImplList instance must not be null.");
440 __pAppControlImplList->Construct();
442 __pAppCategoryList = new (std::nothrow) ArrayList;
443 SysTryReturnVoidResult(NID_APP, __pAppCategoryList != null, E_OUT_OF_MEMORY, "__pAppCategoryList instance must not be null.");
444 __pAppCategoryList->Construct();
446 __pNameList = new (std::nothrow) HashMap;
447 SysTryReturnVoidResult(NID_APP, __pNameList != null, E_OUT_OF_MEMORY, "__pNameList instance must not be null.");
448 __pNameList->Construct();
452 _PackageAppInfoImpl::~_PackageAppInfoImpl(void)
454 __pLaunchConditionImplList->RemoveAll(true);
455 delete __pLaunchConditionImplList;
457 __pNotificationImplList->RemoveAll(true);
458 delete __pNotificationImplList;
460 __pAppFeatureImplList->RemoveAll(true);
461 delete __pAppFeatureImplList;
463 __pDataControlImplList->RemoveAll(true);
464 delete __pDataControlImplList;
466 __pAppControlImplList->RemoveAll(true);
467 delete __pAppControlImplList;
469 __pAppCategoryList->RemoveAll(true);
470 delete __pAppCategoryList;
472 __pNameList->RemoveAll(true);
475 if (__pAppInfoHandle)
477 pkgmgrinfo_appinfo_destroy_appinfo(__pAppInfoHandle);
482 _PackageAppInfoImpl::GetName(void) const
488 _PackageAppInfoImpl::SetName(const String& name)
495 _PackageAppInfoImpl::GetType(void) const
501 _PackageAppInfoImpl::SetType(const String& type)
508 _PackageAppInfoImpl::GetDefault(void) const
514 _PackageAppInfoImpl::SetDefault(const String& defaultApp)
516 __default = defaultApp;
521 _PackageAppInfoImpl::GetLaunchConditionListN(void) const
523 result r = E_SUCCESS;
525 DbStatement* pStmt = null;
526 DbEnumerator* pEnum = null;
529 ArrayList* pList = null;
531 query.Format(1024, L"SELECT * FROM LaunchCondition WHERE ID = %d", GetUniqueId());
533 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
534 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
536 pStmt = db.CreateStatementN(query);
537 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
538 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
540 pEnum = db.ExecuteStatementN(*pStmt);
543 pList = new (std::nothrow) ArrayList;
544 SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
547 while (pEnum->MoveNext() == E_SUCCESS)
549 _LaunchConditionInfoImpl* pLaunchConditionImpl = new (std::nothrow) _LaunchConditionInfoImpl;
550 SysTryReturn(NID_APP, pLaunchConditionImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
555 pEnum->GetStringAt(1, name);
556 pEnum->GetStringAt(2, value);
558 pLaunchConditionImpl->SetName(name);
559 pLaunchConditionImpl->SetValue(value);
561 pList->Add(*pLaunchConditionImpl);
572 _PackageAppInfoImpl::GetLaunchConditionList(void) const
574 return __pLaunchConditionImplList;
578 _PackageAppInfoImpl::AddLaunchCondition(const _LaunchConditionInfoImpl& launchConditionImpl)
580 result r = E_SUCCESS;
581 r = __pLaunchConditionImplList->Add(launchConditionImpl);
582 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pLaunchConditionImplList->Add() is failed.");
588 _PackageAppInfoImpl::GetNotificationListN(void) const
590 result r = E_SUCCESS;
592 DbStatement* pStmt = null;
593 DbEnumerator* pEnum = null;
596 ArrayList* pList = null;
598 query.Format(1024, L"SELECT * FROM Notification WHERE ID = %d", GetUniqueId());
600 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
601 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
603 pStmt = db.CreateStatementN(query);
604 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
605 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
607 pEnum = db.ExecuteStatementN(*pStmt);
610 pList = new (std::nothrow) ArrayList;
611 SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
614 while (pEnum->MoveNext() == E_SUCCESS)
616 _NotificationInfoImpl* pNotificationImpl = new (std::nothrow) _NotificationInfoImpl;
617 SysTryReturn(NID_APP, pNotificationImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
622 pEnum->GetStringAt(1, name);
623 pEnum->GetStringAt(2, value);
625 pNotificationImpl->SetName(name);
626 pNotificationImpl->SetValue(value);
628 pList->Add(*pNotificationImpl);
639 _PackageAppInfoImpl::GetNotificationList(void) const
641 return __pNotificationImplList;
645 _PackageAppInfoImpl::AddNotification(const _NotificationInfoImpl& notificationImpl)
647 result r = E_SUCCESS;
648 r = __pNotificationImplList->Add(notificationImpl);
649 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pNotificationImplList->Add() is failed.");
655 _PackageAppInfoImpl::GetAppFeatureListN(void) const
657 result r = E_SUCCESS;
659 DbStatement* pStmt = null;
660 DbEnumerator* pEnum = null;
663 ArrayList* pList = null;
665 query.Format(1024, L"SELECT * FROM AppFeature WHERE ID = %d", GetUniqueId());
667 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
668 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
670 pStmt = db.CreateStatementN(query);
671 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
672 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
674 pEnum = db.ExecuteStatementN(*pStmt);
677 pList = new (std::nothrow) ArrayList;
678 SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
681 while (pEnum->MoveNext() == E_SUCCESS)
683 _AppFeatureInfoImpl* pAppFeatureImpl = new (std::nothrow) _AppFeatureInfoImpl;
684 SysTryReturn(NID_APP, pAppFeatureImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
689 pEnum->GetStringAt(1, name);
690 pEnum->GetStringAt(2, value);
692 pAppFeatureImpl->SetName(name);
693 pAppFeatureImpl->SetValue(value);
695 pList->Add(*pAppFeatureImpl);
706 _PackageAppInfoImpl::GetAppFeatureList(void) const
708 return __pAppFeatureImplList;
711 HashMapT<String, _AppFeatureInfoImpl*>*
712 _PackageAppInfoImpl::GetAppFeatureMapN(void) const
714 result r = E_SUCCESS;
716 DbEnumerator* pEnum = null;
719 HashMapT<String, _AppFeatureInfoImpl*>* pMap = null;
721 query.Format(1024, L"SELECT * FROM AppFeature WHERE ID = %d", GetUniqueId());
723 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
724 SysTryReturn(NID_APP, r == E_SUCCESS, null, r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
726 const DbStatement* pStmt = db.CreateStatementN(query);
727 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
728 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
730 pEnum = db.ExecuteStatementN(*pStmt);
733 pMap = new (std::nothrow) HashMapT<String, _AppFeatureInfoImpl*>;
734 SysTryReturn(NID_APP, pMap != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
740 while (pEnum->MoveNext() == E_SUCCESS)
742 _AppFeatureInfoImpl* pAppFeatureImpl = new (std::nothrow) _AppFeatureInfoImpl;
743 SysTryReturn(NID_APP, pAppFeatureImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
745 pEnum->GetStringAt(1, name);
746 pEnum->GetStringAt(2, value);
748 pAppFeatureImpl->SetName(name);
749 pAppFeatureImpl->SetValue(value);
751 pMap->Add(name, pAppFeatureImpl);
762 _PackageAppInfoImpl::AddAppFeature(const _AppFeatureInfoImpl& appFeatureImpl)
764 result r = E_SUCCESS;
765 r = __pAppFeatureImplList->Add(appFeatureImpl);
766 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pAppFeatureImplList->Add() is failed.");
772 _PackageAppInfoImpl::GetDataControlListN(void) const
778 _PackageAppInfoImpl::GetDataControlList(void) const
780 return __pDataControlImplList;
784 _PackageAppInfoImpl::AddDataControl(_DataControlInfoImpl* pDataControl)
786 result r = E_SUCCESS;
787 r = __pDataControlImplList->Add(*pDataControl);
788 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pDataControlImplList->Add() is failed.");
794 _PackageAppInfoImpl::GetAppControlListN(void) const
800 _PackageAppInfoImpl::GetAppControlList(void) const
802 return __pAppControlImplList;
806 _PackageAppInfoImpl::AddAppControl(_AppControlInfoImpl* pAppControl)
808 result r = E_SUCCESS;
809 r = __pAppControlImplList->Add(*pAppControl);
810 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pAppControlImplList->Add() is failed.");
816 _PackageAppInfoImpl::GetPackageName(void) const
818 return __packageName;
822 _PackageAppInfoImpl::SetPackageName(const String& packageName)
824 __packageName = packageName;
829 _PackageAppInfoImpl::GetMainmenuIcon(void) const
831 return __mainmenuIcon;
835 _PackageAppInfoImpl::SetMainmenuIcon(const String& mainmenuIcon)
837 __mainmenuIcon = mainmenuIcon;
842 _PackageAppInfoImpl::GetSettingIcon(void) const
844 return __settingIcon;
848 _PackageAppInfoImpl::SetSettingIcon(const String& setting)
850 __settingIcon = setting;
855 _PackageAppInfoImpl::GetQuickpanelIcon(void) const
857 return __quickpanelIcon;
861 _PackageAppInfoImpl::SetQuickpanelIcon(const String& quickpanelIcon)
863 __quickpanelIcon = quickpanelIcon;
868 _PackageAppInfoImpl::IsMainmenuVisible(void) const
870 return __launchingIconVisible;
874 _PackageAppInfoImpl::SetMainmenuVisible(bool visible)
876 __launchingIconVisible = visible;
881 _PackageAppInfoImpl::AddName(const String& language, const String& name)
883 result r = E_SUCCESS;
884 r = __pNameList->Add(language, name);
890 _PackageAppInfoImpl::GetNameList(void) const
896 _PackageAppInfoImpl::GetUniqueId(void) const
898 result r = E_SUCCESS;
900 DbStatement* pStmt = null;
901 DbEnumerator* pEnum = null;
905 query.Format(1024, L"SELECT UNIQUE_ID FROM AppInfo WHERE APP_NAME = '%ls' and ID = %d", __name.GetPointer(), __pkgId);
907 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
908 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
910 pStmt = db.CreateStatementN(query);
911 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
912 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
914 pEnum = db.ExecuteStatementN(*pStmt);
917 if (pEnum->MoveNext() == E_SUCCESS)
919 pEnum->GetIntAt(0, uniqueId);
935 _PackageAppInfoImpl::GetPkgId(void) const
941 _PackageAppInfoImpl::SetUniqueId(int id)
948 _PackageAppInfoImpl::SetPkgId(int id)
955 _PackageAppInfoImpl::GetAppFeature(void) const
961 _PackageAppInfoImpl::SetAppFeature(int feature)
963 __appFeature = feature;
967 _LaunchConditionInfoImpl::_LaunchConditionInfoImpl(void)
972 _LaunchConditionInfoImpl::~_LaunchConditionInfoImpl(void)
978 _LaunchConditionInfoImpl::GetName(void) const
984 _LaunchConditionInfoImpl::SetName(const String& name)
991 _LaunchConditionInfoImpl::GetValue(void) const
997 _LaunchConditionInfoImpl::SetValue(const String& value)
1003 _NotificationInfoImpl::_NotificationInfoImpl(void)
1008 _NotificationInfoImpl::~_NotificationInfoImpl(void)
1014 _NotificationInfoImpl::GetName(void) const
1020 _NotificationInfoImpl::SetName(const String& name)
1027 _NotificationInfoImpl::GetValue(void) const
1033 _NotificationInfoImpl::SetValue(const String& value)
1039 _AppFeatureInfoImpl::_AppFeatureInfoImpl(void)
1044 _AppFeatureInfoImpl::~_AppFeatureInfoImpl(void)
1050 _AppFeatureInfoImpl::GetName(void) const
1056 _AppFeatureInfoImpl::SetName(const String& name)
1063 _AppFeatureInfoImpl::GetValue(void) const
1069 _AppFeatureInfoImpl::SetValue(const String& value)
1075 _DataControlTypeImpl::_DataControlTypeImpl(void)
1080 _DataControlTypeImpl::~_DataControlTypeImpl(void)
1086 _DataControlTypeImpl::GetType(void) const
1092 _DataControlTypeImpl::SetType(const String& type)
1099 _DataControlTypeImpl::GetAccess(void) const
1105 _DataControlTypeImpl::SetAccess(const String& access)
1111 _DataControlInfoImpl::_DataControlInfoImpl(void)
1112 : __pControlTypeList(null)
1114 __pControlTypeList = new (std::nothrow) ArrayList;
1115 SysTryReturnVoidResult(NID_APP, __pControlTypeList != null, E_OUT_OF_MEMORY, "__pControlTypeList instance must not be null.");
1116 __pControlTypeList->Construct();
1119 _DataControlInfoImpl::~_DataControlInfoImpl(void)
1121 __pControlTypeList->RemoveAll(true);
1122 delete __pControlTypeList;
1126 _DataControlInfoImpl::GetProviderId(void) const
1128 return __providerId;
1132 _DataControlInfoImpl::SetProviderId(const String& providerId)
1134 __providerId = providerId;
1139 _DataControlInfoImpl::GetControlTypeList(void) const
1141 return __pControlTypeList;
1145 _DataControlInfoImpl::AddControlType(_DataControlTypeImpl* pControlType)
1147 __pControlTypeList->Add(*pControlType);
1151 _AppControlResolutionInfoImpl::_AppControlResolutionInfoImpl(void)
1152 : __pUriScheme(null)
1158 _AppControlResolutionInfoImpl::~_AppControlResolutionInfoImpl(void)
1160 delete __pUriScheme;
1165 _AppControlResolutionInfoImpl::GetUriScheme(void) const
1167 return __pUriScheme;
1171 _AppControlResolutionInfoImpl::SetUriScheme(String* pUriScheme)
1173 __pUriScheme = pUriScheme;
1178 _AppControlResolutionInfoImpl::GetMimeType(void) const
1184 _AppControlResolutionInfoImpl::SetMimeType(String* pMimeType)
1186 __pMimeType = pMimeType;
1190 _AppControlCapabilityInfoImpl::_AppControlCapabilityInfoImpl(void)
1193 ,__pResolutionList(null)
1195 __pResolutionList = new (std::nothrow) ArrayList;
1196 SysTryReturnVoidResult(NID_APP, __pResolutionList != null, E_OUT_OF_MEMORY, "__pResolutionList instance must not be null.");
1197 __pResolutionList->Construct();
1200 _AppControlCapabilityInfoImpl::~_AppControlCapabilityInfoImpl(void)
1202 __pResolutionList->RemoveAll(true);
1203 delete __pResolutionList;
1207 _AppControlCapabilityInfoImpl::GetUniqueId(void) const
1213 _AppControlCapabilityInfoImpl::SetUniqueId(int uniqueId)
1215 __uniqueId = uniqueId;
1220 _AppControlCapabilityInfoImpl::GetAppControlId(void) const
1222 return __appControlId;
1226 _AppControlCapabilityInfoImpl::SetAppControlId(int appControlId)
1228 __appControlId = appControlId;
1233 _AppControlCapabilityInfoImpl::GetOperationId(void) const
1235 return __operationId;
1239 _AppControlCapabilityInfoImpl::SetOperationId(const String& operationId)
1241 __operationId = operationId;
1246 _AppControlCapabilityInfoImpl::GetResolutionList(void) const
1248 return __pResolutionList;
1252 _AppControlCapabilityInfoImpl::AddResolution(_AppControlResolutionInfoImpl* pResolutionImpl)
1254 result r = E_SUCCESS;
1255 r = __pResolutionList->Add(*pResolutionImpl);
1256 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pResolutionList->Add() is failed.");
1261 _AppControlInfoImpl::_AppControlInfoImpl(void)
1263 ,__pCapabilityList(null)
1265 __pCapabilityList = new (std::nothrow) ArrayList;
1266 SysTryReturnVoidResult(NID_APP, __pCapabilityList != null, E_OUT_OF_MEMORY, "__pCapabilityList instance must not be null.");
1267 __pCapabilityList->Construct();
1270 _AppControlInfoImpl::~_AppControlInfoImpl(void)
1272 __pCapabilityList->RemoveAll(true);
1273 delete __pCapabilityList;
1277 _AppControlInfoImpl::GetUniqueId(void) const
1283 _AppControlInfoImpl::SetUniqueId(int uniqueId)
1285 __uniqueId = uniqueId;
1290 _AppControlInfoImpl::GetProviderId(void) const
1292 return __providerId;
1296 _AppControlInfoImpl::SetProviderId(const String& providerId)
1298 __providerId = providerId;
1303 _AppControlInfoImpl::GetCategory(void) const
1309 _AppControlInfoImpl::SetCategory(const String& category)
1311 __category = category;
1316 _AppControlInfoImpl::GetCapabilityList(void) const
1318 return __pCapabilityList;
1322 _AppControlInfoImpl::AddCapability(_AppControlCapabilityInfoImpl* pCapability)
1324 result r = E_SUCCESS;
1325 r = __pCapabilityList->Add(*pCapability);
1326 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pCapabilityList->Add() is failed.");
1331 } } } // Tizen::App::Package