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 * This file have been implemented in compliance with W3C WARP SPEC.
18 * but there are some patent issue between W3C WARP SPEC and APPLE.
19 * so if you want to use this file, refer to the README file in root directory
22 * @file widget_parser.h
23 * @author Lukasz Wrzosek (l.wrzosek@samsung.com)
27 #ifndef WIDGET_PARSER_H_
28 #define WIDGET_PARSER_H_
30 #include "element_parser.h"
33 #include <dpl/foreach.h>
34 #include <dpl/wrt-dao-ro/config_parser_data.h>
36 namespace ConfigurationNamespace {
37 static const DPL::String W3CWidgetNamespaceName =
38 L"http://www.w3.org/ns/widgets";
39 static const DPL::String WacWidgetNamespaceNameForLinkElement =
40 L"http://wacapps.net/ns/widgets#";
41 static const DPL::String WacWidgetNamespaceName =
42 L"http://wacapps.net/ns/widgets";
43 static const DPL::String TizenWebAppNamespaceName =
44 L"http://tizen.org/ns/widgets";
47 namespace PluginsPrefix {
48 const char * const W3CPluginsPrefix = "http://www.w3.org/";
49 const char * const WACPluginsPrefix = "http://wacapps.net/api/";
50 const char * const TIZENPluginsPrefix = "http://tizen.org/api/";
64 class WidgetParser : public ElementParser
67 ElementParserPtr OnNameElement();
68 ElementParserPtr OnDescriptionElement();
69 ElementParserPtr OnAuthorElement();
70 ElementParserPtr OnLicenseElement();
71 ElementParserPtr OnIconElement();
72 ElementParserPtr OnContentElement();
73 ElementParserPtr OnPreferenceElement();
74 ElementParserPtr OnAccessElement();
75 ElementParserPtr OnLinkElement();
76 ElementParserPtr OnSettingElement();
77 ElementParserPtr OnApplicationElement();
78 ElementParserPtr OnSplashElement();
79 ElementParserPtr OnBackgroundElement();
80 ElementParserPtr OnPrivilegeElement();
81 ElementParserPtr OnAppControlElement();
82 ElementParserPtr OnCategoryElement();
83 ElementParserPtr OnAppWidgetElement();
84 ElementParserPtr OnCspElement();
85 ElementParserPtr OnCspReportOnlyElement();
86 ElementParserPtr OnAllowNavigationElement();
87 ElementParserPtr OnAccountElement();
88 ElementParserPtr OnMetadataElement();
90 virtual ActionFunc GetElementParser(const DPL::String& ns,
91 const DPL::String& name);
93 virtual void Accept(const Element&);
94 virtual void Accept(const Text&);
95 virtual void Accept(const XmlAttribute&);
96 virtual void Verify();
98 //Typedef used by RootParser
99 typedef WrtDB::ConfigParserData& Data;
105 Unicode::Direction m_textDirection;
107 DPL::Optional<DPL::String> m_version;
108 DPL::Optional<DPL::String> m_minVersion;
109 std::list<DPL::String> m_windowModes;
110 DPL::Optional<DPL::String> m_defaultlocale;
111 std::map<DPL::String, DPL::String> m_nameSpaces;
115 struct ContentParser;
117 #endif // WIDGET_PARSER_H_