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 #ifndef SRC_INSTALLER_MISC_FEATURE_LOGIC
18 #define SRC_INSTALLER_MISC_FEATURE_LOGIC
23 #include <dpl/assert.h>
24 #include <dpl/noncopyable.h>
27 #include <dpl/wrt-dao-ro/global_dao_read_only.h>
28 #include <wrt_common_types.h>
31 namespace WidgetInstall {
32 class FeatureLogic : DPL::Noncopyable
36 FeatureLogic(const WrtDB::TizenAppId & tzAppid);
42 void setAceResponse(bool allowed);
44 DPL::String getDevice() const;
46 bool isRejected(void) const
51 struct Feature : public WidgetFeature {
52 WrtDB::DeviceCapabilitySet devCapSet;
53 WrtDB::DeviceCapabilitySet::const_iterator currentCap;
55 Feature(const WidgetFeature &wf,
56 const WrtDB::DeviceCapabilitySet &set) :
60 currentCap = devCapSet.begin();
63 explicit Feature(const Feature &second) : WidgetFeature(second)
65 devCapSet = second.devCapSet;
66 currentCap = devCapSet.find(*second.currentCap);
67 rejected = second.rejected;
71 void operator=(const Feature &second)
74 devCapSet = second.devCapSet;
75 required = second.required;
76 rejected = second.rejected;
77 pluginId = second.pluginId;
78 params = second.params;
79 currentCap = devCapSet.find(*second.currentCap);
83 typedef std::list<Feature> FeatureList;
84 typedef FeatureList::const_iterator FeatureIterator;
86 FeatureIterator resultBegin()
88 return m_featureList.begin();
90 FeatureIterator resultEnd()
92 return m_featureList.end();
96 bool isProcessable() const;
98 FeatureList m_featureList;
99 FeatureList::iterator m_currentFeature;
103 typedef std::shared_ptr<FeatureLogic> FeatureLogicPtr;
104 } // namespace WidgetInstall
107 #endif // SRC_INSTALLER_MISC_FEATURE_LOGIC