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 InstallationContextData.cpp
19 * @brief This is the implementation for the InstallationContextData class.
22 #include "InstallationContextData.h"
25 using namespace Tizen::Base;
26 using namespace Tizen::Base::Collection;
27 using namespace Tizen::Io;
28 using namespace Tizen::Security::Cert;
31 AppControlData::AppControlData()
32 :__pOperationList(null)
33 ,__pMimeTypeList(null)
37 __pOperationList = new (std::nothrow) ArrayListT<String*>;
38 __pMimeTypeList = new (std::nothrow) ArrayListT<String*>;
39 __pUriList = new (std::nothrow) ArrayListT<String*>;
42 AppControlData::~AppControlData()
44 __pOperationList->RemoveAll();
45 delete __pOperationList;
47 __pMimeTypeList->RemoveAll();
48 delete __pMimeTypeList;
50 __pUriList->RemoveAll();
54 AccountData::AccountData()
56 ,__pCapabilityList(null)
61 AccountData::~AccountData()
63 __pNameList->RemoveAll(true);
66 __pCapabilityList->RemoveAll();
67 delete __pCapabilityList;
71 AccountData::Construct()
75 __pNameList = new (std::nothrow) HashMap;
76 TryReturn(__pNameList, false, "__pNameList is null.");
78 r = __pNameList->Construct();
79 TryReturn(!IsFailed(r), false, "__pNameList->Construct() is failed.");
81 __pCapabilityList = new (std::nothrow) ArrayListT<String*>;
82 TryReturn(__pCapabilityList, false, "__pCapabilityList is null.");
88 LiveboxData::LiveboxData(void)
93 __pNameList = new (std::nothrow) HashMap;
94 TryReturn(__pNameList, , "__pNameList is null.");
95 __pNameList->Construct();
97 __pSizeList = new (std::nothrow) HashMap;
98 TryReturn(__pSizeList, , "__pSizeList is null.");
99 __pSizeList->Construct();
102 LiveboxData::~LiveboxData(void)
104 __pNameList->RemoveAll(true);
107 __pSizeList->RemoveAll(true);
112 LiveboxData::SetUpdatePeriod(long long period)
114 __updatePeriod = period;
119 LiveboxData::GetUpdatePeriod(void) const
121 return __updatePeriod;
125 LiveboxData::SetPopupEnabled(const String& value)
127 __popupEnabled = value;
132 LiveboxData::GetPopupEnabled(void) const
134 return __popupEnabled;
138 LiveboxData::SetIcon(const String& icon)
145 LiveboxData::GetIcon(void) const
151 LiveboxData::SetProviderName(const String& providerName)
153 __providerName = providerName;
158 LiveboxData::GetProviderName(void) const
160 return __providerName;
164 LiveboxData::AddName(const String& language, const String& name)
166 result r = E_SUCCESS;
168 r = __pNameList->Add(language, name);
174 LiveboxData::GetNameList(void) const
180 LiveboxData::AddSize(String* pSize, String* pPreviewImage)
182 result r = E_SUCCESS;
184 r = __pSizeList->Add(pSize, pPreviewImage);
190 LiveboxData::GetSizeList(void) const
196 _AppControlResolutionInfo::_AppControlResolutionInfo(void)
203 _AppControlResolutionInfo::~_AppControlResolutionInfo(void)
210 _AppControlResolutionInfo::GetUriScheme(void) const
216 _AppControlResolutionInfo::SetUriScheme(String* pUriScheme)
218 __pUriScheme = pUriScheme;
223 _AppControlResolutionInfo::GetMimeType(void) const
229 _AppControlResolutionInfo::SetMimeType(String* pMimeType)
231 __pMimeType = pMimeType;
235 _AppControlCapabilityInfo::_AppControlCapabilityInfo(void)
237 ,__pResolutionList(null)
239 __pResolutionList = new (std::nothrow) ArrayList;
240 TryReturnVoidResult(__pResolutionList != null, E_OUT_OF_MEMORY, "__pResolutionList instance must not be null.");
241 __pResolutionList->Construct();
244 _AppControlCapabilityInfo::~_AppControlCapabilityInfo(void)
246 __pResolutionList->RemoveAll(true);
247 delete __pResolutionList;
251 _AppControlCapabilityInfo::GetAppControlId(void) const
253 return __appControlId;
257 _AppControlCapabilityInfo::SetAppControlId(int appControlId)
259 __appControlId = appControlId;
264 _AppControlCapabilityInfo::GetOperationId(void) const
266 return __operationId;
270 _AppControlCapabilityInfo::SetOperationId(const String& operationId)
272 __operationId = operationId;
277 _AppControlCapabilityInfo::GetResolutionList(void) const
279 return __pResolutionList;
283 _AppControlCapabilityInfo::AddResolution(_AppControlResolutionInfo* pResolutionImpl)
285 result r = E_SUCCESS;
286 r = __pResolutionList->Add(*pResolutionImpl);
287 TryReturn(!IsFailed(r), r, "__pResolutionList->Add() is failed.");
292 _AppControlInfo::_AppControlInfo(void)
293 : __pCapabilityList(null)
295 __pCapabilityList = new (std::nothrow) ArrayList;
296 TryReturnVoidResult(__pCapabilityList != null, E_OUT_OF_MEMORY, "__pCapabilityList instance must not be null.");
297 __pCapabilityList->Construct();
300 _AppControlInfo::~_AppControlInfo(void)
302 __pCapabilityList->RemoveAll(true);
303 delete __pCapabilityList;
307 _AppControlInfo::GetProviderId(void) const
313 _AppControlInfo::SetProviderId(const String& providerId)
315 __providerId = providerId;
320 _AppControlInfo::GetCategory(void) const
326 _AppControlInfo::SetCategory(const String& category)
328 __category = category;
333 _AppControlInfo::GetCapabilityList(void) const
335 return __pCapabilityList;
339 _AppControlInfo::AddCapability(_AppControlCapabilityInfo* pCapability)
341 result r = E_SUCCESS;
342 r = __pCapabilityList->Add(*pCapability);
343 TryReturn(!IsFailed(r), r, "__pCapabilityList->Add() is failed.");
349 DataControlType::DataControlType(void)
354 DataControlType::~DataControlType(void)
360 DataControlInfo::DataControlInfo(void)
361 : __pControlTypeList(null)
363 __pControlTypeList = new (std::nothrow) ArrayListT<DataControlType*>;
364 TryReturnVoidResult(__pControlTypeList != null, E_OUT_OF_MEMORY, "__pControlTypeList instance must not be null.");
367 DataControlInfo::~DataControlInfo(void)
369 __pControlTypeList->RemoveAll();
370 delete __pControlTypeList;
374 ContentData::ContentData(void)
377 __pNameList = new (std::nothrow) HashMap;
378 TryReturn(__pNameList, , "__pNameList is null.");
379 __pNameList->Construct();
382 ContentData::~ContentData(void)
384 __pNameList->RemoveAll(true);
389 ContentData::SetContentId(const String& contentId)
391 __contentId = contentId;
396 ContentData::GetContentId(void) const
402 ContentData::SetIcon(const String& icon)
409 ContentData::GetIcon(void) const
415 ContentData::AddName(const String& language, const String& name)
417 result r = E_SUCCESS;
419 r = __pNameList->Add(language, name);
425 ContentData::GetNameList(void) const
431 :__pCategoryList(null)
432 ,__pAccountDataList(null)
433 ,__pAppControlDataList(null)
434 ,__pAppControlImplList(null)
435 ,__pDataControlList(null)
436 ,__pSubModeAppControlDataList(null)
437 ,__pLiveboxDataList(null)
439 ,__pFeatureList(null)
440 ,__pNotificationMap(null)
441 ,__pMetadataMap(null)
442 ,__pLaunchConditionList(null)
445 ,__legacyAppControls(false)
446 ,__isSystemService(false)
447 ,__mainmenuVisible(false)
455 __pCategoryList->RemoveAll();
456 delete __pCategoryList;
459 if (__pAccountDataList)
461 __pAccountDataList->RemoveAll();
462 delete __pAccountDataList;
465 if (__pAppControlDataList)
467 __pAppControlDataList->RemoveAll();
468 delete __pAppControlDataList;
471 if (__pAppControlImplList)
473 __pAppControlImplList->RemoveAll();
474 delete __pAppControlImplList;
477 if (__pDataControlList)
479 __pDataControlList->RemoveAll();
480 delete __pDataControlList;
483 if (__pSubModeAppControlDataList)
485 __pSubModeAppControlDataList->RemoveAll();
486 delete __pSubModeAppControlDataList;
489 if (__pLiveboxDataList)
491 __pLiveboxDataList->RemoveAll();
492 delete __pLiveboxDataList;
493 __pLiveboxDataList = null;
498 __pNameList->RemoveAll();
504 __pFeatureList->RemoveAll();
505 delete __pFeatureList;
508 if (__pNotificationMap)
510 __pNotificationMap->RemoveAll();
511 delete __pNotificationMap;
516 __pMetadataMap->RemoveAll();
517 delete __pMetadataMap;
520 if (__pLaunchConditionList)
522 __pLaunchConditionList->RemoveAll();
523 delete __pLaunchConditionList;
528 AppData::Construct(void)
530 result r = E_SUCCESS;
532 __pCategoryList = new (std::nothrow) ArrayListT<String*>;
533 TryReturn(__pCategoryList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pCategoryList is null.");
535 __pAccountDataList = new (std::nothrow) ArrayListT<AccountData*>;
536 TryReturn(__pAccountDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAccountDataList is null.");
538 __pAppControlDataList = new (std::nothrow) ArrayListT<AppControlData*>;
539 TryReturn(__pAppControlDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAppControlDataList is null.");
541 __pAppControlImplList = new (std::nothrow) ArrayListT<_AppControlInfo*>;
542 TryReturn(__pAppControlImplList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAppControlImplList is null.");
544 __pDataControlList = new (std::nothrow) ArrayListT<DataControlInfo*>;
545 TryReturn(__pDataControlList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pDataControlList is null.");
547 __pSubModeAppControlDataList = new (std::nothrow) ArrayListT<AppControlData*>;
548 TryReturn(__pSubModeAppControlDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pSubModeAppControlDataList is null.");
550 __pNameList = new (std::nothrow) HashMap(SingleObjectDeleter);
551 TryReturn(__pNameList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pNameList is null.");
552 r = __pNameList->Construct();
553 TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pNameList->Construct() failed.");
555 __pFeatureList = new (std::nothrow) HashMap(SingleObjectDeleter);
556 TryReturn(__pFeatureList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pFeatureList is null.");
557 r = __pFeatureList->Construct();
558 TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pFeatureList->Construct() failed.");
560 __pNotificationMap = new (std::nothrow) HashMap(SingleObjectDeleter);
561 TryReturn(__pNotificationMap, INSTALLER_ERROR_OUT_OF_MEMORY, "__pNotificationMap is null.");
562 r = __pNotificationMap->Construct();
563 TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pNotificationMap->Construct() failed.");
565 __pMetadataMap = new (std::nothrow) HashMap(SingleObjectDeleter);
566 TryReturn(__pMetadataMap, INSTALLER_ERROR_OUT_OF_MEMORY, "__pMetadataMap is null.");
567 r = __pMetadataMap->Construct();
568 TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pMetadataMap->Construct() failed.");
570 __pLaunchConditionList = new (std::nothrow) MultiHashMap(SingleObjectDeleter);
571 TryReturn(__pLaunchConditionList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList is null.");
572 r = __pLaunchConditionList->Construct();
573 TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList->Construct() failed.");
575 return INSTALLER_ERROR_NONE;