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_AppLaunchConditionHandlerBase.h
20 * @brief This is the header file of the _AppLaunchConditionHandlerBase class.
22 * This header file contains the declarations of the _AppLaunchConditionHandlerBase class.
24 #ifndef _FAPP_INTERNAL_APP_LAUNCH_CONDITION_HANDLER_BASE_H_
25 #define _FAPP_INTERNAL_APP_LAUNCH_CONDITION_HANDLER_BASE_H_
27 #include <FBaseObject.h>
28 #include <FAppTypes.h>
30 #include <FBaseSysLog.h>
31 #include "FApp_IAppLaunchConditionEventListener.h"
32 #include "FApp_AppLaunchCondition.h"
34 namespace Tizen { namespace App {
38 * @class _AppLaunchConditionHandlerBase
39 * @brief This class is the abstract base class of all conditional app launch handlers(plugin).
42 * All conditional app launch handlers(plugin) should inherit this abstract class.
43 * and all plugins must provide both a creation and a destruction function like following.
46 * extern "C" _AppLaunchConditionHandlerBase* CreatePlugin()
48 * return new (std::nothrow) _AlarmConditionHandler;// create and return your own class instance.
51 * extern "C" void DestroyPlugin(_AppLaunchConditionHandlerBase* p)
57 class _OSP_EXPORT_ _AppLaunchConditionHandlerBase
58 : public Tizen::Base::Object
62 * This is the constructor for this class.
66 _AppLaunchConditionHandlerBase(void);
69 * This is the destructor for this class.
73 virtual ~_AppLaunchConditionHandlerBase(void);
76 * Sets event listener instance. @n
77 * The listener can listen to OnAppLaunchConditionMet event.
80 * @param[in] The operation registered conditional operation with current condition.
81 * @remark _ConditionManagerService uses this function to sets itself as listener.
83 result SetEventListener(_IAppLaunchConditionEventListener& eventListener);
86 * Register app launch condition for the plug-in.
89 * @return An error code
90 * @param[in] operation The conditional operation to register
91 * @exception E_SUCCESS The method is successful.
92 * @exception E_INVALID_FORMAT The specified condition format is invalid.
93 * @exception E_INVALID_CONDITION The specified condition format is valid but the condition has at least one or more invalid values.
94 * @exception E_OUT_OF_MEMORY The memory is insufficient.
95 * @exception E_SYSTEM A system error has occurred.
96 * @remark Plugin should implement this register condition code
97 * _ConditionManagerService calls this method when RegisterAppLaunch method invoked.
100 virtual result Register( _AppLaunchCondition& condition) = 0;//, const Tizen::Base::Object*& pHandle) = 0;
103 * Unregister app launch condition for the plug-in.
106 * @param[in] operation The conditional operation to register
107 * @remark Plugin should implement this unregister condition code
108 * _ConditionManagerService calls this method when UnregisterAppLaunch method invoked.
111 virtual result Unregister( _AppLaunchCondition& condition) = 0;//, const Tizen::Base::Object* pHandle) = 0;
116 * Fires the OnAppLaunchConditionMet event.
119 * @return An error code
120 * @exception E_SUCCESS The method is successful.
121 * @exception E_INVALID_STATE The event handler isn't initialized yet.
122 * @param[in] operation The conditional operation registered.
123 * @param[in] pExtraData The extra data being delivered in which elements are a pair of key and value of Tizen::Base::String.
124 * @see _IAppLaunchConditionEventListener::OnAppLaunchConditionMet
126 result Fire(const _AppLaunchCondition& condition, Tizen::Base::Collection::IMap* pExtraData = null);
129 _IAppLaunchConditionEventListener* __pEventListener;
130 }; //_AppLaunchConditionHandlerBase
134 #endif // _FAPP_INTERNAL_APP_LAUNCH_CONDITION_HANDLER_BASE_H_