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 config_parser_data.h
18 * @author Lukasz Wrzosek (l.wrzosek@samsung.com)
22 #ifndef CONFIG_PARSER_DATA_H_
23 #define CONFIG_PARSER_DATA_H_
29 #include <dpl/optional_typedefs.h>
30 #include <dpl/string.h>
34 void NormalizeString(DPL::OptionalString& txt, bool isTrimSpace = false);
35 void NormalizeString(DPL::String& str);
36 DPL::String GetSingleAttributeValue(const DPL::String value);
37 void NormalizeAndTrimSpaceString(DPL::OptionalString& txt);
39 class WidgetConfigurationManager;
41 class ConfigParserData
46 Feature(const DPL::String& _name) : name(_name)
50 bool operator==(const Feature&) const;
51 bool operator!=(const Feature&) const;
52 bool operator >(const Feature&) const;
53 bool operator>=(const Feature&) const;
54 bool operator <(const Feature&) const;
55 bool operator<=(const Feature&) const;
57 typedef std::set<Feature> FeaturesList;
61 Privilege(const DPL::String& _name) : name(_name)
65 bool operator==(const Privilege&) const;
66 bool operator!=(const Privilege&) const;
67 bool operator >(const Privilege&) const;
68 bool operator>=(const Privilege&) const;
69 bool operator <(const Privilege&) const;
70 bool operator<=(const Privilege&) const;
72 typedef std::set<Privilege> PrivilegeList;
76 Icon(const DPL::String& _src) : src(_src)
79 DPL::OptionalInt width;
80 DPL::OptionalInt height;
81 bool operator==(const Icon&) const;
82 bool operator!=(const Icon&) const;
83 bool operator >(const Icon&) const;
84 bool operator>=(const Icon&) const;
85 bool operator <(const Icon&) const;
86 bool operator<=(const Icon&) const;
88 typedef std::list<Icon> IconsList;
92 DPL::OptionalString name;
93 DPL::OptionalString shortName;
95 DPL::OptionalString description;
97 DPL::OptionalString license;
98 DPL::OptionalString licenseFile;
99 DPL::OptionalString licenseHref;
101 typedef std::map<DPL::String, LocalizedData> LocalizedDataSet;
105 Preference(const DPL::String& _name,
106 bool _readonly = false) :
112 DPL::OptionalString value;
114 bool operator==(const Preference&) const;
115 bool operator!=(const Preference&) const;
116 bool operator >(const Preference&) const;
117 bool operator>=(const Preference&) const;
118 bool operator <(const Preference&) const;
119 bool operator<=(const Preference&) const;
121 typedef std::set<Preference> PreferencesList;
122 typedef std::set<DPL::String> StringsList;
126 AccessInfo(const DPL::String& strIRI,
127 bool bSubdomainAccess) : m_strIRI(strIRI),
128 m_bSubDomainAccess(bSubdomainAccess)
131 bool operator==(const AccessInfo&) const;
132 bool operator!=(const AccessInfo&) const;
133 bool operator <(const AccessInfo&) const;
135 DPL::String m_strIRI;
136 bool m_bSubDomainAccess;
138 typedef std::set<AccessInfo> AccessInfoSet;
142 Setting(const DPL::String& name,
143 const DPL::String& value) :
150 bool operator==(const Setting&) const;
151 bool operator!=(const Setting&) const;
152 bool operator >(const Setting&) const;
153 bool operator>=(const Setting&) const;
154 bool operator <(const Setting&) const;
155 bool operator<=(const Setting&) const;
158 typedef std::set<Setting> SettingsList;
160 struct AppControlInfo
162 enum class Disposition {
166 AppControlInfo(const DPL::String& operation) :
167 m_operation(operation),
171 DPL::String m_operation;
172 std::set <DPL::String> m_uriList;
173 std::set <DPL::String> m_mimeList;
174 Disposition m_disposition;
177 bool operator==(const AppControlInfo&) const;
178 bool operator!=(const AppControlInfo&) const;
181 typedef std::list<AppControlInfo> AppControlInfoList;
183 typedef std::list<std::pair<DPL::String, DPL::String> > BoxSizeList;
191 DPL::String m_boxSrc;
192 DPL::String m_boxMouseEvent;
193 DPL::String m_boxTouchEffect;
194 BoxSizeList m_boxSize;
196 DPL::String m_pdWidth;
197 DPL::String m_pdHeight;
199 typedef BoxContent BoxContentInfo;
203 DPL::String m_liveboxId;
204 DPL::String m_primary;
206 DPL::String m_autoLaunch;
207 DPL::String m_updatePeriod;
208 BoxContentInfo m_boxInfo;
210 bool operator==(const LiveboxInfo&) const;
211 bool operator!=(const LiveboxInfo&) const;
212 bool operator >(const LiveboxInfo&) const;
213 bool operator>=(const LiveboxInfo&) const;
214 bool operator <(const LiveboxInfo&) const;
215 bool operator<=(const LiveboxInfo&) const;
217 typedef std::list<DPL::Optional<LiveboxInfo> > LiveboxList;
225 typedef std::set<std::pair<IconSectionType, DPL::String>> IconSet;
226 typedef std::list<DPL::String> CapabilityList;
227 typedef std::set<std::pair<DPL::String, DPL::String>> DisplayNameSet;
229 struct AccountProvider
232 m_multiAccountSupport(false)
235 bool m_multiAccountSupport;
237 DisplayNameSet m_displayNameSet;
238 CapabilityList m_capabilityList;
241 LiveboxList m_livebox;
243 typedef std::list<DPL::OptionalString> DependsPkgList;
245 typedef std::set<DPL::String> CategoryList;
247 StringsList nameSpaces;
249 LocalizedDataSet localizedDataSet;
251 DPL::OptionalString authorName;
252 DPL::OptionalString authorHref;
253 DPL::OptionalString authorEmail;
255 FeaturesList featuresList;
256 PrivilegeList privilegeList;
258 SettingsList settingsList;
260 DPL::OptionalInt width;
261 DPL::OptionalInt height;
263 DPL::OptionalString widget_id;
264 DPL::OptionalString defaultlocale;
266 PreferencesList preferencesList;
268 DPL::OptionalString version;
269 StringsList windowModes;
271 AccessInfoSet accessInfoSet;
275 DPL::OptionalString minVersionRequired;
280 // Unlocalized data, to be processed by WidgetConfigurationManager
281 bool startFileEncountered;
282 DPL::OptionalString startFile;
283 DPL::OptionalString startFileEncoding;
284 DPL::OptionalString startFileContentType;
287 // tizen id / required platform min version for TIZEN webapp
288 DPL::OptionalString tizenMinVersionRequired;
289 DPL::OptionalString tizenPkgId;
290 DPL::OptionalString tizenAppId;
292 //csp polic for widget
293 DPL::OptionalString cspPolicy;
294 DPL::OptionalString cspPolicyReportOnly;
296 //AppControl model list
297 AppControlInfoList appControlList;
299 // For link shared directory
300 DependsPkgList dependsPkgList;
302 DPL::OptionalString splashImgSrc;
303 // Background page filename
304 DPL::OptionalString backgroundPage;
306 CategoryList categoryList;
308 AccountProvider accountProvider;
312 minVersionRequired(),
313 backSupported(false),
314 accessNetwork(false),
315 startFileEncountered(false)
320 #endif //CONFIG_PARSER_DATA_H_