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 ,__isSubModeAllowed(true)
446 ,__legacyAppControls(false)
447 ,__isSystemService(false)
448 ,__menuIconVisible(false)
456 __pCategoryList->RemoveAll();
457 delete __pCategoryList;
460 if (__pAccountDataList)
462 __pAccountDataList->RemoveAll();
463 delete __pAccountDataList;
466 if (__pAppControlDataList)
468 __pAppControlDataList->RemoveAll();
469 delete __pAppControlDataList;
472 if (__pAppControlImplList)
474 __pAppControlImplList->RemoveAll();
475 delete __pAppControlImplList;
478 if (__pDataControlList)
480 __pDataControlList->RemoveAll();
481 delete __pDataControlList;
484 if (__pSubModeAppControlDataList)
486 __pSubModeAppControlDataList->RemoveAll();
487 delete __pSubModeAppControlDataList;
490 if (__pLiveboxDataList)
492 __pLiveboxDataList->RemoveAll();
493 delete __pLiveboxDataList;
494 __pLiveboxDataList = null;
499 __pNameList->RemoveAll();
505 __pFeatureList->RemoveAll();
506 delete __pFeatureList;
509 if (__pNotificationMap)
511 __pNotificationMap->RemoveAll();
512 delete __pNotificationMap;
517 __pMetadataMap->RemoveAll();
518 delete __pMetadataMap;
521 if (__pLaunchConditionList)
523 __pLaunchConditionList->RemoveAll();
524 delete __pLaunchConditionList;
529 AppData::Construct(void)
531 result r = E_SUCCESS;
533 __pCategoryList = new (std::nothrow) ArrayListT<String*>;
534 TryReturn(__pCategoryList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pCategoryList is null.");
536 __pAccountDataList = new (std::nothrow) ArrayListT<AccountData*>;
537 TryReturn(__pAccountDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAccountDataList is null.");
539 __pAppControlDataList = new (std::nothrow) ArrayListT<AppControlData*>;
540 TryReturn(__pAppControlDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAppControlDataList is null.");
542 __pAppControlImplList = new (std::nothrow) ArrayListT<_AppControlInfo*>;
543 TryReturn(__pAppControlImplList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pAppControlImplList is null.");
545 __pDataControlList = new (std::nothrow) ArrayListT<DataControlInfo*>;
546 TryReturn(__pDataControlList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pDataControlList is null.");
548 __pSubModeAppControlDataList = new (std::nothrow) ArrayListT<AppControlData*>;
549 TryReturn(__pSubModeAppControlDataList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pSubModeAppControlDataList is null.");
551 __pNameList = new (std::nothrow) HashMap(SingleObjectDeleter);
552 TryReturn(__pNameList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pNameList is null.");
553 r = __pNameList->Construct();
554 TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pNameList->Construct() failed.");
556 __pFeatureList = new (std::nothrow) HashMap(SingleObjectDeleter);
557 TryReturn(__pFeatureList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pFeatureList is null.");
558 r = __pFeatureList->Construct();
559 TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pFeatureList->Construct() failed.");
561 __pNotificationMap = new (std::nothrow) HashMap(SingleObjectDeleter);
562 TryReturn(__pNotificationMap, INSTALLER_ERROR_OUT_OF_MEMORY, "__pNotificationMap is null.");
563 r = __pNotificationMap->Construct();
564 TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pNotificationMap->Construct() failed.");
566 __pMetadataMap = new (std::nothrow) HashMap(SingleObjectDeleter);
567 TryReturn(__pMetadataMap, INSTALLER_ERROR_OUT_OF_MEMORY, "__pMetadataMap is null.");
568 r = __pMetadataMap->Construct();
569 TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pMetadataMap->Construct() failed.");
571 __pLaunchConditionList = new (std::nothrow) MultiHashMap(SingleObjectDeleter);
572 TryReturn(__pLaunchConditionList, INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList is null.");
573 r = __pLaunchConditionList->Construct();
574 TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList->Construct() failed.");
576 return INSTALLER_ERROR_NONE;