tizen beta release
[framework/web/wrt-plugins-common.git] / src / modules / API / DEPRACATED / AppLauncher / EventGetInstalledApplications.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        IEventGetInstalledApplications.h
18  * @author      Lukasz Marek (l.marek@samsung.com)
19  * @version     0.1
20  * @brief
21  */
22
23 #ifndef _ABSTRACT_LAYER_EVENT_GET_INSTALLED_APPLICATIONS_H_
24 #define _ABSTRACT_LAYER_EVENT_GET_INSTALLED_APPLICATIONS_H_
25
26 #include <string>
27 #include <vector>
28 #include <map>
29 #include <dpl/shared_ptr.h>
30 #include <commons/IEvent.h>
31 #include <commons/EventReceiver.h>
32 #include "ApplicationTypes.h"
33
34 namespace WrtPlugins {
35 namespace Api {
36 namespace AppLauncher {
37 /* This event is sent when list of installed applications is get */
38 class EventGetInstalledApplications : public WrtPlugins::Platform::IEvent<
39         EventGetInstalledApplications>
40 {
41     std::vector<std::string> m_applicationFullPaths;
42     std::vector<std::string> m_applicationNames;
43     std::map<ApplicationType, std::string> m_applicationTypesPath;
44     std::map<ApplicationType, std::string> m_applicationTypesName;
45   public:
46     void addApplicationTypeByName(const std::pair<ApplicationType,
47                                                   std::string> &value)
48     {
49         m_applicationTypesName.insert(value);
50     }
51     const std::map<ApplicationType,
52                    std::string> &getApplicationTypesByName() const
53     {
54         return m_applicationTypesName;
55     }
56     void addApplicationTypeByPath(const std::pair<ApplicationType,
57                                                   std::string> &value)
58     {
59         m_applicationTypesPath.insert(value);
60     }
61     const std::map<ApplicationType,
62                    std::string> &getApplicationTypesByPath() const
63     {
64         return m_applicationTypesPath;
65     }
66     void addApplicationFullPath(const std::string &value)
67     {
68         m_applicationFullPaths.push_back(value);
69     }
70     const std::vector<std::string> &getApplicationFullPaths() const
71     {
72         return m_applicationFullPaths;
73     }
74     void addApplicationName(const std::string &value)
75     {
76         m_applicationNames.push_back(value);
77     }
78     const std::vector<std::string> &getApplicationNames() const
79     {
80         return m_applicationNames;
81     }
82     virtual void clearOnCancel()
83     {
84     }
85     EventGetInstalledApplications()
86     {
87     }
88 };
89
90 typedef DPL::SharedPtr<EventGetInstalledApplications>
91 EventGetInstalledApplicationsPtr;
92 }
93 }
94 }
95
96 #endif /* _ABSTRACT_LAYER_IEVENT_GET_INSTALLED_APPLICATIONS_H_ */