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 Param(const DPL::String& _name) : name(_name)
50 bool operator==(const Param&) const;
51 bool operator!=(const Param&) const;
52 bool operator >(const Param&) const;
53 bool operator>=(const Param&) const;
54 bool operator <(const Param&) const;
55 bool operator<=(const Param&) const;
57 typedef std::set<Param> ParamsList;
61 Feature(const DPL::String& _name,
62 bool _required = true) : name(_name),
67 ParamsList paramsList;
69 bool operator==(const Feature&) const;
70 bool operator!=(const Feature&) const;
71 bool operator >(const Feature&) const;
72 bool operator>=(const Feature&) const;
73 bool operator <(const Feature&) const;
74 bool operator<=(const Feature&) const;
76 typedef std::set<Feature> FeaturesList;
80 Privilege(const DPL::String& _name) : name(_name)
84 bool operator==(const Privilege&) const;
85 bool operator!=(const Privilege&) const;
86 bool operator >(const Privilege&) const;
87 bool operator>=(const Privilege&) const;
88 bool operator <(const Privilege&) const;
89 bool operator<=(const Privilege&) const;
91 typedef std::set<Privilege> PrivilegeList;
95 Icon(const DPL::String& _src) : src(_src)
98 DPL::OptionalInt width;
99 DPL::OptionalInt height;
100 bool operator==(const Icon&) const;
101 bool operator!=(const Icon&) const;
102 bool operator >(const Icon&) const;
103 bool operator>=(const Icon&) const;
104 bool operator <(const Icon&) const;
105 bool operator<=(const Icon&) const;
107 typedef std::list<Icon> IconsList;
111 DPL::OptionalString name;
112 DPL::OptionalString shortName;
114 DPL::OptionalString description;
116 DPL::OptionalString license;
117 DPL::OptionalString licenseFile;
118 DPL::OptionalString licenseHref;
120 typedef std::map<DPL::String, LocalizedData> LocalizedDataSet;
124 Preference(const DPL::String& _name,
125 bool _readonly = false) :
131 DPL::OptionalString value;
133 bool operator==(const Preference&) const;
134 bool operator!=(const Preference&) const;
135 bool operator >(const Preference&) const;
136 bool operator>=(const Preference&) const;
137 bool operator <(const Preference&) const;
138 bool operator<=(const Preference&) const;
140 typedef std::set<Preference> PreferencesList;
141 typedef std::set<DPL::String> StringsList;
145 AccessInfo(const DPL::String& strIRI,
146 bool bSubdomainAccess) : m_strIRI(strIRI),
147 m_bSubDomainAccess(bSubdomainAccess)
150 bool operator==(const AccessInfo&) const;
151 bool operator!=(const AccessInfo&) const;
152 bool operator <(const AccessInfo&) const;
154 DPL::String m_strIRI;
155 bool m_bSubDomainAccess;
157 typedef std::set<AccessInfo> AccessInfoSet;
161 Setting(const DPL::String& name,
162 const DPL::String& value) :
169 bool operator==(const Setting&) const;
170 bool operator!=(const Setting&) const;
171 bool operator >(const Setting&) const;
172 bool operator>=(const Setting&) const;
173 bool operator <(const Setting&) const;
174 bool operator<=(const Setting&) const;
177 typedef std::set<Setting> SettingsList;
179 /* ServiceInfo will be removed.
180 * ServiceInfo will be changed AppControl
184 enum class Disposition {
189 const DPL::String& src,
190 const DPL::String& operation,
191 const DPL::String& scheme,
192 const DPL::String& mime,
193 const Disposition dispos) :
195 m_operation(operation),
198 m_disposition(dispos)
201 DPL::String m_operation;
202 DPL::String m_scheme;
204 Disposition m_disposition;
206 bool operator==(const ServiceInfo&) const;
207 bool operator!=(const ServiceInfo&) const;
210 struct AppControlInfo
213 const DPL::String& operation) :
214 m_operation(operation)
217 DPL::String m_operation;
218 std::set <DPL::String> m_uriList;
219 std::set <DPL::String> m_mimeList;
221 bool operator==(const AppControlInfo&) const;
222 bool operator!=(const AppControlInfo&) const;
225 typedef std::list<ServiceInfo> ServiceInfoList; // It will be removed.
226 typedef std::list<AppControlInfo> AppControlInfoList;
228 typedef std::list<std::pair<DPL::String, DPL::String> > BoxSizeList;
236 DPL::String m_boxSrc;
237 DPL::String m_boxMouseEvent;
238 DPL::String m_boxTouchEffect;
239 BoxSizeList m_boxSize;
241 DPL::String m_pdWidth;
242 DPL::String m_pdHeight;
244 typedef BoxContent BoxContentInfo;
248 DPL::String m_liveboxId;
249 DPL::String m_primary;
251 DPL::String m_autoLaunch;
252 DPL::String m_updatePeriod;
253 BoxContentInfo m_boxInfo;
255 bool operator==(const LiveboxInfo&) const;
256 bool operator!=(const LiveboxInfo&) const;
257 bool operator >(const LiveboxInfo&) const;
258 bool operator>=(const LiveboxInfo&) const;
259 bool operator <(const LiveboxInfo&) const;
260 bool operator<=(const LiveboxInfo&) const;
262 typedef std::list<DPL::Optional<LiveboxInfo> > LiveboxList;
270 typedef std::set<std::pair<IconSectionType, DPL::String>> IconSet;
271 typedef std::list<DPL::String> CapabilityList;
272 typedef std::set<std::pair<DPL::String, DPL::String>> DisplayNameSet;
274 struct AccountProvider
277 m_multiAccountSupport(false)
280 bool m_multiAccountSupport;
282 DisplayNameSet m_displayNameSet;
283 CapabilityList m_capabilityList;
286 LiveboxList m_livebox;
288 typedef std::list<DPL::OptionalString> DependsPkgList;
290 typedef std::set<DPL::String> CategoryList;
292 StringsList nameSpaces;
294 LocalizedDataSet localizedDataSet;
296 DPL::OptionalString authorName;
297 DPL::OptionalString authorHref;
298 DPL::OptionalString authorEmail;
300 FeaturesList featuresList;
301 PrivilegeList privilegeList;
303 SettingsList settingsList;
305 DPL::OptionalInt width;
306 DPL::OptionalInt height;
308 DPL::OptionalString widget_id;
309 DPL::OptionalString defaultlocale;
311 PreferencesList preferencesList;
313 DPL::OptionalString version;
314 StringsList windowModes;
316 AccessInfoSet accessInfoSet;
320 DPL::OptionalString minVersionRequired;
325 // Unlocalized data, to be processed by WidgetConfigurationManager
326 bool startFileEncountered;
327 DPL::OptionalString startFile;
328 DPL::OptionalString startFileEncoding;
329 DPL::OptionalString startFileContentType;
332 // tizen id / required platform min version for TIZEN webapp
333 DPL::OptionalString tizenMinVersionRequired;
334 DPL::OptionalString tizenPkgId;
335 DPL::OptionalString tizenAppId;
337 //csp polic for widget
338 DPL::OptionalString cspPolicy;
339 DPL::OptionalString cspPolicyReportOnly;
341 //Application service model list
342 ServiceInfoList appServiceList; //It will be removed.
343 AppControlInfoList appControlList;
345 // For link shared directory
346 DependsPkgList dependsPkgList;
348 DPL::OptionalString splashImgSrc;
349 // Background page filename
350 DPL::OptionalString backgroundPage;
352 CategoryList categoryList;
354 AccountProvider accountProvider;
358 minVersionRequired(),
359 backSupported(false),
360 accessNetwork(false),
361 startFileEncountered(false)
366 #endif //CONFIG_PARSER_DATA_H_