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::GetAppFeature(const String& key) const
246 SysTryReturn(NID_APP, __appId.IsEmpty() == false, L"", E_SYSTEM, "__appId is empty.");
252 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'",
253 key.GetPointer(), __appId.GetPointer());
255 SysLog(NID_APP, "query = [%ls]", query.GetPointer());
257 result r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
258 SysTryReturn(NID_APP, r == E_SUCCESS, L"", E_SYSTEM, "db.Construct() failed. [%s]", GetErrorMessage(r));
260 std::unique_ptr< DbStatement > pStmt(_PackageManagerImpl::CreateStatementN(db, query));
261 SysTryReturn(NID_APP, pStmt, L"", E_SYSTEM, "CreateStatementN(%ls) failed. [%s]", query.GetPointer(), GetErrorMessage(GetLastResult()));
263 std::unique_ptr< DbEnumerator > pEnum(_PackageManagerImpl::ExecuteStatementN(db, pStmt.get()));
264 SysTryReturn(NID_APP, pEnum, L"", E_SYSTEM, "ExecuteStatementN() failed. [%s]", GetErrorMessage(GetLastResult()));
266 while (pEnum->MoveNext() == E_SUCCESS)
268 pEnum->GetStringAt(0, value);
271 SysLog(NID_APP, "value = [%ls]", value.GetPointer());
277 _PackageAppInfoImpl::GetInstance(PackageAppInfo* pPackageAppInfo)
281 return pPackageAppInfo->__pPackageAppInfoImpl;
288 _PackageAppInfoImpl::Construct(const AppId& appId)
290 int res = PMINFO_R_OK;
291 char* pExePath = null;
292 char* pDisplayName = null;
293 char* pMenuIcon = null;
294 char* pSettingIcon = null;
295 char* pNotificationIcon = null;
296 bool mainApp = false;
297 bool menuIconVisible = false;
299 std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
300 SysTryReturnResult(NID_APP, pAppId, E_OUT_OF_MEMORY, "pAppId is null");
302 res = pkgmgrinfo_appinfo_get_appinfo(pAppId.get(), &__pAppInfoHandle);
303 SysTryReturnResult(NID_APP, res == 0, E_SYSTEM, "pkgmgrinfo_appinfo_get_appinfo failed, res = [%d]", res);
305 __fromDatabase = true;
309 res = pkgmgrinfo_appinfo_get_exec(__pAppInfoHandle, &pExePath);
310 if (res == PMINFO_R_OK)
312 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_exec(): exe = [%s]", pExePath);
314 String exePath(pExePath);
315 int startIndex = exePath.GetLength() - 1;
317 result r = exePath.LastIndexOf(L'/', startIndex, indexOf);
321 exePath.SubString(indexOf + 1, appName);
323 SysLog(NID_APP, "appName = [%ls]", appName.GetPointer());
327 SysLog(NID_APP, "LastIndexOf is failed.");
332 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_exec() is failed. result = [%d]", res);
335 res = pkgmgrinfo_appinfo_get_label(__pAppInfoHandle, &pDisplayName);
336 if (res == PMINFO_R_OK)
338 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_label(): displayName = [%s]", pDisplayName);
339 String displayName(pDisplayName);
340 SetAppDisplayName(displayName);
344 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_label() is failed. result = [%d]", res);
347 res = pkgmgrinfo_appinfo_get_icon(__pAppInfoHandle, &pMenuIcon);
348 if (res == PMINFO_R_OK)
350 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_icon(): MenuIcon = [%s]", pMenuIcon);
351 String menuIcon(pMenuIcon);
352 SetAppMenuIconPath(menuIcon);
356 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_icon() is failed. result = [%d]", res);
359 res = pkgmgrinfo_appinfo_get_setting_icon(__pAppInfoHandle, &pSettingIcon);
360 if (res == PMINFO_R_OK)
362 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_setting_icon(): SettingIcon = [%s]", pSettingIcon);
363 String settingIcon(pSettingIcon);
364 SetAppSettingIconPath(settingIcon);
368 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_setting_icon() is failed. result = [%d]", res);
371 res = pkgmgrinfo_appinfo_get_notification_icon(__pAppInfoHandle, &pNotificationIcon);
372 if (res == PMINFO_R_OK)
374 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_notification_icon(): NotificationIcon = [%s]", pNotificationIcon);
375 String notificationIcon(pNotificationIcon);
376 SetAppNotificationIconPath(notificationIcon);
380 SysLog(NID_APP, "pkgmgrinfo_appinfo_get_notification_icon() is failed. result = [%d]", res);
383 res = pkgmgrinfo_appinfo_is_mainapp(__pAppInfoHandle, &mainApp);
384 if (res == PMINFO_R_OK)
386 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_mainapp(): mainApp = [%d]", mainApp);
391 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_mainapp() is failed. result = [%d]", res);
394 res = pkgmgrinfo_appinfo_is_nodisplay(__pAppInfoHandle, &menuIconVisible);
395 if (res == PMINFO_R_OK)
397 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_nodisplay(): menuIconVisible = [%d]", menuIconVisible);
398 SetMenuIconVisible(!menuIconVisible);
402 SysLog(NID_APP, "pkgmgrinfo_appinfo_is_nodisplay() is failed. result = [%d]", res);
409 _PackageAppInfoImpl::CategoryHandler(const char* pCategoryName, void* pUserData)
411 SysTryReturn(NID_APP, pCategoryName != null, 0, E_SYSTEM, "[E_SYSTEM] pCategoryName must not be null.");
413 SysLog(NID_APP, "Category = [%s]", pCategoryName);
414 ArrayList* pList = (ArrayList*) pUserData;
416 String* pCategory = new (std::nothrow) String (pCategoryName);
417 SysTryReturn(NID_APP, pCategory != null, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] pCategory instance must not be null.");
419 pList->Add(*pCategory);
425 _PackageAppInfoImpl::MetadataHandler(const char* pKey, const char* pValue, void* pUserData)
427 SysTryReturn(NID_APP, pKey, 0, E_SYSTEM, "pKey must not be null.");
428 SysTryReturn(NID_APP, pValue, 0, E_SYSTEM, "pValue must not be null.");
429 SysTryReturn(NID_APP, pUserData, 0, E_SYSTEM, "pUserData must not be null.");
431 SysLog(NID_APP, "Key = [%s], Value = [%s]", pKey, pValue);
433 MultiHashMap* pMultiMap = (MultiHashMap*) pUserData;
434 pMultiMap->Add(*(new (std::nothrow) String(pKey)), *(new (std::nothrow) String(pValue)));
440 _PackageAppInfoImpl::_PackageAppInfoImpl(void)
441 : __launchingIconVisible(true)
443 , __fromDatabase(false)
444 , __pLaunchConditionImplList(null)
445 , __pNotificationImplList(null)
446 , __pAppFeatureImplList(null)
447 , __pDataControlImplList(null)
448 , __pAppControlImplList(null)
449 , __pAppCategoryList(null)
453 ,__pAppInfoHandle(null)
455 __pLaunchConditionImplList = new (std::nothrow) ArrayList;
456 SysTryReturnVoidResult(NID_APP, __pLaunchConditionImplList != null, E_OUT_OF_MEMORY, "__pLaunchConditionImplList instance must not be null.");
457 __pLaunchConditionImplList->Construct();
459 __pNotificationImplList = new (std::nothrow) ArrayList;
460 SysTryReturnVoidResult(NID_APP, __pNotificationImplList != null, E_OUT_OF_MEMORY, "__pNotificationImplList instance must not be null.");
461 __pNotificationImplList->Construct();
463 __pAppFeatureImplList = new (std::nothrow) ArrayList;
464 SysTryReturnVoidResult(NID_APP, __pAppFeatureImplList != null, E_OUT_OF_MEMORY, "__pAppFeatureImplList instance must not be null.");
465 __pAppFeatureImplList->Construct();
467 __pDataControlImplList = new (std::nothrow) ArrayList;
468 SysTryReturnVoidResult(NID_APP, __pDataControlImplList != null, E_OUT_OF_MEMORY, "__pDataControlImplList instance must not be null.");
469 __pDataControlImplList->Construct();
471 __pAppControlImplList = new (std::nothrow) ArrayList;
472 SysTryReturnVoidResult(NID_APP, __pAppControlImplList != null, E_OUT_OF_MEMORY, "__pAppControlImplList instance must not be null.");
473 __pAppControlImplList->Construct();
475 __pAppCategoryList = new (std::nothrow) ArrayList;
476 SysTryReturnVoidResult(NID_APP, __pAppCategoryList != null, E_OUT_OF_MEMORY, "__pAppCategoryList instance must not be null.");
477 __pAppCategoryList->Construct();
479 __pNameList = new (std::nothrow) HashMap;
480 SysTryReturnVoidResult(NID_APP, __pNameList != null, E_OUT_OF_MEMORY, "__pNameList instance must not be null.");
481 __pNameList->Construct();
485 _PackageAppInfoImpl::~_PackageAppInfoImpl(void)
487 __pLaunchConditionImplList->RemoveAll(true);
488 delete __pLaunchConditionImplList;
490 __pNotificationImplList->RemoveAll(true);
491 delete __pNotificationImplList;
493 __pAppFeatureImplList->RemoveAll(true);
494 delete __pAppFeatureImplList;
496 __pDataControlImplList->RemoveAll(true);
497 delete __pDataControlImplList;
499 __pAppControlImplList->RemoveAll(true);
500 delete __pAppControlImplList;
502 __pAppCategoryList->RemoveAll(true);
503 delete __pAppCategoryList;
505 __pNameList->RemoveAll(true);
508 if (__pAppInfoHandle)
510 pkgmgrinfo_appinfo_destroy_appinfo(__pAppInfoHandle);
515 _PackageAppInfoImpl::GetName(void) const
521 _PackageAppInfoImpl::SetName(const String& name)
528 _PackageAppInfoImpl::GetType(void) const
534 _PackageAppInfoImpl::SetType(const String& type)
541 _PackageAppInfoImpl::GetDefault(void) const
547 _PackageAppInfoImpl::SetDefault(const String& defaultApp)
549 __default = defaultApp;
554 _PackageAppInfoImpl::GetLaunchConditionListN(void) const
556 result r = E_SUCCESS;
558 DbStatement* pStmt = null;
559 DbEnumerator* pEnum = null;
562 ArrayList* pList = null;
564 query.Format(1024, L"SELECT * FROM LaunchCondition WHERE ID = %d", GetUniqueId());
566 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
567 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
569 pStmt = db.CreateStatementN(query);
570 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
571 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
573 pEnum = db.ExecuteStatementN(*pStmt);
576 pList = new (std::nothrow) ArrayList;
577 SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
580 while (pEnum->MoveNext() == E_SUCCESS)
582 _LaunchConditionInfoImpl* pLaunchConditionImpl = new (std::nothrow) _LaunchConditionInfoImpl;
583 SysTryReturn(NID_APP, pLaunchConditionImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
588 pEnum->GetStringAt(1, name);
589 pEnum->GetStringAt(2, value);
591 pLaunchConditionImpl->SetName(name);
592 pLaunchConditionImpl->SetValue(value);
594 pList->Add(*pLaunchConditionImpl);
605 _PackageAppInfoImpl::GetLaunchConditionList(void) const
607 return __pLaunchConditionImplList;
611 _PackageAppInfoImpl::AddLaunchCondition(const _LaunchConditionInfoImpl& launchConditionImpl)
613 result r = E_SUCCESS;
614 r = __pLaunchConditionImplList->Add(launchConditionImpl);
615 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pLaunchConditionImplList->Add() is failed.");
621 _PackageAppInfoImpl::GetNotificationListN(void) const
623 result r = E_SUCCESS;
625 DbStatement* pStmt = null;
626 DbEnumerator* pEnum = null;
629 ArrayList* pList = null;
631 query.Format(1024, L"SELECT * FROM Notification WHERE ID = %d", GetUniqueId());
633 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
634 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
636 pStmt = db.CreateStatementN(query);
637 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
638 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
640 pEnum = db.ExecuteStatementN(*pStmt);
643 pList = new (std::nothrow) ArrayList;
644 SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
647 while (pEnum->MoveNext() == E_SUCCESS)
649 _NotificationInfoImpl* pNotificationImpl = new (std::nothrow) _NotificationInfoImpl;
650 SysTryReturn(NID_APP, pNotificationImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
655 pEnum->GetStringAt(1, name);
656 pEnum->GetStringAt(2, value);
658 pNotificationImpl->SetName(name);
659 pNotificationImpl->SetValue(value);
661 pList->Add(*pNotificationImpl);
672 _PackageAppInfoImpl::GetNotificationList(void) const
674 return __pNotificationImplList;
678 _PackageAppInfoImpl::AddNotification(const _NotificationInfoImpl& notificationImpl)
680 result r = E_SUCCESS;
681 r = __pNotificationImplList->Add(notificationImpl);
682 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pNotificationImplList->Add() is failed.");
688 _PackageAppInfoImpl::GetAppFeatureListN(void) const
690 result r = E_SUCCESS;
692 DbStatement* pStmt = null;
693 DbEnumerator* pEnum = null;
696 ArrayList* pList = null;
698 query.Format(1024, L"SELECT * FROM AppFeature WHERE ID = %d", GetUniqueId());
700 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
701 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
703 pStmt = db.CreateStatementN(query);
704 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
705 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
707 pEnum = db.ExecuteStatementN(*pStmt);
710 pList = new (std::nothrow) ArrayList;
711 SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
714 while (pEnum->MoveNext() == E_SUCCESS)
716 _AppFeatureInfoImpl* pAppFeatureImpl = new (std::nothrow) _AppFeatureInfoImpl;
717 SysTryReturn(NID_APP, pAppFeatureImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
722 pEnum->GetStringAt(1, name);
723 pEnum->GetStringAt(2, value);
725 pAppFeatureImpl->SetName(name);
726 pAppFeatureImpl->SetValue(value);
728 pList->Add(*pAppFeatureImpl);
739 _PackageAppInfoImpl::GetAppFeatureList(void) const
741 return __pAppFeatureImplList;
744 HashMapT<String, _AppFeatureInfoImpl*>*
745 _PackageAppInfoImpl::GetAppFeatureMapN(void) const
747 result r = E_SUCCESS;
749 DbEnumerator* pEnum = null;
752 HashMapT<String, _AppFeatureInfoImpl*>* pMap = null;
754 query.Format(1024, L"SELECT * FROM AppFeature WHERE ID = %d", GetUniqueId());
756 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
757 SysTryReturn(NID_APP, r == E_SUCCESS, null, r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
759 const DbStatement* pStmt = db.CreateStatementN(query);
760 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
761 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
763 pEnum = db.ExecuteStatementN(*pStmt);
766 pMap = new (std::nothrow) HashMapT<String, _AppFeatureInfoImpl*>;
767 SysTryReturn(NID_APP, pMap != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
773 while (pEnum->MoveNext() == E_SUCCESS)
775 _AppFeatureInfoImpl* pAppFeatureImpl = new (std::nothrow) _AppFeatureInfoImpl;
776 SysTryReturn(NID_APP, pAppFeatureImpl != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
778 pEnum->GetStringAt(1, name);
779 pEnum->GetStringAt(2, value);
781 pAppFeatureImpl->SetName(name);
782 pAppFeatureImpl->SetValue(value);
784 pMap->Add(name, pAppFeatureImpl);
795 _PackageAppInfoImpl::AddAppFeature(const _AppFeatureInfoImpl& appFeatureImpl)
797 result r = E_SUCCESS;
798 r = __pAppFeatureImplList->Add(appFeatureImpl);
799 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pAppFeatureImplList->Add() is failed.");
805 _PackageAppInfoImpl::GetDataControlListN(void) const
811 _PackageAppInfoImpl::GetDataControlList(void) const
813 return __pDataControlImplList;
817 _PackageAppInfoImpl::AddDataControl(_DataControlInfoImpl* pDataControl)
819 result r = E_SUCCESS;
820 r = __pDataControlImplList->Add(*pDataControl);
821 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pDataControlImplList->Add() is failed.");
827 _PackageAppInfoImpl::GetAppControlListN(void) const
833 _PackageAppInfoImpl::GetAppControlList(void) const
835 return __pAppControlImplList;
839 _PackageAppInfoImpl::AddAppControl(_AppControlInfoImpl* pAppControl)
841 result r = E_SUCCESS;
842 r = __pAppControlImplList->Add(*pAppControl);
843 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pAppControlImplList->Add() is failed.");
849 _PackageAppInfoImpl::GetPackageName(void) const
851 return __packageName;
855 _PackageAppInfoImpl::SetPackageName(const String& packageName)
857 __packageName = packageName;
862 _PackageAppInfoImpl::GetMainmenuIcon(void) const
864 return __mainmenuIcon;
868 _PackageAppInfoImpl::SetMainmenuIcon(const String& mainmenuIcon)
870 __mainmenuIcon = mainmenuIcon;
875 _PackageAppInfoImpl::GetSettingIcon(void) const
877 return __settingIcon;
881 _PackageAppInfoImpl::SetSettingIcon(const String& setting)
883 __settingIcon = setting;
888 _PackageAppInfoImpl::GetQuickpanelIcon(void) const
890 return __quickpanelIcon;
894 _PackageAppInfoImpl::SetQuickpanelIcon(const String& quickpanelIcon)
896 __quickpanelIcon = quickpanelIcon;
901 _PackageAppInfoImpl::IsMainmenuVisible(void) const
903 return __launchingIconVisible;
907 _PackageAppInfoImpl::SetMainmenuVisible(bool visible)
909 __launchingIconVisible = visible;
914 _PackageAppInfoImpl::AddName(const String& language, const String& name)
916 result r = E_SUCCESS;
917 r = __pNameList->Add(language, name);
923 _PackageAppInfoImpl::GetNameList(void) const
929 _PackageAppInfoImpl::GetUniqueId(void) const
931 result r = E_SUCCESS;
933 DbStatement* pStmt = null;
934 DbEnumerator* pEnum = null;
938 query.Format(1024, L"SELECT UNIQUE_ID FROM AppInfo WHERE APP_NAME = '%ls' and ID = %d", __name.GetPointer(), __pkgId);
940 r = db.Construct(PACKAGE_DATABASE_FILE_NAME, "r");
941 SysTryCatch(NID_APP, r == E_SUCCESS, , r, "[%s] An error occurs while opening a database.", GetErrorMessage(r));
943 pStmt = db.CreateStatementN(query);
944 SysTryCatch(NID_APP, pStmt != null, GetLastResult(),
945 GetLastResult(), "[%s] An error occurs while creating a database statement.", GetErrorMessage(GetLastResult()));
947 pEnum = db.ExecuteStatementN(*pStmt);
950 if (pEnum->MoveNext() == E_SUCCESS)
952 pEnum->GetIntAt(0, uniqueId);
968 _PackageAppInfoImpl::GetPkgId(void) const
974 _PackageAppInfoImpl::SetUniqueId(int id)
981 _PackageAppInfoImpl::SetPkgId(int id)
988 _PackageAppInfoImpl::GetAppFeature(void) const
994 _PackageAppInfoImpl::SetAppFeature(int feature)
996 __appFeature = feature;
1000 _LaunchConditionInfoImpl::_LaunchConditionInfoImpl(void)
1005 _LaunchConditionInfoImpl::~_LaunchConditionInfoImpl(void)
1011 _LaunchConditionInfoImpl::GetName(void) const
1017 _LaunchConditionInfoImpl::SetName(const String& name)
1024 _LaunchConditionInfoImpl::GetValue(void) const
1030 _LaunchConditionInfoImpl::SetValue(const String& value)
1036 _NotificationInfoImpl::_NotificationInfoImpl(void)
1041 _NotificationInfoImpl::~_NotificationInfoImpl(void)
1047 _NotificationInfoImpl::GetName(void) const
1053 _NotificationInfoImpl::SetName(const String& name)
1060 _NotificationInfoImpl::GetValue(void) const
1066 _NotificationInfoImpl::SetValue(const String& value)
1072 _AppFeatureInfoImpl::_AppFeatureInfoImpl(void)
1077 _AppFeatureInfoImpl::~_AppFeatureInfoImpl(void)
1083 _AppFeatureInfoImpl::GetName(void) const
1089 _AppFeatureInfoImpl::SetName(const String& name)
1096 _AppFeatureInfoImpl::GetValue(void) const
1102 _AppFeatureInfoImpl::SetValue(const String& value)
1108 _DataControlTypeImpl::_DataControlTypeImpl(void)
1113 _DataControlTypeImpl::~_DataControlTypeImpl(void)
1119 _DataControlTypeImpl::GetType(void) const
1125 _DataControlTypeImpl::SetType(const String& type)
1132 _DataControlTypeImpl::GetAccess(void) const
1138 _DataControlTypeImpl::SetAccess(const String& access)
1144 _DataControlInfoImpl::_DataControlInfoImpl(void)
1145 : __pControlTypeList(null)
1147 __pControlTypeList = new (std::nothrow) ArrayList;
1148 SysTryReturnVoidResult(NID_APP, __pControlTypeList != null, E_OUT_OF_MEMORY, "__pControlTypeList instance must not be null.");
1149 __pControlTypeList->Construct();
1152 _DataControlInfoImpl::~_DataControlInfoImpl(void)
1154 __pControlTypeList->RemoveAll(true);
1155 delete __pControlTypeList;
1159 _DataControlInfoImpl::GetProviderId(void) const
1161 return __providerId;
1165 _DataControlInfoImpl::SetProviderId(const String& providerId)
1167 __providerId = providerId;
1172 _DataControlInfoImpl::GetControlTypeList(void) const
1174 return __pControlTypeList;
1178 _DataControlInfoImpl::AddControlType(_DataControlTypeImpl* pControlType)
1180 __pControlTypeList->Add(*pControlType);
1184 _AppControlResolutionInfoImpl::_AppControlResolutionInfoImpl(void)
1185 : __pUriScheme(null)
1191 _AppControlResolutionInfoImpl::~_AppControlResolutionInfoImpl(void)
1193 delete __pUriScheme;
1198 _AppControlResolutionInfoImpl::GetUriScheme(void) const
1200 return __pUriScheme;
1204 _AppControlResolutionInfoImpl::SetUriScheme(String* pUriScheme)
1206 __pUriScheme = pUriScheme;
1211 _AppControlResolutionInfoImpl::GetMimeType(void) const
1217 _AppControlResolutionInfoImpl::SetMimeType(String* pMimeType)
1219 __pMimeType = pMimeType;
1223 _AppControlCapabilityInfoImpl::_AppControlCapabilityInfoImpl(void)
1226 ,__pResolutionList(null)
1228 __pResolutionList = new (std::nothrow) ArrayList;
1229 SysTryReturnVoidResult(NID_APP, __pResolutionList != null, E_OUT_OF_MEMORY, "__pResolutionList instance must not be null.");
1230 __pResolutionList->Construct();
1233 _AppControlCapabilityInfoImpl::~_AppControlCapabilityInfoImpl(void)
1235 __pResolutionList->RemoveAll(true);
1236 delete __pResolutionList;
1240 _AppControlCapabilityInfoImpl::GetUniqueId(void) const
1246 _AppControlCapabilityInfoImpl::SetUniqueId(int uniqueId)
1248 __uniqueId = uniqueId;
1253 _AppControlCapabilityInfoImpl::GetAppControlId(void) const
1255 return __appControlId;
1259 _AppControlCapabilityInfoImpl::SetAppControlId(int appControlId)
1261 __appControlId = appControlId;
1266 _AppControlCapabilityInfoImpl::GetOperationId(void) const
1268 return __operationId;
1272 _AppControlCapabilityInfoImpl::SetOperationId(const String& operationId)
1274 __operationId = operationId;
1279 _AppControlCapabilityInfoImpl::GetResolutionList(void) const
1281 return __pResolutionList;
1285 _AppControlCapabilityInfoImpl::AddResolution(_AppControlResolutionInfoImpl* pResolutionImpl)
1287 result r = E_SUCCESS;
1288 r = __pResolutionList->Add(*pResolutionImpl);
1289 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pResolutionList->Add() is failed.");
1294 _AppControlInfoImpl::_AppControlInfoImpl(void)
1296 ,__pCapabilityList(null)
1298 __pCapabilityList = new (std::nothrow) ArrayList;
1299 SysTryReturnVoidResult(NID_APP, __pCapabilityList != null, E_OUT_OF_MEMORY, "__pCapabilityList instance must not be null.");
1300 __pCapabilityList->Construct();
1303 _AppControlInfoImpl::~_AppControlInfoImpl(void)
1305 __pCapabilityList->RemoveAll(true);
1306 delete __pCapabilityList;
1310 _AppControlInfoImpl::GetUniqueId(void) const
1316 _AppControlInfoImpl::SetUniqueId(int uniqueId)
1318 __uniqueId = uniqueId;
1323 _AppControlInfoImpl::GetProviderId(void) const
1325 return __providerId;
1329 _AppControlInfoImpl::SetProviderId(const String& providerId)
1331 __providerId = providerId;
1336 _AppControlInfoImpl::GetCategory(void) const
1342 _AppControlInfoImpl::SetCategory(const String& category)
1344 __category = category;
1349 _AppControlInfoImpl::GetCapabilityList(void) const
1351 return __pCapabilityList;
1355 _AppControlInfoImpl::AddCapability(_AppControlCapabilityInfoImpl* pCapability)
1357 result r = E_SUCCESS;
1358 r = __pCapabilityList->Add(*pCapability);
1359 SysTryReturnResult(NID_APP, !IsFailed(r), r, "__pCapabilityList->Add() is failed.");
1364 } } } // Tizen::App::Package