Tizen 2.1 base
[platform/framework/web/wrt-plugins-common.git] / src / 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, DPL::Event::PropertyReadOnly> Handle;
47
48     /**
49        *@brief LibraryName
50      */
51     DPL::Event::Property<std::string,
52                   DPL::Event::PropertyReadOnly,
53                   DPL::Event::PropertyStorageDynamicCached> LibraryName;
54
55     /**
56        *@brief Library Path
57      */
58     DPL::Event::Property<std::string,
59                   DPL::Event::PropertyReadOnly,
60                   DPL::Event::PropertyStorageDynamicCached> LibraryPath;
61
62     /**
63        *@brief Feature set
64      */
65     DPL::Event::Property<WrtDB::FeatureHandleListPtr,
66                   DPL::Event::PropertyReadOnly,
67                   DPL::Event::PropertyStorageDynamicCached> FeatureHandles;
68
69     /**
70        *@brief Librarydepencies
71      */
72     DPL::Event::Property<WrtDB::PluginHandleSetPtr,
73                   DPL::Event::PropertyReadOnly,
74                   DPL::Event::PropertyStorageDynamicCached> LibraryDependencies;
75
76     /**
77        *@brief Library instance Low Level
78      * */
79     DPL::Event::Property<PluginPtr,
80                   DPL::Event::PropertyReadWrite,
81                   DPL::Event::PropertyStorageCached> LibraryInstance;
82
83   public:
84     PluginModel(const WrtDB::DbPluginHandle& handle);
85
86   private:
87     WrtDB::DbPluginHandle getHandle() const;
88 };
89
90 typedef DPL::SharedPtr<PluginModel> PluginModelPtr;
91
92 #endif