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 App {
41 * @class _AppLaunchCondition
42 * @brief This class abstracts information for conditional app launch
45 class _OSP_EXPORT_ _AppLaunchCondition
46 : public Tizen::Base::Object
50 * Gets the application ID of the target application.
52 * @return application ID
55 AppId GetAppId(void) const;
58 * Gets registered condition string.
59 * @return condition string
63 Tizen::Base::String GetConditionString(void) const;
68 * @param[in] pUserData The pointer to userdata of this instance
69 * Userdata can be context or handle. (ex, Alarm instance, Timer handle, etc)
73 result SetUserData(const Object* pUserData);
78 * @return The pointer to userdata of this instance.
79 * You can cancel or delete plugin dependent information using this pointer in overridden function _AppLaunchConditionBase::Unregister.
83 Object* GetUserData(void) const;
88 * This is the constructor for this class.
92 _AppLaunchCondition(void);
95 * This is the destructor for this class.
99 virtual ~_AppLaunchCondition(void);
102 * Initializes this instance of _AppLaunchCondition with the specified parameter
105 * @return An error code
106 * @param[in] appId The application's ID to be executed conditionally
107 * @param[in] condition The launch condition for the application
108 * @param[in] pArguments A pointer to the list of string arguments that has a maximum size of @c 1024 bytes @n
109 * The default value is @c null.
110 * @param[in] option The launch option (currently only AppManager::LAUNCH_OPTION_DEFAULT is available)
111 * @param[in] pRegSectionName The section name in the registry.
112 This value is used to find a registry section by condition string and remove it easily.
113 * @exception E_SUCCESS The method is successful.
114 * @exception E_OUT_OF_MEMORY The memory is insufficient.
116 * @see Tizen::App::AppManager::RegisterAppLaunch()
118 result Construct(const AppId& appId, const Tizen::Base::String& conditionString, const Base::Collection::IList* pArgs, AppManager::LaunchOption option , const Tizen::Base::String* pRegSectionName = null);
121 _AppLaunchCondition(const _AppLaunchCondition& operation);
122 _AppLaunchCondition& operator =(const _AppLaunchCondition& operation);
127 Tizen::Base::Collection::ArrayList *__pArguments;
128 AppManager::LaunchOption __option;
131 Tizen::Base::String __conditionString;
132 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.
134 result CopyArgumentsDeeply(const Tizen::Base::Collection::IList *pArgs);
135 Tizen::Base::String __regSectionName;
137 friend class _ConditionHandler;
138 friend class _ConditionManagerService;
139 }; //_AppLaunchCondition
144 #endif // _FAPP_INTERNAL_CONDITIONAL_OPERATION_H_