2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file plugin_container_support.h
18 * @author Grzegorz Krawczyk (g.krawczyk@samsung.com)
21 #ifndef PLUGIN_CONTAINER_SUPPORT_H
22 #define PLUGIN_CONTAINER_SUPPORT_H
28 #include <dpl/wrt-dao-ro/feature_dao_read_only.h>
29 #include <dpl/wrt-dao-ro/feature_model.h>
31 #include "plugin_model.h"
33 class PluginContainerSupport
36 typedef std::list<WrtDB::FeatureModelPtr> FeaturesList;
37 typedef std::list<PluginModelPtr> PluginsList;
41 typedef std::list<std::string> StandardFeatureList;
43 // Main feature list. Always equal to DB feature list
44 typedef std::set<WrtDB::FeatureModelPtr> FeatureModelContainer;
46 // Main plugin list. Always equal to DB plugin list
47 typedef std::set<PluginModelPtr> PluginModelsContainer;
49 WrtDB::PluginHandleList m_rootPluginsList;
51 PluginModelsContainer m_pluginModels;
53 FeatureModelContainer m_featureModels;
61 void readRootPluginsList();
64 typedef std::multimap<WrtDB::FeatureHandle, std::string> DeviceCapList;
65 void registerFeatureModel(WrtDB::FeatureHandle handle,
66 WrtDB::FeatureData* data,
67 DeviceCapList deviceCapabilities);
69 WrtDB::FeatureModelPtr getFeatureModel(const std::string &name) const;
70 WrtDB::FeatureModelPtr getFeatureModel(WrtDB::FeatureHandle handle) const;
72 PluginModelPtr getPluginModel(const WrtDB::FeatureModelPtr &feature) const;
75 PluginContainerSupport();
81 bool isInitialized(int widgetHandle)
83 return (m_initialized && m_widgetHandle == widgetHandle);
85 void Initialize(int widgetHandle);
86 void registerPluginModel(WrtDB::DbPluginHandle handle);
87 std::list<std::string> getAllowedFeatures(int widgetHandle) const;
88 void readAllowedPlugins(int widgetHandle);
89 void readRootPlugins(int widgetHandle);
90 PluginsList getRootPlugins() const;
91 PluginsList getPluginsList() const;
93 PluginModelPtr getPluginForFeature(const std::string& featureName);
95 PluginModelPtr getPluginModelById(WrtDB::DbPluginHandle handle) const;
97 ~PluginContainerSupport();
100 typedef std::shared_ptr<PluginContainerSupport> PluginContainerSupportPtr;
102 #endif // PLUGIN_CONTAINER_SUPPORT_H