sync with tizen_2.0
[platform/framework/native/appfw.git] / inc / FAppIAppLaunchConditionEventListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file                        FAppIAppLaunchConditionEventListener.h
20  * @brief                       This is the header file for the %IAppLaunchConditionEventListener interface.
21  *
22  * This header file contains the declarations of the %IAppLaunchConditionEventListener interface.
23  */
24
25 #ifndef _FAPP_IAPP_LAUNCH_CONDITION_EVENT_LISTENER_H_
26 #define _FAPP_IAPP_LAUNCH_CONDITION_EVENT_LISTENER_H_
27
28 #include <FOspConfig.h>
29 #include <FBaseRtIEventListener.h>
30
31 namespace Tizen { namespace Base { class String; } }
32
33 namespace Tizen { namespace App
34 {
35
36 /**
37 * @interface    IAppLaunchConditionEventListener
38 * @brief                This interface defines a listener for the AppLaunchCondition events.
39 *
40 * @since        2.0
41 *
42 * The %IAppLaunchConditionEventListener interface defines a listener for the AppLaunchCondition events.
43 * @n
44 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/app/launching_other_apps_within_apps.htm">Launching Other Applications</a>, <a href="../org.tizen.native.appprogramming/html/guide/app/registering_launch_condition.htm">Registering a Launch Condition</a>.
45 */
46 class _OSP_EXPORT_ IAppLaunchConditionEventListener
47         : virtual public Tizen::Base::Runtime::IEventListener
48 {
49 public:
50         /**
51          * This polymorphic destructor should be overridden if required.
52          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
53          *
54          * @since       2.0
55          */
56         virtual ~IAppLaunchConditionEventListener(void) {}
57
58         /**
59         * Called when the registered launch condition is met.
60         *
61         * @since        2.0
62         *
63         * @param[in] condition        The registered condition for the application launch
64         * @param[in] pArguments       A list of string arguments specified when the condition is registered
65         * @param[in] pExtraData       A pointer to the instance of object that system delivered, @n
66         *                             else @c null if there is no extra data
67         *
68         * @remarks     If extra data is required to be delivered, @c pExtraData contains the data,
69         *              and this must be freed by the launched application after use.
70         *               ( Currently, only NFC condition uses this to deliver to Tizen::Net::Nfc::NdefMessage. )
71         * @see         Tizen::App::AppManager::RegisterAppLaunch()
72         * @see         Tizen::App::AppManager::SetAppLaunchConditionEventListener()
73         *
74         *  The following example demonstrates how to use the %OnAppLaunchConditionMetN() method to get Tizen::Net::Nfc::NdefMessage instance, when an application is launched by NFC condition.
75         *  @code
76         *  NdefMessage* pMessage = dynamic_cast<NdefMessage*>(pExtraData);
77         *  @endcode
78         */
79         virtual void OnAppLaunchConditionMetN(const Tizen::Base::String& condition, Tizen::Base::Object* pExtraData, Tizen::Base::Collection::IList* pArguments) = 0;
80
81 protected:
82         //
83         // This method is for internal use only.
84         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
85         //
86         // This method is reserved and may change its name at any time without prior notice.
87         //
88         // @since       2.0
89         //
90         virtual void IAppLaunchConditionEventListener_Reserved1(void) {}
91
92         //
93         // This method is for internal use only.
94         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
95         //
96         // This method is reserved and may change its name at any time without prior notice.
97         //
98         // @since       2.0
99         //
100         virtual void IAppLaunchConditionEventListener_Reserved2(void) {}
101
102         //
103         // This method is for internal use only.
104         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
105         //
106         // This method is reserved and may change its name at any time without prior notice.
107         //
108         // @since       2.0
109         //
110         virtual void IAppLaunchConditionEventListener_Reserved3(void) {}
111 }; // IAppLaunchConditionEventListener
112
113 } } // Tizen::App
114
115 #endif // _FAPP_IAPP_LAUNCH_CONDITION_EVENT_LISTENER_H_
116