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 JilWidgetNamespaceName =
40 L"http://www.jil.org/ns/widgets1.2";
41 static const DPL::String WacWidgetNamespaceNameForLinkElement =
42 L"http://wacapps.net/ns/widgets#";
43 static const DPL::String WacWidgetNamespaceName =
44 L"http://wacapps.net/ns/widgets";
45 static const DPL::String TizenWebAppNamespaceName =
46 L"http://tizen.org/ns/widgets";
49 namespace PluginsPrefix {
50 const char * const W3CPluginsPrefix = "http://www.w3.org/";
51 const char * const WACPluginsPrefix = "http://wacapps.net/api/";
52 const char * const TIZENPluginsPrefix = "http://tizen.org/api/";
66 class WidgetParser : public ElementParser
69 ElementParserPtr OnNameElement();
70 ElementParserPtr OnDescriptionElement();
71 ElementParserPtr OnAuthorElement();
72 ElementParserPtr OnLicenseElement();
73 ElementParserPtr OnIconElement();
74 ElementParserPtr OnContentElement();
75 ElementParserPtr OnFeatureElement();
76 ElementParserPtr OnPreferenceElement();
77 ElementParserPtr OnAccessElement();
78 ElementParserPtr OnFlashElement();
79 ElementParserPtr OnLinkElement();
80 ElementParserPtr OnPkgnameElement();
81 ElementParserPtr OnSettingElement();
82 ElementParserPtr OnServiceElement();
84 virtual ActionFunc GetElementParser(const DPL::String& ns,
85 const DPL::String& name);
87 virtual void Accept(const Element&);
88 virtual void Accept(const Text&);
89 virtual void Accept(const XmlAttribute&);
90 virtual void Verify();
92 //Typedef used by RootParser
93 typedef WrtDB::ConfigParserData& Data;
99 Unicode::Direction m_textDirection;
101 DPL::Optional<DPL::String> m_version;
102 DPL::Optional<DPL::String> m_minVersion;
103 std::list<DPL::String> m_windowModes;
104 DPL::Optional<DPL::String> m_defaultlocale;
105 std::map<DPL::String, DPL::String> m_nameSpaces;
109 struct ContentParser;
111 #endif // WIDGET_PARSER_H_