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.
19 * @file FApp_AppLaunchCondition.cpp
20 * @brief This is the implementation for the _ConditionManagerStub class.
23 #include "FApp_AppLaunchCondition.h"
25 namespace Tizen { namespace App {
27 using namespace Tizen::Base;
28 using namespace Tizen::Base::Collection;
31 _AppLaunchCondition::_AppLaunchCondition(void)
32 : __appId(L""), __pArguments(null), __option(AppManager::LAUNCH_OPTION_DEFAULT), __conditionString(L""), __pUserData(null), __regSectionName(L"")
36 _AppLaunchCondition::~_AppLaunchCondition(void)
38 if (__pArguments != null)
40 __pArguments->RemoveAll(true);
46 _AppLaunchCondition::Construct(const AppId& appId, const String& conditionString, const IList* pArgs, AppManager::LaunchOption option, const String* pRegSectionName)
50 __conditionString = conditionString;
52 __regSectionName = (pRegSectionName != null) ? *pRegSectionName : L"";
54 return CopyArgumentsDeeply(pArgs);
58 _AppLaunchCondition::GetAppId(void) const
64 _AppLaunchCondition::GetConditionString(void) const
66 return __conditionString;
70 _AppLaunchCondition::GetUserData(void) const
72 return const_cast<Object*>(__pUserData);
76 _AppLaunchCondition::SetUserData(const Object* pUserData)
78 __pUserData = pUserData;
83 _AppLaunchCondition::CopyArgumentsDeeply(const IList *pArgs)
87 if (pArgs != null && pArgs->GetCount() > 0)
89 __pArguments = new (std::nothrow) ArrayList();
90 SysTryReturnResult(NID_APP, __pArguments != null, E_OUT_OF_MEMORY, "failed to allocate 'pArguments'!");
92 __pArguments->Construct();
94 for (int i = 0; i < pArgs->GetCount() ; i++)
96 r = __pArguments->Add(* new (std::nothrow) String(* static_cast<const String*>(pArgs->GetAt(i))));
97 SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s]", GetErrorMessage(r));
104 __pArguments->RemoveAll(true);
111 }}//namespace Tizen { namespace App {