Initialize Tizen 2.3
[framework/web/wrt-plugins-common.git] / src_wearable / plugin-loading / plugin_model.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    plugin_model.h
18  * @author  Pawel Sikorski (p.sikorski@samgsung.com)
19  * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
20  * @version
21  * @brief   This file contains PluginModel, PluginHandle definitions.
22  */
23
24 #ifndef WRT_SRC_PLUGIN_SERVICE_PLUGIN_MODEL_H_
25 #define WRT_SRC_PLUGIN_SERVICE_PLUGIN_MODEL_H_
26
27 #include <string>
28 #include <list>
29 #include <dpl/shared_ptr.h>
30 #include <dpl/event/model.h>
31 #include <dpl/event/property.h>
32
33 #include <dpl/wrt-dao-ro/feature_model.h>
34 #include <dpl/wrt-dao-ro/plugin_dao_read_only.h>
35 #include <plugin.h>
36
37 class PluginModel;
38
39 class PluginModel : public DPL::Event::Model
40 {
41   public:
42
43     /**
44      * *@brief Plugin handle
45      */
46     DPL::Event::Property<WrtDB::DbPluginHandle,
47                          DPL::Event::PropertyReadOnly> Handle;
48
49     /**
50      * *@brief LibraryName
51      */
52     DPL::Event::Property<std::string,
53                          DPL::Event::PropertyReadOnly,
54                          DPL::Event::PropertyStorageDynamicCached> LibraryName;
55
56     /**
57      * *@brief Library Path
58      */
59     DPL::Event::Property<std::string,
60                          DPL::Event::PropertyReadOnly,
61                          DPL::Event::PropertyStorageDynamicCached> LibraryPath;
62
63     /**
64      * *@brief Feature set
65      */
66     DPL::Event::Property<WrtDB::FeatureHandleListPtr,
67                          DPL::Event::PropertyReadOnly,
68                          DPL::Event::PropertyStorageDynamicCached>
69     FeatureHandles;
70
71     /**
72      * *@brief Librarydepencies
73      */
74     DPL::Event::Property<WrtDB::PluginHandleSetPtr,
75                          DPL::Event::PropertyReadOnly,
76                          DPL::Event::PropertyStorageDynamicCached>
77     LibraryDependencies;
78
79     /**
80      * *@brief Library instance Low Level
81      * */
82     DPL::Event::Property<PluginPtr,
83                          DPL::Event::PropertyReadWrite,
84                          DPL::Event::PropertyStorageCached> LibraryInstance;
85
86   public:
87     PluginModel(const WrtDB::DbPluginHandle& handle);
88
89   private:
90     WrtDB::DbPluginHandle getHandle() const;
91 };
92
93 typedef DPL::SharedPtr<PluginModel> PluginModelPtr;
94
95 #endif