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 * @author Tomasz Swierczek (t.swierczek@samsung.com)
19 * @brief ACE DAO read only mockup class
22 #ifndef WRT_MOCKUPS_ACE_DAO_READ_ONLY_MOCK_H_
23 #define WRT_MOCKUPS_ACE_DAO_READ_ONLY_MOCK_H_
29 #include <openssl/md5.h>
30 #include <dpl/exception.h>
31 #include <dpl/string.h>
33 #include <PreferenceTypes.h>
34 #include <BaseAttribute.h>
35 #include <BasePermission.h>
37 #include <PolicyEffect.h>
38 #include <PolicyResult.h>
39 #include <PromptDecision.h>
40 #include <dpl/foreach.h>
44 typedef std::map<DPL::String, bool> RequestedDevCapsMap;
45 typedef DPL::String FeatureName;
46 typedef std::vector<FeatureName> FeatureNameVector;
54 DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
55 DECLARE_EXCEPTION_TYPE(Base, DatabaseError)
60 static void attachToThreadRO(){};
61 static void attachToThreadRW(){};
62 static void detachFromThread(){};
64 // policy effect/decision
65 static OptionalExtendedPolicyResult getPolicyResult(
66 const BaseAttributeSet &/*attributes*/)
68 return m_policyResult;
72 static OptionalCachedPromptDecision getPromptDecision(
73 WidgetHandle /*widgetHandle*/,
76 return m_promptDecision;
80 static PreferenceTypes getDevCapSetting(const std::string &/*resource*/)
82 return m_devCapSetting;
84 static void getDevCapSettings(PreferenceTypesMap *preferences)
86 *preferences = m_devCapSettings;
90 static void getWidgetDevCapSettings(BasePermissionList *permissions)
92 *permissions = m_widgetDevCapSettings;
95 static PreferenceTypes getWidgetDevCapSetting(
96 const std::string &/*resource*/,
97 WidgetHandle /*handler*/)
99 return m_widgetDevCapSetting;
102 static void getAttributes(BaseAttributeSet *attributes)
104 *attributes = m_attributeSet;
107 static void getRequestedDevCaps(
108 int /*widgetHandle*/,
109 RequestedDevCapsMap *permissions)
111 *permissions = m_devCapPermissions;
114 // Setting return values for mockups
115 static void setPolicyResult(OptionalExtendedPolicyResult value)
117 m_policyResult = value;
120 static void setPromptDecision(OptionalCachedPromptDecision value)
122 m_promptDecision = value;
125 static void setDevCapSetting(PreferenceTypes value)
127 m_devCapSetting = value;
130 static void setWidgetDevCapSetting(PreferenceTypes value)
132 m_widgetDevCapSetting = value;
135 static void setWidgetDevCapSettings(BasePermissionList value)
137 m_widgetDevCapSettings = value;
140 static void setDevCapSettings(PreferenceTypesMap value)
142 m_devCapSettings = value;
145 static void setAttributeSet(BaseAttributeSet value)
147 m_attributeSet = value;
150 static void setDevCapPermissions(RequestedDevCapsMap value)
152 m_devCapPermissions = value;
155 static void getAcceptedFeature(
156 WidgetHandle /* widgetHandle */,
157 FeatureNameVector *featureVector)
159 *featureVector = m_featureName;
162 static void setAcceptedFeature(const FeatureNameVector &fvector)
164 m_featureName = fvector;
167 static std::string getGUID(const WidgetHandle& handle)
173 static OptionalExtendedPolicyResult m_policyResult;
174 static OptionalCachedPromptDecision m_promptDecision;
175 static PreferenceTypes m_devCapSetting;
176 static PreferenceTypes m_widgetDevCapSetting;
177 static PreferenceTypesMap m_devCapSettings;
178 static BaseAttributeSet m_attributeSet;
179 static BasePermissionList m_widgetDevCapSettings;
180 static RequestedDevCapsMap m_devCapPermissions;
181 static FeatureNameVector m_featureName;
182 static std::string m_guid;
187 #endif // WRT_MOCKUPS_ACE_DAO_READ_ONLY_MOCK_H_