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 OnFeatureElement();
74 ElementParserPtr OnPreferenceElement();
75 ElementParserPtr OnAccessElement();
76 ElementParserPtr OnLinkElement();
77 ElementParserPtr OnSettingElement();
78 ElementParserPtr OnApplicationElement();
79 ElementParserPtr OnSplashElement();
80 ElementParserPtr OnBackgroundElement();
81 ElementParserPtr OnPrivilegeElement();
82 ElementParserPtr OnAppControlElement();
83 ElementParserPtr OnCategoryElement();
84 ElementParserPtr OnLiveboxElement();
86 virtual ActionFunc GetElementParser(const DPL::String& ns,
87 const DPL::String& name);
89 virtual void Accept(const Element&);
90 virtual void Accept(const Text&);
91 virtual void Accept(const XmlAttribute&);
92 virtual void Verify();
94 //Typedef used by RootParser
95 typedef WrtDB::ConfigParserData& Data;
101 Unicode::Direction m_textDirection;
103 DPL::Optional<DPL::String> m_version;
104 DPL::Optional<DPL::String> m_minVersion;
105 std::list<DPL::String> m_windowModes;
106 DPL::Optional<DPL::String> m_defaultlocale;
107 std::map<DPL::String, DPL::String> m_nameSpaces;
111 struct ContentParser;
113 #endif // WIDGET_PARSER_H_