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>
35 void NormalizeString(DPL::OptionalString& txt);
36 void NormalizeString(DPL::String& str);
37 DPL::String GetSingleAttributeValue(const DPL::String value);
39 class WidgetConfigurationManager;
41 class ConfigParserData
46 Param(const DPL::String& _name) : name(_name)
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;
56 bool operator<=(const Param&) const;
58 typedef std::set<Param> ParamsList;
62 Feature(const DPL::String& _name,
63 bool _required = true) : name(_name),
69 ParamsList paramsList;
71 bool operator==(const Feature&) const;
72 bool operator!=(const Feature&) const;
73 bool operator >(const Feature&) const;
74 bool operator>=(const Feature&) const;
75 bool operator <(const Feature&) const;
76 bool operator<=(const Feature&) const;
78 typedef std::set<Feature> FeaturesList;
82 Privilege(const DPL::String& _name) : name(_name)
87 bool operator==(const Privilege&) const;
88 bool operator!=(const Privilege&) const;
89 bool operator >(const Privilege&) const;
90 bool operator>=(const Privilege&) const;
91 bool operator <(const Privilege&) const;
92 bool operator<=(const Privilege&) const;
94 typedef std::set<Privilege> PrivilegeList;
98 Icon(const DPL::String& _src) : src(_src)
102 DPL::OptionalInt width;
103 DPL::OptionalInt height;
104 bool operator==(const Icon&) const;
105 bool operator!=(const Icon&) const;
106 bool operator >(const Icon&) const;
107 bool operator>=(const Icon&) const;
108 bool operator <(const Icon&) const;
109 bool operator<=(const Icon&) const;
111 typedef std::list<Icon> IconsList;
115 DPL::OptionalString name;
116 DPL::OptionalString shortName;
118 DPL::OptionalString description;
120 DPL::OptionalString license;
121 DPL::OptionalString licenseFile;
122 DPL::OptionalString licenseHref;
124 typedef std::map<DPL::String, LocalizedData> LocalizedDataSet;
128 Preference(const DPL::String& _name,
129 bool _readonly = false) :
136 DPL::OptionalString value;
138 bool operator==(const Preference&) const;
139 bool operator!=(const Preference&) const;
140 bool operator >(const Preference&) const;
141 bool operator>=(const Preference&) const;
142 bool operator <(const Preference&) const;
143 bool operator<=(const Preference&) const;
145 typedef std::set<Preference> PreferencesList;
146 typedef std::set<DPL::String> StringsList;
150 AccessInfo(const DPL::String& strIRI,
151 bool bSubdomainAccess) : m_strIRI(strIRI),
152 m_bSubDomainAccess(bSubdomainAccess)
156 bool operator==(const AccessInfo&) const;
157 bool operator!=(const AccessInfo&) const;
158 bool operator <(const AccessInfo&) const;
160 DPL::String m_strIRI;
161 bool m_bSubDomainAccess;
163 typedef std::set<AccessInfo> AccessInfoSet;
167 Setting(const DPL::String& name,
168 const DPL::String& value) :
176 bool operator==(const Setting&) const;
177 bool operator!=(const Setting&) const;
178 bool operator >(const Setting&) const;
179 bool operator>=(const Setting&) const;
180 bool operator <(const Setting&) const;
181 bool operator<=(const Setting&) const;
184 typedef std::set<Setting> SettingsList;
186 /* ServiceInfo will be removed.
187 * ServiceInfo will be changed AppControl
192 const DPL::String& src,
193 const DPL::String& operation,
194 const DPL::String& scheme,
195 const DPL::String& mime) :
197 m_operation(operation),
203 DPL::String m_operation;
204 DPL::String m_scheme;
207 bool operator==(const ServiceInfo&) const;
208 bool operator!=(const ServiceInfo&) const;
211 struct AppControlInfo
214 const DPL::String& operation) :
215 m_operation(operation)
219 DPL::String m_operation;
220 std::set <DPL::String> m_uriList;
221 std::set <DPL::String> m_mimeList;
223 bool operator==(const AppControlInfo&) const;
224 bool operator!=(const AppControlInfo&) const;
227 typedef std::list<ServiceInfo> ServiceInfoList; // It will be removed.
228 typedef std::list<AppControlInfo> AppControlInfoList;
230 typedef std::list<std::pair<DPL::String, DPL::String>> BoxSizeList;
238 DPL::String m_boxSrc;
239 BoxSizeList m_boxSize ;
241 DPL::String m_pdWidth;
242 DPL::String m_pdHeight;
243 }; typedef BoxContent BoxContentInfo;
247 DPL::String m_liveboxId;
248 DPL::String m_primary;
249 DPL::String m_autoLaunch;
250 DPL::String m_updatePeriod;
251 BoxContentInfo m_boxInfo;
253 bool operator==(const LiveboxInfo&) const;
254 bool operator!=(const LiveboxInfo&) const;
255 bool operator >(const LiveboxInfo&) const;
256 bool operator>=(const LiveboxInfo&) const;
257 bool operator <(const LiveboxInfo&) const;
258 bool operator<=(const LiveboxInfo&) const;
260 typedef std::list<DPL::Optional<LiveboxInfo>> LiveboxList;
261 LiveboxList m_livebox;
263 typedef std::list<DPL::OptionalString> DependsPkgList;
265 typedef std::set<DPL::String> CategoryList;
267 StringsList nameSpaces;
269 LocalizedDataSet localizedDataSet;
271 DPL::OptionalString authorName;
272 DPL::OptionalString authorHref;
273 DPL::OptionalString authorEmail;
275 FeaturesList featuresList;
276 PrivilegeList privilegeList;
278 SettingsList settingsList;
280 DPL::OptionalInt width;
281 DPL::OptionalInt height;
283 DPL::OptionalString widget_id;
284 DPL::OptionalString defaultlocale;
286 PreferencesList preferencesList;
288 DPL::OptionalString version;
289 StringsList windowModes;
291 AccessInfoSet accessInfoSet;
295 DPL::OptionalString minVersionRequired;
300 // Unlocalized data, to be processed by WidgetConfigurationManager
301 bool startFileEncountered;
302 DPL::OptionalString startFile;
303 DPL::OptionalString startFileEncoding;
304 DPL::OptionalString startFileContentType;
307 // tizen id / required platform min version for TIZEN webapp
308 DPL::OptionalString tizenId;
309 DPL::OptionalString tizenMinVersionRequired;
311 //Application service model list
312 ServiceInfoList appServiceList; //It will be removed.
313 AppControlInfoList appControlList;
315 // For link shared directory
316 DependsPkgList dependsPkgList;
318 DPL::OptionalString splashImgSrc;
319 // Background page filename
320 DPL::OptionalString backgroundPage;
322 CategoryList categoryList;
326 minVersionRequired(),
327 backSupported(false),
328 accessNetwork(false),
329 startFileEncountered(false)
336 #endif //CONFIG_PARSER_DATA_H_