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>
36 #include <FBase_StringConverter.h>
38 #include "FAppPkg_PackageManagerImpl.h"
39 #include "FApp_AppResourceImpl.h"
40 #include "FApp_TemplateUtil.h"
42 using namespace Tizen::Base;
43 using namespace Tizen::Base::Collection;
44 using namespace Tizen::Graphics;
45 using namespace Tizen::Io;
47 namespace Tizen { namespace App { namespace Package
51 _PackageAppInfoImpl::GetAppId(void) const
57 _PackageAppInfoImpl::SetAppId(const AppId& appId)
64 _PackageAppInfoImpl::GetAppName(void) const
70 _PackageAppInfoImpl::SetAppName(const String& appName)
77 _PackageAppInfoImpl::GetAppDisplayName(void) const
79 return __appDiplayName;
83 _PackageAppInfoImpl::SetAppDisplayName(const String& appDiplayName)
85 __appDiplayName = appDiplayName;
90 _PackageAppInfoImpl::GetAppMenuIconPath(void) const
96 _PackageAppInfoImpl::SetAppMenuIconPath(const String& iconPath)
98 __appIconPath = iconPath;
103 _PackageAppInfoImpl::GetAppSettingIconPath(void) const
105 return __appSettingIconPath;
109 _PackageAppInfoImpl::SetAppSettingIconPath(const Tizen::Base::String& appSettingIcon)
111 __appSettingIconPath = appSettingIcon;
116 _PackageAppInfoImpl::GetAppNotificationIconPath(void) const
118 return __appNotificationIconPath;
122 _PackageAppInfoImpl::SetAppNotificationIconPath(const String& notificationIconPath)
124 __appNotificationIconPath = notificationIconPath;
129 _PackageAppInfoImpl::GetAppTempIconPath(void) const
131 return __appTempIconPath;
135 _PackageAppInfoImpl::SetAppTempIconPath(const String& tempIconPath)
137 __appTempIconPath = tempIconPath;
142 _PackageAppInfoImpl::GetAppMenuIconN(void) const
144 Bitmap* pBitmap = null;
149 SysTryReturn(NID_APP, __appIconPath.IsEmpty() == false, null, E_FILE_NOT_FOUND, "appIconPath() is empty.");
151 iconPath = __appIconPath;
155 SysTryReturn(NID_APP, __appTempIconPath.IsEmpty() == false, null, E_FILE_NOT_FOUND, "__appTempIconPath() is empty.");
157 iconPath = __appTempIconPath;
160 SysLog(NID_APP, "iconPath = [%ls]", iconPath.GetPointer());
162 pBitmap = _AppResourceImpl::GetNonScalingBitmapN(iconPath);
168 _PackageAppInfoImpl::GetAppMetadataListN(void) const
170 HashMap* pMap = null;
174 SysTryReturn(NID_APP, __pAppInfoHandle, null, E_SYSTEM, "__pAppInfoHandle is null.");
176 result r = E_SUCCESS;
177 int res = PMINFO_R_OK;
179 pMap = new (std::nothrow) HashMap();
180 SysTryReturn(NID_APP, pMap, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
183 res = pkgmgrinfo_appinfo_foreach_metadata(__pAppInfoHandle, MetadataHandler, pMap);
184 if (res != PMINFO_R_OK)
186 SysLog(NID_APP, "pkgmgrinfo_appinfo_foreach_metadata() is failed. result = [%d]", res);
189 pMap->RemoveAll(true);
197 SysLog(NID_APP, "GetAppMetadataListN() is not available.");
204 _PackageAppInfoImpl::GetAppCategoryListN(void) const
206 ArrayList* pList = null;
210 SysTryReturn(NID_APP, __pAppInfoHandle, null, E_SYSTEM, "[E_SYSTEM] __pAppInfoHandle is null.");
212 result r = E_SUCCESS;
213 int res = PMINFO_R_OK;
215 pList = new (std::nothrow) ArrayList();
216 SysTryReturn(NID_APP, pList, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
219 res = pkgmgrinfo_appinfo_foreach_category(__pAppInfoHandle, CategoryHandler, pList);
220 if (res != PMINFO_R_OK)
222 SysLog(NID_APP, "pkgmgrinfo_appinfo_foreach_category() is failed. result = [%d]", res);
225 pList->RemoveAll(true);
234 SysLog(NID_APP, "GetAppCategoryListN() is not available.");
241 _PackageAppInfoImpl::IsMenuIconVisible(void) const
243 return __launchingIconVisible;
247 _PackageAppInfoImpl::SetMenuIconVisible(bool visible)
249 __launchingIconVisible = visible;
254 _PackageAppInfoImpl::IsMainApp(void) const
260 _PackageAppInfoImpl::SetMainApp(bool mainApp)
267 _PackageAppInfoImpl::AddCategory(String* pCategory)
269 result r = E_SUCCESS;
270 r = __pAppCategoryList->Add(*pCategory);
271 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pAppCategoryList->Add() is failed.");
277 _PackageAppInfoImpl::GetAppFeature(const String& key) const
279 SysTryReturn(NID_APP, __appId.IsEmpty() == false, L"", E_SYSTEM, "__appId is empty.");
285 query.Format(1024, L"SELECT AppFeature.VALUE FROM AppInfo, AppFeature WHERE AppFeature.ID = AppInfo.UNIQUE_ID and AppFeature.NAME = '%ls' and AppInfo.PACKAGE_NAME = '%ls'",
286 key.GetPointer(), __appId.GetPointer());
288 SysLog(NID_APP, "query = [%ls]", query.GetPointer());
290 result r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
291 SysTryReturn(NID_APP, r == E_SUCCESS, L"", E_SYSTEM, "db.Construct() failed. [%s]", GetErrorMessage(r));
293 std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
294 SysTryReturn(NID_APP, pStmt, L"", E_SYSTEM, "CreateStatementN(%ls) failed. [%s]", query.GetPointer(), GetErrorMessage(GetLastResult()));
296 std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
297 SysTryReturn(NID_APP, pEnum, L"", E_SYSTEM, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
299 while (pEnum->MoveNext() == E_SUCCESS)
301 pEnum->GetStringAt(0, value);
304 SysLog(NID_APP, "value = [%ls]", value.GetPointer());
310 _PackageAppInfoImpl::GetInstance(PackageAppInfo* pPackageAppInfo)
314 return pPackageAppInfo->__pPackageAppInfoImpl;
321 _PackageAppInfoImpl::Construct(const AppId& appId)
323 int res = PMINFO_R_OK;
324 char* pExePath = null;
325 char* pDisplayName = null;
326 char* pMenuIcon = null;
327 char* pSettingIcon = null;
328 char* pNotificationIcon = null;
329 bool mainApp = false;
330 bool menuIconVisible = false;
332 std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
333 SysTryReturnResult(NID_APP, pAppId, E_OUT_OF_MEMORY, "pAppId is null");
335 res = pkgmgrinfo_appinfo_get_appinfo(pAppId.get(), &__pAppInfoHandle);
336 SysTryReturnResult(NID_APP, res == 0, E_SYSTEM, "pkgmgrinfo_appinfo_get_appinfo failed, res = [%d]", res);
338 __fromDatabase = true;
342 res = pkgmgrinfo_appinfo_get_exec(__pAppInfoHandle, &pExePath);
343 if (res == PMINFO_R_OK)
345 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_exec(): exe = [%s]", pExePath);
347 String exePath(pExePath);
348 int startIndex = exePath.GetLength() - 1;
350 result r = exePath.LastIndexOf(L'/', startIndex, indexOf);
354 exePath.SubString(indexOf + 1, appName);
356 SysLog(NID_APP, "appName = [%ls]", appName.GetPointer());
360 SysLog(NID_APP, "LastIndexOf is failed.");
365 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_exec() is failed. result = [%d]", res);
368 res = pkgmgrinfo_appinfo_get_label(__pAppInfoHandle, &pDisplayName);
369 if (res == PMINFO_R_OK)
371 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_label(): displayName = [%s]", pDisplayName);
372 String displayName(pDisplayName);
373 SetAppDisplayName(displayName);
377 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_label() is failed. result = [%d]", res);
380 res = pkgmgrinfo_appinfo_get_icon(__pAppInfoHandle, &pMenuIcon);
381 if (res == PMINFO_R_OK)
383 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_icon(): MenuIcon = [%s]", pMenuIcon);
384 String menuIcon(pMenuIcon);
385 SetAppMenuIconPath(menuIcon);
389 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_icon() is failed. result = [%d]", res);
392 res = pkgmgrinfo_appinfo_get_setting_icon(__pAppInfoHandle, &pSettingIcon);
393 if (res == PMINFO_R_OK)
395 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_setting_icon(): SettingIcon = [%s]", pSettingIcon);
396 String settingIcon(pSettingIcon);
397 SetAppSettingIconPath(settingIcon);
401 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_setting_icon() is failed. result = [%d]", res);
404 res = pkgmgrinfo_appinfo_get_notification_icon(__pAppInfoHandle, &pNotificationIcon);
405 if (res == PMINFO_R_OK)
407 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_notification_icon(): NotificationIcon = [%s]", pNotificationIcon);
408 String notificationIcon(pNotificationIcon);
409 SetAppNotificationIconPath(notificationIcon);
413 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_notification_icon() is failed. result = [%d]", res);
416 res = pkgmgrinfo_appinfo_is_mainapp(__pAppInfoHandle, &mainApp);
417 if (res == PMINFO_R_OK)
419 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_mainapp(): mainApp = [%d]", mainApp);
424 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_mainapp() is failed. result = [%d]", res);
427 res = pkgmgrinfo_appinfo_is_nodisplay(__pAppInfoHandle, &menuIconVisible);
428 if (res == PMINFO_R_OK)
430 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_nodisplay(): menuIconVisible = [%d]", menuIconVisible);
431 SetMenuIconVisible(!menuIconVisible);
435 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_nodisplay() is failed. result = [%d]", res);
442 _PackageAppInfoImpl::CategoryHandler(const char* pCategoryName, void* pUserData)
444 SysTryReturn(NID_APP, pCategoryName != null, 0, E_SYSTEM, "[E_SYSTEM] pCategoryName must not be null.");
446 SysLog(NID_APP, "Category = [%s]", pCategoryName);
447 ArrayList* pList = (ArrayList*) pUserData;
449 String* pCategory = new (std::nothrow) String (pCategoryName);
450 SysTryReturn(NID_APP, pCategory != null, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] pCategory instance must not be null.");
452 pList->Add(*pCategory);
458 _PackageAppInfoImpl::MetadataHandler(const char* pKey, const char* pValue, void* pUserData)
460 SysTryReturn(NID_APP, pKey, 0, E_SYSTEM, "pKey must not be null.");
461 SysTryReturn(NID_APP, pValue, 0, E_SYSTEM, "pValue must not be null.");
462 SysTryReturn(NID_APP, pUserData, 0, E_SYSTEM, "pUserData must not be null.");
464 SysLog(NID_APP, "Key = [%s], Value = [%s]", pKey, pValue);
466 MultiHashMap* pMultiMap = (MultiHashMap*) pUserData;
467 pMultiMap->Add(*(new (std::nothrow) String(pKey)), *(new (std::nothrow) String(pValue)));
473 _PackageAppInfoImpl::_PackageAppInfoImpl(void)
474 : __launchingIconVisible(true)
476 , __fromDatabase(false)
477 , __pLaunchConditionImplList(null)
478 , __pNotificationImplList(null)
479 , __pAppFeatureImplList(null)
480 , __pDataControlImplList(null)
481 , __pAppControlImplList(null)
482 , __pAppCategoryList(null)
486 ,__pAppInfoHandle(null)
488 __pLaunchConditionImplList = new (std::nothrow) ArrayList;
489 SysTryReturnVoidResult(NID_APP, __pLaunchConditionImplList != null, E_OUT_OF_MEMORY, "__pLaunchConditionImplList instance must not be null.");
490 __pLaunchConditionImplList->Construct();
492 __pNotificationImplList = new (std::nothrow) ArrayList;
493 SysTryReturnVoidResult(NID_APP, __pNotificationImplList != null, E_OUT_OF_MEMORY, "__pNotificationImplList instance must not be null.");
494 __pNotificationImplList->Construct();
496 __pAppFeatureImplList = new (std::nothrow) ArrayList;
497 SysTryReturnVoidResult(NID_APP, __pAppFeatureImplList != null, E_OUT_OF_MEMORY, "__pAppFeatureImplList instance must not be null.");
498 __pAppFeatureImplList->Construct();
500 __pDataControlImplList = new (std::nothrow) ArrayList;
501 SysTryReturnVoidResult(NID_APP, __pDataControlImplList != null, E_OUT_OF_MEMORY, "__pDataControlImplList instance must not be null.");
502 __pDataControlImplList->Construct();
504 __pAppControlImplList = new (std::nothrow) ArrayList;
505 SysTryReturnVoidResult(NID_APP, __pAppControlImplList != null, E_OUT_OF_MEMORY, "__pAppControlImplList instance must not be null.");
506 __pAppControlImplList->Construct();
508 __pAppCategoryList = new (std::nothrow) ArrayList;
509 SysTryReturnVoidResult(NID_APP, __pAppCategoryList != null, E_OUT_OF_MEMORY, "__pAppCategoryList instance must not be null.");
510 __pAppCategoryList->Construct();
512 __pNameList = new (std::nothrow) HashMap;
513 SysTryReturnVoidResult(NID_APP, __pNameList != null, E_OUT_OF_MEMORY, "__pNameList instance must not be null.");
514 __pNameList->Construct();
518 _PackageAppInfoImpl::~_PackageAppInfoImpl(void)
520 __pLaunchConditionImplList->RemoveAll(true);
521 delete __pLaunchConditionImplList;
523 __pNotificationImplList->RemoveAll(true);
524 delete __pNotificationImplList;
526 __pAppFeatureImplList->RemoveAll(true);
527 delete __pAppFeatureImplList;
529 __pDataControlImplList->RemoveAll(true);
530 delete __pDataControlImplList;
532 __pAppControlImplList->RemoveAll(true);
533 delete __pAppControlImplList;
535 __pAppCategoryList->RemoveAll(true);
536 delete __pAppCategoryList;
538 __pNameList->RemoveAll(true);
541 if (__pAppInfoHandle)
543 pkgmgrinfo_appinfo_destroy_appinfo(__pAppInfoHandle);
546 if (File::IsFileExist(__appTempIconPath) == true)
548 File::Remove(__appTempIconPath);
553 _PackageAppInfoImpl::GetName(void) const
559 _PackageAppInfoImpl::SetName(const String& name)
566 _PackageAppInfoImpl::GetType(void) const
572 _PackageAppInfoImpl::SetType(const String& type)
579 _PackageAppInfoImpl::GetDefault(void) const
585 _PackageAppInfoImpl::SetDefault(const String& defaultApp)
587 __default = defaultApp;
592 _PackageAppInfoImpl::GetLaunchConditionListN(void) const
594 result r = E_SUCCESS;
596 DbStatement* pStmt = null;
597 DbEnumerator* pEnum = null;
600 ArrayList* pList = null;
602 query.Format(1024, L"SELECT * FROM LaunchCondition WHERE ID = %d", GetUniqueId());
604 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
605 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
607 pStmt = db.CreateStatementN(query);
608 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
609 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
611 pEnum = db.ExecuteStatementN(*pStmt);
614 pList = new (std::nothrow) ArrayList;
615 SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
618 while (pEnum->MoveNext() == E_SUCCESS)
620 _LaunchConditionInfoImpl* pLaunchConditionImpl = new (std::nothrow) _LaunchConditionInfoImpl;
621 SysTryReturn(NID_APP, pLaunchConditionImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
626 pEnum->GetStringAt(1, name);
627 pEnum->GetStringAt(2, value);
629 pLaunchConditionImpl->SetName(name);
630 pLaunchConditionImpl->SetValue(value);
632 pList->Add(*pLaunchConditionImpl);
643 _PackageAppInfoImpl::GetLaunchConditionList(void) const
645 return __pLaunchConditionImplList;
649 _PackageAppInfoImpl::AddLaunchCondition(const _LaunchConditionInfoImpl& launchConditionImpl)
651 result r = E_SUCCESS;
652 r = __pLaunchConditionImplList->Add(launchConditionImpl);
653 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pLaunchConditionImplList->Add() is failed.");
659 _PackageAppInfoImpl::GetNotificationListN(void) const
661 result r = E_SUCCESS;
663 DbStatement* pStmt = null;
664 DbEnumerator* pEnum = null;
667 ArrayList* pList = null;
669 query.Format(1024, L"SELECT * FROM Notification WHERE ID = %d", GetUniqueId());
671 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
672 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
674 pStmt = db.CreateStatementN(query);
675 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
676 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
678 pEnum = db.ExecuteStatementN(*pStmt);
681 pList = new (std::nothrow) ArrayList;
682 SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
685 while (pEnum->MoveNext() == E_SUCCESS)
687 _NotificationInfoImpl* pNotificationImpl = new (std::nothrow) _NotificationInfoImpl;
688 SysTryReturn(NID_APP, pNotificationImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
693 pEnum->GetStringAt(1, name);
694 pEnum->GetStringAt(2, value);
696 pNotificationImpl->SetName(name);
697 pNotificationImpl->SetValue(value);
699 pList->Add(*pNotificationImpl);
710 _PackageAppInfoImpl::GetNotificationList(void) const
712 return __pNotificationImplList;
716 _PackageAppInfoImpl::AddNotification(const _NotificationInfoImpl& notificationImpl)
718 result r = E_SUCCESS;
719 r = __pNotificationImplList->Add(notificationImpl);
720 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pNotificationImplList->Add() is failed.");
726 _PackageAppInfoImpl::GetAppFeatureListN(void) const
728 result r = E_SUCCESS;
730 DbStatement* pStmt = null;
731 DbEnumerator* pEnum = null;
734 ArrayList* pList = null;
736 query.Format(1024, L"SELECT * FROM AppFeature WHERE ID = %d", GetUniqueId());
738 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
739 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
741 pStmt = db.CreateStatementN(query);
742 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
743 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
745 pEnum = db.ExecuteStatementN(*pStmt);
748 pList = new (std::nothrow) ArrayList;
749 SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
752 while (pEnum->MoveNext() == E_SUCCESS)
754 _AppFeatureInfoImpl* pAppFeatureImpl = new (std::nothrow) _AppFeatureInfoImpl;
755 SysTryReturn(NID_APP, pAppFeatureImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
760 pEnum->GetStringAt(1, name);
761 pEnum->GetStringAt(2, value);
763 pAppFeatureImpl->SetName(name);
764 pAppFeatureImpl->SetValue(value);
766 pList->Add(*pAppFeatureImpl);
777 _PackageAppInfoImpl::GetAppFeatureList(void) const
779 return __pAppFeatureImplList;
782 HashMapT<String, _AppFeatureInfoImpl*>*
783 _PackageAppInfoImpl::GetAppFeatureMapN(void) const
785 result r = E_SUCCESS;
787 DbEnumerator* pEnum = null;
790 HashMapT<String, _AppFeatureInfoImpl*>* pMap = null;
792 query.Format(1024, L"SELECT * FROM AppFeature WHERE ID = %d", GetUniqueId());
794 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
795 SysTryReturn(NID_APP, r == E_SUCCESS, null, r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
797 const DbStatement* pStmt = db.CreateStatementN(query);
798 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
799 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
801 pEnum = db.ExecuteStatementN(*pStmt);
804 pMap = new (std::nothrow) HashMapT<String, _AppFeatureInfoImpl*>;
805 SysTryReturn(NID_APP, pMap != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
811 while (pEnum->MoveNext() == E_SUCCESS)
813 _AppFeatureInfoImpl* pAppFeatureImpl = new (std::nothrow) _AppFeatureInfoImpl;
814 SysTryReturn(NID_APP, pAppFeatureImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
816 pEnum->GetStringAt(1, name);
817 pEnum->GetStringAt(2, value);
819 pAppFeatureImpl->SetName(name);
820 pAppFeatureImpl->SetValue(value);
822 pMap->Add(name, pAppFeatureImpl);
833 _PackageAppInfoImpl::AddAppFeature(const _AppFeatureInfoImpl& appFeatureImpl)
835 result r = E_SUCCESS;
836 r = __pAppFeatureImplList->Add(appFeatureImpl);
837 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pAppFeatureImplList->Add() is failed.");
843 _PackageAppInfoImpl::GetDataControlListN(void) const
849 _PackageAppInfoImpl::GetDataControlList(void) const
851 return __pDataControlImplList;
855 _PackageAppInfoImpl::AddDataControl(_DataControlInfoImpl* pDataControl)
857 result r = E_SUCCESS;
858 r = __pDataControlImplList->Add(*pDataControl);
859 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pDataControlImplList->Add() is failed.");
865 _PackageAppInfoImpl::GetAppControlListN(void) const
871 _PackageAppInfoImpl::GetAppControlList(void) const
873 return __pAppControlImplList;
877 _PackageAppInfoImpl::AddAppControl(_AppControlInfoImpl* pAppControl)
879 result r = E_SUCCESS;
880 r = __pAppControlImplList->Add(*pAppControl);
881 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pAppControlImplList->Add() is failed.");
887 _PackageAppInfoImpl::GetPackageName(void) const
889 return __packageName;
893 _PackageAppInfoImpl::SetPackageName(const String& packageName)
895 __packageName = packageName;
900 _PackageAppInfoImpl::GetMainmenuIcon(void) const
902 return __mainmenuIcon;
906 _PackageAppInfoImpl::SetMainmenuIcon(const String& mainmenuIcon)
908 __mainmenuIcon = mainmenuIcon;
913 _PackageAppInfoImpl::GetSettingIcon(void) const
915 return __settingIcon;
919 _PackageAppInfoImpl::SetSettingIcon(const String& setting)
921 __settingIcon = setting;
926 _PackageAppInfoImpl::GetQuickpanelIcon(void) const
928 return __quickpanelIcon;
932 _PackageAppInfoImpl::SetQuickpanelIcon(const String& quickpanelIcon)
934 __quickpanelIcon = quickpanelIcon;
939 _PackageAppInfoImpl::IsMainmenuVisible(void) const
941 return __launchingIconVisible;
945 _PackageAppInfoImpl::SetMainmenuVisible(bool visible)
947 __launchingIconVisible = visible;
952 _PackageAppInfoImpl::AddName(const String& language, const String& name)
954 result r = E_SUCCESS;
955 r = __pNameList->Add(language, name);
961 _PackageAppInfoImpl::GetNameList(void) const
967 _PackageAppInfoImpl::GetUniqueId(void) const
969 result r = E_SUCCESS;
971 DbStatement* pStmt = null;
972 DbEnumerator* pEnum = null;
976 query.Format(1024, L"SELECT UNIQUE_ID FROM AppInfo WHERE APP_NAME = '%ls' and ID = %d", __name.GetPointer(), __pkgId);
978 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
979 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
981 pStmt = db.CreateStatementN(query);
982 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
983 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
985 pEnum = db.ExecuteStatementN(*pStmt);
988 if (pEnum->MoveNext() == E_SUCCESS)
990 pEnum->GetIntAt(0, uniqueId);
1006 _PackageAppInfoImpl::GetPkgId(void) const
1012 _PackageAppInfoImpl::SetUniqueId(int id)
1019 _PackageAppInfoImpl::SetPkgId(int id)
1026 _PackageAppInfoImpl::GetAppFeature(void) const
1028 return __appFeature;
1032 _PackageAppInfoImpl::SetAppFeature(int feature)
1034 __appFeature = feature;
1038 _LaunchConditionInfoImpl::_LaunchConditionInfoImpl(void)
1043 _LaunchConditionInfoImpl::~_LaunchConditionInfoImpl(void)
1049 _LaunchConditionInfoImpl::GetName(void) const
1055 _LaunchConditionInfoImpl::SetName(const String& name)
1062 _LaunchConditionInfoImpl::GetValue(void) const
1068 _LaunchConditionInfoImpl::SetValue(const String& value)
1074 _NotificationInfoImpl::_NotificationInfoImpl(void)
1079 _NotificationInfoImpl::~_NotificationInfoImpl(void)
1085 _NotificationInfoImpl::GetName(void) const
1091 _NotificationInfoImpl::SetName(const String& name)
1098 _NotificationInfoImpl::GetValue(void) const
1104 _NotificationInfoImpl::SetValue(const String& value)
1110 _AppFeatureInfoImpl::_AppFeatureInfoImpl(void)
1115 _AppFeatureInfoImpl::~_AppFeatureInfoImpl(void)
1121 _AppFeatureInfoImpl::GetName(void) const
1127 _AppFeatureInfoImpl::SetName(const String& name)
1134 _AppFeatureInfoImpl::GetValue(void) const
1140 _AppFeatureInfoImpl::SetValue(const String& value)
1146 _DataControlTypeImpl::_DataControlTypeImpl(void)
1151 _DataControlTypeImpl::~_DataControlTypeImpl(void)
1157 _DataControlTypeImpl::GetType(void) const
1163 _DataControlTypeImpl::SetType(const String& type)
1170 _DataControlTypeImpl::GetAccess(void) const
1176 _DataControlTypeImpl::SetAccess(const String& access)
1182 _DataControlInfoImpl::_DataControlInfoImpl(void)
1183 : __pControlTypeList(null)
1185 __pControlTypeList = new (std::nothrow) ArrayList;
1186 SysTryReturnVoidResult(NID_APP, __pControlTypeList != null, E_OUT_OF_MEMORY, "__pControlTypeList instance must not be null.");
1187 __pControlTypeList->Construct();
1190 _DataControlInfoImpl::~_DataControlInfoImpl(void)
1192 __pControlTypeList->RemoveAll(true);
1193 delete __pControlTypeList;
1197 _DataControlInfoImpl::GetProviderId(void) const
1199 return __providerId;
1203 _DataControlInfoImpl::SetProviderId(const String& providerId)
1205 __providerId = providerId;
1210 _DataControlInfoImpl::GetControlTypeList(void) const
1212 return __pControlTypeList;
1216 _DataControlInfoImpl::AddControlType(_DataControlTypeImpl* pControlType)
1218 __pControlTypeList->Add(*pControlType);
1222 _AppControlResolutionInfoImpl::_AppControlResolutionInfoImpl(void)
1223 : __pUriScheme(null)
1229 _AppControlResolutionInfoImpl::~_AppControlResolutionInfoImpl(void)
1231 delete __pUriScheme;
1236 _AppControlResolutionInfoImpl::GetUriScheme(void) const
1238 return __pUriScheme;
1242 _AppControlResolutionInfoImpl::SetUriScheme(String* pUriScheme)
1244 __pUriScheme = pUriScheme;
1249 _AppControlResolutionInfoImpl::GetMimeType(void) const
1255 _AppControlResolutionInfoImpl::SetMimeType(String* pMimeType)
1257 __pMimeType = pMimeType;
1261 _AppControlCapabilityInfoImpl::_AppControlCapabilityInfoImpl(void)
1264 ,__pResolutionList(null)
1266 __pResolutionList = new (std::nothrow) ArrayList;
1267 SysTryReturnVoidResult(NID_APP, __pResolutionList != null, E_OUT_OF_MEMORY, "__pResolutionList instance must not be null.");
1268 __pResolutionList->Construct();
1271 _AppControlCapabilityInfoImpl::~_AppControlCapabilityInfoImpl(void)
1273 __pResolutionList->RemoveAll(true);
1274 delete __pResolutionList;
1278 _AppControlCapabilityInfoImpl::GetUniqueId(void) const
1284 _AppControlCapabilityInfoImpl::SetUniqueId(int uniqueId)
1286 __uniqueId = uniqueId;
1291 _AppControlCapabilityInfoImpl::GetAppControlId(void) const
1293 return __appControlId;
1297 _AppControlCapabilityInfoImpl::SetAppControlId(int appControlId)
1299 __appControlId = appControlId;
1304 _AppControlCapabilityInfoImpl::GetOperationId(void) const
1306 return __operationId;
1310 _AppControlCapabilityInfoImpl::SetOperationId(const String& operationId)
1312 __operationId = operationId;
1317 _AppControlCapabilityInfoImpl::GetResolutionList(void) const
1319 return __pResolutionList;
1323 _AppControlCapabilityInfoImpl::AddResolution(_AppControlResolutionInfoImpl* pResolutionImpl)
1325 result r = E_SUCCESS;
1326 r = __pResolutionList->Add(*pResolutionImpl);
1327 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pResolutionList->Add() is failed.");
1332 _AppControlInfoImpl::_AppControlInfoImpl(void)
1334 ,__pCapabilityList(null)
1336 __pCapabilityList = new (std::nothrow) ArrayList;
1337 SysTryReturnVoidResult(NID_APP, __pCapabilityList != null, E_OUT_OF_MEMORY, "__pCapabilityList instance must not be null.");
1338 __pCapabilityList->Construct();
1341 _AppControlInfoImpl::~_AppControlInfoImpl(void)
1343 __pCapabilityList->RemoveAll(true);
1344 delete __pCapabilityList;
1348 _AppControlInfoImpl::GetUniqueId(void) const
1354 _AppControlInfoImpl::SetUniqueId(int uniqueId)
1356 __uniqueId = uniqueId;
1361 _AppControlInfoImpl::GetProviderId(void) const
1363 return __providerId;
1367 _AppControlInfoImpl::SetProviderId(const String& providerId)
1369 __providerId = providerId;
1374 _AppControlInfoImpl::GetCategory(void) const
1380 _AppControlInfoImpl::SetCategory(const String& category)
1382 __category = category;
1387 _AppControlInfoImpl::GetCapabilityList(void) const
1389 return __pCapabilityList;
1393 _AppControlInfoImpl::AddCapability(_AppControlCapabilityInfoImpl* pCapability)
1395 result r = E_SUCCESS;
1396 r = __pCapabilityList->Add(*pCapability);
1397 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pCapabilityList->Add() is failed.");
1402 } } } // Tizen::App::Package