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
185 const DPL::String& src,
186 const DPL::String& operation,
187 const DPL::String& scheme,
188 const DPL::String& mime) :
190 m_operation(operation),
195 DPL::String m_operation;
196 DPL::String m_scheme;
199 bool operator==(const ServiceInfo&) const;
200 bool operator!=(const ServiceInfo&) const;
203 struct AppControlInfo
206 const DPL::String& operation) :
207 m_operation(operation)
210 DPL::String m_operation;
211 std::set <DPL::String> m_uriList;
212 std::set <DPL::String> m_mimeList;
214 bool operator==(const AppControlInfo&) const;
215 bool operator!=(const AppControlInfo&) const;
218 typedef std::list<ServiceInfo> ServiceInfoList; // It will be removed.
219 typedef std::list<AppControlInfo> AppControlInfoList;
221 typedef std::list<std::pair<DPL::String, DPL::String> > BoxSizeList;
229 DPL::String m_boxSrc;
230 DPL::String m_boxMouseEvent;
231 BoxSizeList m_boxSize;
233 DPL::String m_pdWidth;
234 DPL::String m_pdHeight;
236 typedef BoxContent BoxContentInfo;
240 DPL::String m_liveboxId;
241 DPL::String m_primary;
243 DPL::String m_autoLaunch;
244 DPL::String m_updatePeriod;
245 BoxContentInfo m_boxInfo;
247 bool operator==(const LiveboxInfo&) const;
248 bool operator!=(const LiveboxInfo&) const;
249 bool operator >(const LiveboxInfo&) const;
250 bool operator>=(const LiveboxInfo&) const;
251 bool operator <(const LiveboxInfo&) const;
252 bool operator<=(const LiveboxInfo&) const;
254 typedef std::list<DPL::Optional<LiveboxInfo> > LiveboxList;
255 LiveboxList m_livebox;
257 typedef std::list<DPL::OptionalString> DependsPkgList;
259 typedef std::set<DPL::String> CategoryList;
261 StringsList nameSpaces;
263 LocalizedDataSet localizedDataSet;
265 DPL::OptionalString authorName;
266 DPL::OptionalString authorHref;
267 DPL::OptionalString authorEmail;
269 FeaturesList featuresList;
270 PrivilegeList privilegeList;
272 SettingsList settingsList;
274 DPL::OptionalInt width;
275 DPL::OptionalInt height;
277 DPL::OptionalString widget_id;
278 DPL::OptionalString defaultlocale;
280 PreferencesList preferencesList;
282 DPL::OptionalString version;
283 StringsList windowModes;
285 AccessInfoSet accessInfoSet;
289 DPL::OptionalString minVersionRequired;
294 // Unlocalized data, to be processed by WidgetConfigurationManager
295 bool startFileEncountered;
296 DPL::OptionalString startFile;
297 DPL::OptionalString startFileEncoding;
298 DPL::OptionalString startFileContentType;
301 // tizen id / required platform min version for TIZEN webapp
302 DPL::OptionalString tizenId;
303 DPL::OptionalString tizenMinVersionRequired;
304 DPL::OptionalString tizenPkgId;
305 DPL::OptionalString tizenAppId;
307 //csp polic for widget
308 DPL::OptionalString cspPolicy;
310 //Application service model list
311 ServiceInfoList appServiceList; //It will be removed.
312 AppControlInfoList appControlList;
314 // For link shared directory
315 DependsPkgList dependsPkgList;
317 DPL::OptionalString splashImgSrc;
318 // Background page filename
319 DPL::OptionalString backgroundPage;
321 CategoryList categoryList;
325 minVersionRequired(),
326 backSupported(false),
327 accessNetwork(false),
328 startFileEncountered(false)
333 #endif //CONFIG_PARSER_DATA_H_