merge with master
[platform/framework/web/wrt-plugins-common.git] / src / modules / API / DEPRACATED / AppLauncher / EventLaunchApplication.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /*
17  * @file        IEventLaunchApplication.h
18  * @author      Lukasz Marek (l.marek@samsung.com)
19  * @version     0.1
20  * @brief
21  */
22
23 #ifndef _ABSTRACT_LAYER_IEVENT_LAUNCH_APPLICATION_H_
24 #define _ABSTRACT_LAYER_IEVENT_LAUNCH_APPLICATION_H_
25
26 #include <vector>
27 #include <string>
28 #include <dpl/shared_ptr.h>
29 #include <commons/IEvent.h>
30 #include <commons/EventReceiver.h>
31
32 namespace WrtPlugins {
33 namespace Api {
34 namespace AppLauncher {
35 /* this event is sent when application is launched */
36 class EventLaunchApplication : public WrtPlugins::Platform::IEvent<
37         EventLaunchApplication>
38 {
39     //Uri type. http://, file://, sms:, mailto: etc
40     ApplicationUriType m_applicationUriType;
41     // used as param to uriType, for example http address, path to file, phone
42     // number, etc
43     std::string m_applicationUriParam;
44     //optional parameters for file://
45     std::vector<std::string> m_applicationParameters;
46
47   public:
48     void            addApplicationParameter(const std::string &value)
49     {
50         m_applicationParameters.push_back(value);
51     }
52     std::vector<std::string> getApplicationParameters() const
53     {
54         return m_applicationParameters;
55     }
56     void            setApplicationUriType(const ApplicationUriType value)
57     {
58         m_applicationUriType = value;
59     }
60     ApplicationUriType getApplicationUriType() const
61     {
62         return m_applicationUriType;
63     }
64     void            setApplicationUriParam(const std::string &value)
65     {
66         m_applicationUriParam = value;
67     }
68     std::string     getApplicationUriParam() const
69     {
70         return m_applicationUriParam;
71     }
72     virtual void    clearOnCancel()
73     {}
74     EventLaunchApplication() : m_applicationUriType(
75             APPLICATION_URI_TYPE_UNDEFINED)
76     {}
77 };
78
79 typedef DPL::SharedPtr<EventLaunchApplication> EventLaunchApplicationPtr;
80 }
81 }
82 }
83
84 #endif /* _ABSTRACT_LAYER_IEVENT_LAUNCH_APPLICATION_H_ */