2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FApp_AppLaunchCondition.cpp
19 * @brief This is the implementation for the _ConditionManagerStub class.
22 #include "FApp_AppLaunchCondition.h"
24 namespace Tizen { namespace App {
26 using namespace Tizen::Base;
27 using namespace Tizen::Base::Collection;
30 _AppLaunchCondition::_AppLaunchCondition(void)
31 : __appId(L""), __pArguments(null), __option(AppManager::LAUNCH_OPTION_DEFAULT), __conditionString(L""), __pUserData(null), __regSectionName(L"")
35 _AppLaunchCondition::~_AppLaunchCondition(void)
37 if (__pArguments != null)
39 __pArguments->RemoveAll(true);
45 _AppLaunchCondition::Construct(const AppId& appId, const String& conditionString, const IList* pArgs, AppManager::LaunchOption option, const String* pRegSectionName)
49 __conditionString = conditionString;
51 __regSectionName = (pRegSectionName != null) ? *pRegSectionName : L"";
53 return CopyArgumentsDeeply(pArgs);
57 _AppLaunchCondition::GetAppId(void) const
63 _AppLaunchCondition::GetConditionString(void) const
65 return __conditionString;
69 _AppLaunchCondition::GetUserData(void) const
71 return const_cast<Object*>(__pUserData);
75 _AppLaunchCondition::SetUserData(const Object* pUserData)
77 __pUserData = pUserData;
82 _AppLaunchCondition::CopyArgumentsDeeply(const IList *pArgs)
86 if (pArgs != null && pArgs->GetCount() > 0)
88 __pArguments = new (std::nothrow) ArrayList();
89 SysTryReturnResult(NID_APP, __pArguments != null, E_OUT_OF_MEMORY, "failed to allocate 'pArguments'!");
91 __pArguments->Construct();
93 for (int i = 0; i < pArgs->GetCount() ; i++)
95 r = __pArguments->Add(* new (std::nothrow) String(* static_cast<const String*>(pArgs->GetAt(i))));
96 SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s]", GetErrorMessage(r));
103 __pArguments->RemoveAll(true);
110 }}//namespace Tizen { namespace App {