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_IConditionalOperation.h
20 * @brief This is the header file of the _AppLaunchCondition class.
22 * This header file contains the declarations of the _AppLaunchCondition class
25 #ifndef _FAPP_INTERNAL_CONDITIONAL_OPERATION_H_
26 #define _FAPP_INTERNAL_CONDITIONAL_OPERATION_H_
29 #include <FOspConfig.h>
30 #include <FBaseObject.h>
31 #include <FBaseColIList.h>
32 #include <FBaseColArrayList.h>
33 #include <FAppTypes.h>
34 #include <FAppAppManager.h>
36 #include <FBaseSysLog.h>
38 namespace Tizen { namespace App {
42 * @class _AppLaunchCondition
43 * @brief This class abstracts information for conditional app launch
46 class _OSP_EXPORT_ _AppLaunchCondition
47 : public Tizen::Base::Object
51 * Gets the application ID of the target application.
53 * @return application ID
56 AppId GetAppId(void) const;
59 * Gets registered condition string.
60 * @return condition string
64 Tizen::Base::String GetConditionString(void) const;
69 * @param[in] pUserData The pointer to userdata of this instance
70 * Userdata can be context or handle. (ex, Alarm instance, Timer handle, etc)
74 result SetUserData(const Object* pUserData);
79 * @return The pointer to userdata of this instance.
80 * You can cancel or delete plugin dependent information using this pointer in overridden function _AppLaunchConditionBase::Unregister.
84 Object* GetUserData(void) const;
89 * This is the constructor for this class.
93 _AppLaunchCondition(void);
96 * This is the destructor for this class.
100 virtual ~_AppLaunchCondition(void);
103 * Initializes this instance of _AppLaunchCondition with the specified parameter
106 * @return An error code
107 * @param[in] appId The application's ID to be executed conditionally
108 * @param[in] condition The launch condition for the application
109 * @param[in] pArguments A pointer to the list of string arguments that has a maximum size of @c 1024 bytes @n
110 * The default value is @c null.
111 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
112 * @param[in] pRegSectionName The section name in the registry.
113 This value is used to find a registry section by condition string and remove it easily.
114 * @exception E_SUCCESS The method is successful.
115 * @exception E_OUT_OF_MEMORY The memory is insufficient.
117 * @see Tizen::App::AppManager::RegisterAppLaunch()
119 result Construct(const AppId& appId, const Tizen::Base::String& conditionString, const Base::Collection::IList* pArgs, AppManager::LaunchOption option , const Tizen::Base::String* pRegSectionName = null);
122 _AppLaunchCondition(const _AppLaunchCondition& operation);
123 _AppLaunchCondition& operator =(const _AppLaunchCondition& operation);
128 Tizen::Base::Collection::ArrayList *__pArguments;
129 AppManager::LaunchOption __option;
132 Tizen::Base::String __conditionString;
133 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.
135 result CopyArgumentsDeeply(const Tizen::Base::Collection::IList *pArgs);
136 Tizen::Base::String __regSectionName;
138 friend class _ConditionHandler;
139 friend class _ConditionManagerService;
140 }; //_AppLaunchCondition
145 #endif // _FAPP_INTERNAL_CONDITIONAL_OPERATION_H_