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 Icon(const DPL::String& src) : src(src)
86 DPL::OptionalInt width;
87 DPL::OptionalInt height;
88 bool operator==(const Icon&) const;
89 bool operator!=(const Icon&) const;
90 bool operator >(const Icon&) const;
91 bool operator>=(const Icon&) const;
92 bool operator <(const Icon&) const;
93 bool operator<=(const Icon&) const;
95 typedef std::list<Icon> IconsList;
99 DPL::OptionalString name;
100 DPL::OptionalString shortName;
102 DPL::OptionalString description;
104 DPL::OptionalString license;
105 DPL::OptionalString licenseFile;
106 DPL::OptionalString licenseHref;
108 typedef std::map<DPL::String, LocalizedData> LocalizedDataSet;
112 Preference(const DPL::String& name,
113 bool readonly = false) :
120 DPL::OptionalString value;
122 bool operator==(const Preference&) const;
123 bool operator!=(const Preference&) const;
124 bool operator >(const Preference&) const;
125 bool operator>=(const Preference&) const;
126 bool operator <(const Preference&) const;
127 bool operator<=(const Preference&) const;
129 typedef std::set<Preference> PreferencesList;
130 typedef std::set<DPL::String> StringsList;
134 AccessInfo(const DPL::String& strIRI,
135 bool bSubdomainAccess) : m_strIRI(strIRI),
136 m_bSubDomainAccess(bSubdomainAccess)
140 bool operator==(const AccessInfo&) const;
141 bool operator!=(const AccessInfo&) const;
142 bool operator <(const AccessInfo&) const;
144 DPL::String m_strIRI;
145 bool m_bSubDomainAccess;
147 typedef std::set<AccessInfo> AccessInfoSet;
151 Setting(const DPL::String& name,
152 const DPL::String& value) :
160 bool operator==(const Setting&) const;
161 bool operator!=(const Setting&) const;
162 bool operator >(const Setting&) const;
163 bool operator>=(const Setting&) const;
164 bool operator <(const Setting&) const;
165 bool operator<=(const Setting&) const;
168 typedef std::set<Setting> SettingsList;
173 const DPL::String& src,
174 const DPL::String& operation,
175 const DPL::String& scheme,
176 const DPL::String& mime) :
178 m_operation(operation),
184 DPL::String m_operation;
185 DPL::String m_scheme;
188 bool operator==(const ServiceInfo&) const;
189 bool operator!=(const ServiceInfo&) const;
191 typedef std::list<ServiceInfo> ServiceInfoList;
193 StringsList nameSpaces;
195 LocalizedDataSet localizedDataSet;
197 DPL::OptionalString authorName;
198 DPL::OptionalString authorHref;
199 DPL::OptionalString authorEmail;
201 FeaturesList featuresList;
203 SettingsList settingsList;
205 DPL::OptionalInt width;
206 DPL::OptionalInt height;
208 DPL::OptionalString widget_id;
209 DPL::OptionalString defaultlocale;
211 PreferencesList preferencesList;
213 DPL::OptionalString version;
214 StringsList windowModes;
216 AccessInfoSet accessInfoSet;
220 DPL::OptionalFloat minVersionRequired;
221 DPL::OptionalInt minVersionRequiredFound;
222 StringsList powderDescriptionLinks;
227 // Unlocalized data, to be processed by WidgetConfigurationManager
228 bool startFileEncountered;
229 DPL::OptionalString startFile;
230 DPL::OptionalString startFileEncoding;
231 DPL::OptionalString startFileContentType;
234 // pakcage name determined by operator for TIZEN webapp
235 DPL::OptionalString pkgname;
236 //Application service model list
237 ServiceInfoList appServiceList;
241 minVersionRequired(1.0),
242 minVersionRequiredFound(),
243 backSupported(false),
244 accessNetwork(false),
245 startFileEncountered(false)
252 #endif //CONFIG_PARSER_DATA_H_