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, bool isTrimSpace = false);
36 void NormalizeString(DPL::String& str);
37 DPL::String GetSingleAttributeValue(const DPL::String value);
38 void NormalizeAndTrimSpaceString(DPL::OptionalString& txt);
40 class WidgetConfigurationManager;
42 class ConfigParserData
47 Param(const DPL::String& _name) : name(_name)
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;
57 bool operator<=(const Param&) const;
59 typedef std::set<Param> ParamsList;
63 Feature(const DPL::String& _name,
64 bool _required = true) : name(_name),
70 ParamsList paramsList;
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;
77 bool operator<=(const Feature&) const;
79 typedef std::set<Feature> FeaturesList;
83 Privilege(const DPL::String& _name) : name(_name)
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;
93 bool operator<=(const Privilege&) const;
95 typedef std::set<Privilege> PrivilegeList;
99 Icon(const DPL::String& _src) : src(_src)
103 DPL::OptionalInt width;
104 DPL::OptionalInt height;
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;
110 bool operator<=(const Icon&) const;
112 typedef std::list<Icon> IconsList;
116 DPL::OptionalString name;
117 DPL::OptionalString shortName;
119 DPL::OptionalString description;
121 DPL::OptionalString license;
122 DPL::OptionalString licenseFile;
123 DPL::OptionalString licenseHref;
125 typedef std::map<DPL::String, LocalizedData> LocalizedDataSet;
129 Preference(const DPL::String& _name,
130 bool _readonly = false) :
137 DPL::OptionalString value;
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;
144 bool operator<=(const Preference&) const;
146 typedef std::set<Preference> PreferencesList;
147 typedef std::set<DPL::String> StringsList;
151 AccessInfo(const DPL::String& strIRI,
152 bool bSubdomainAccess) : m_strIRI(strIRI),
153 m_bSubDomainAccess(bSubdomainAccess)
157 bool operator==(const AccessInfo&) const;
158 bool operator!=(const AccessInfo&) const;
159 bool operator <(const AccessInfo&) const;
161 DPL::String m_strIRI;
162 bool m_bSubDomainAccess;
164 typedef std::set<AccessInfo> AccessInfoSet;
168 Setting(const DPL::String& name,
169 const DPL::String& value) :
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;
182 bool operator<=(const Setting&) const;
185 typedef std::set<Setting> SettingsList;
187 /* ServiceInfo will be removed.
188 * ServiceInfo will be changed AppControl
193 const DPL::String& src,
194 const DPL::String& operation,
195 const DPL::String& scheme,
196 const DPL::String& mime) :
198 m_operation(operation),
204 DPL::String m_operation;
205 DPL::String m_scheme;
208 bool operator==(const ServiceInfo&) const;
209 bool operator!=(const ServiceInfo&) const;
212 struct AppControlInfo
215 const DPL::String& operation) :
216 m_operation(operation)
220 DPL::String m_operation;
221 std::set <DPL::String> m_uriList;
222 std::set <DPL::String> m_mimeList;
224 bool operator==(const AppControlInfo&) const;
225 bool operator!=(const AppControlInfo&) const;
228 typedef std::list<ServiceInfo> ServiceInfoList; // It will be removed.
229 typedef std::list<AppControlInfo> AppControlInfoList;
231 typedef std::list<std::pair<DPL::String, DPL::String>> BoxSizeList;
239 DPL::String m_boxSrc;
240 DPL::String m_boxMouseEvent;
241 BoxSizeList m_boxSize;
243 DPL::String m_pdWidth;
244 DPL::String m_pdHeight;
245 }; typedef BoxContent BoxContentInfo;
249 DPL::String m_liveboxId;
250 DPL::String m_primary;
252 DPL::String m_autoLaunch;
253 DPL::String m_updatePeriod;
254 BoxContentInfo m_boxInfo;
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;
261 bool operator<=(const LiveboxInfo&) const;
263 typedef std::list<DPL::Optional<LiveboxInfo>> LiveboxList;
264 LiveboxList m_livebox;
266 typedef std::list<DPL::OptionalString> DependsPkgList;
268 typedef std::set<DPL::String> CategoryList;
270 StringsList nameSpaces;
272 LocalizedDataSet localizedDataSet;
274 DPL::OptionalString authorName;
275 DPL::OptionalString authorHref;
276 DPL::OptionalString authorEmail;
278 FeaturesList featuresList;
279 PrivilegeList privilegeList;
281 SettingsList settingsList;
283 DPL::OptionalInt width;
284 DPL::OptionalInt height;
286 DPL::OptionalString widget_id;
287 DPL::OptionalString defaultlocale;
289 PreferencesList preferencesList;
291 DPL::OptionalString version;
292 StringsList windowModes;
294 AccessInfoSet accessInfoSet;
298 DPL::OptionalString minVersionRequired;
303 // Unlocalized data, to be processed by WidgetConfigurationManager
304 bool startFileEncountered;
305 DPL::OptionalString startFile;
306 DPL::OptionalString startFileEncoding;
307 DPL::OptionalString startFileContentType;
310 // tizen id / required platform min version for TIZEN webapp
311 DPL::OptionalString tizenId;
312 DPL::OptionalString tizenMinVersionRequired;
313 DPL::OptionalString tizenPkgId;
314 DPL::OptionalString tizenAppId;
316 //Application service model list
317 ServiceInfoList appServiceList; //It will be removed.
318 AppControlInfoList appControlList;
320 // For link shared directory
321 DependsPkgList dependsPkgList;
323 DPL::OptionalString splashImgSrc;
324 // Background page filename
325 DPL::OptionalString backgroundPage;
327 CategoryList categoryList;
331 minVersionRequired(),
332 backSupported(false),
333 accessNetwork(false),
334 startFileEncountered(false)
341 #endif //CONFIG_PARSER_DATA_H_