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_IConditionalOperation.h
19 * @brief This is the header file of the _AppLaunchCondition class.
21 * This header file contains the declarations of the _AppLaunchCondition class
24 #ifndef _FAPP_INTERNAL_CONDITIONAL_OPERATION_H_
25 #define _FAPP_INTERNAL_CONDITIONAL_OPERATION_H_
28 #include <FOspConfig.h>
29 #include <FBaseObject.h>
30 #include <FBaseColIList.h>
31 #include <FBaseColArrayList.h>
32 #include <FAppTypes.h>
33 #include <FAppAppManager.h>
35 #include <FBaseSysLog.h>
37 namespace Tizen { namespace System {
38 class _AlarmConditionHandler;
42 namespace Tizen { namespace App {
46 * @class _AppLaunchCondition
47 * @brief This class abstracts information for conditional app launch
50 class _OSP_EXPORT_ _AppLaunchCondition
51 : public Tizen::Base::Object
55 * Gets the application ID of the target application.
57 * @return application ID
60 AppId GetAppId(void) const;
63 * Gets registered condition string.
64 * @return condition string
68 Tizen::Base::String GetConditionString(void) const;
73 * @param[in] pUserData The pointer to userdata of this instance
74 * Userdata can be context or handle. (ex, Alarm instance, Timer handle, etc)
78 result SetUserData(const Object* pUserData);
83 * @return The pointer to userdata of this instance.
84 * You can cancel or delete plugin dependent information using this pointer in overridden function _AppLaunchConditionBase::Unregister.
88 Object* GetUserData(void) const;
96 Tizen::Base::Collection::IList* GetLaunchArgs(void) const;
100 * This is the constructor for this class.
104 _AppLaunchCondition(void);
107 * This is the destructor for this class.
111 virtual ~_AppLaunchCondition(void);
114 * Initializes this instance of _AppLaunchCondition with the specified parameter
117 * @return An error code
118 * @param[in] appId The application's ID to be executed conditionally
119 * @param[in] condition The launch condition for the application
120 * @param[in] pArguments A pointer to the list of string arguments that has a maximum size of @c 1024 bytes @n
121 * The default value is @c null.
122 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
123 * @param[in] pRegSectionName The section name in the registry.
124 This value is used to find a registry section by condition string and remove it easily.
125 * @exception E_SUCCESS The method is successful.
126 * @exception E_OUT_OF_MEMORY The memory is insufficient.
128 * @see Tizen::App::AppManager::RegisterAppLaunch()
130 result Construct(const AppId& appId, const Tizen::Base::String& conditionString, const Base::Collection::IList* pArgs, AppManager::LaunchOption option , const Tizen::Base::String* pRegSectionName = null);
133 _AppLaunchCondition(const _AppLaunchCondition& operation);
134 _AppLaunchCondition& operator =(const _AppLaunchCondition& operation);
139 Tizen::Base::Collection::ArrayList *__pArguments;
140 AppManager::LaunchOption __option;
143 Tizen::Base::String __conditionString;
144 const Object* __pUserData;///<< pointer to plugin's context or handle. (ex, Alarm instance, Timer handle, etc). You can cancel or delete registered operation using this value, when _AppLaunchConditionBase::Unregister implemented function is invoked.
146 result CopyArgumentsDeeply(const Tizen::Base::Collection::IList *pArgs);
147 Tizen::Base::String __regSectionName;
149 friend class _ConditionHandler;
150 friend class _ConditionManagerService;
151 friend class Tizen::System::_AlarmConditionHandler;
152 }; //_AppLaunchCondition
157 #endif // _FAPP_INTERNAL_CONDITIONAL_OPERATION_H_