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"
32 #include <dpl/foreach.h>
33 #include <dpl/wrt-dao-ro/config_parser_data.h>
35 namespace ConfigurationNamespace {
36 static const DPL::String W3CWidgetNamespaceName =
37 L"http://www.w3.org/ns/widgets";
38 static const DPL::String JilWidgetNamespaceName =
39 L"http://www.jil.org/ns/widgets1.2";
40 static const DPL::String WacWidgetNamespaceNameForLinkElement =
41 L"http://wacapps.net/ns/widgets#";
42 static const DPL::String WacWidgetNamespaceName =
43 L"http://wacapps.net/ns/widgets";
44 static const DPL::String TizenWebAppNamespaceName =
45 L"http://tizen.org/ns/widgets";
48 namespace PluginsPrefix {
49 const char * const W3CPluginsPrefix = "http://www.w3.org/";
50 const char * const WACPluginsPrefix = "http://wacapps.net/api/";
51 const char * const TIZENPluginsPrefix = "http://tizen.org/api/";
65 class WidgetParser : public ElementParser
68 ElementParserPtr OnNameElement();
69 ElementParserPtr OnDescriptionElement();
70 ElementParserPtr OnAuthorElement();
71 ElementParserPtr OnLicenseElement();
72 ElementParserPtr OnIconElement();
73 ElementParserPtr OnContentElement();
74 ElementParserPtr OnFeatureElement();
75 ElementParserPtr OnPreferenceElement();
76 ElementParserPtr OnAccessElement();
77 ElementParserPtr OnFlashElement();
78 ElementParserPtr OnLinkElement();
79 ElementParserPtr OnMinVersionElement();
80 ElementParserPtr OnBackElement();
81 ElementParserPtr OnPkgnameElement();
82 ElementParserPtr OnSettingElement();
83 ElementParserPtr OnServiceElement();
85 virtual ActionFunc GetElementParser(const DPL::String& ns,
86 const DPL::String& name);
88 virtual void Accept(const Element&);
89 virtual void Accept(const Text&);
90 virtual void Accept(const XmlAttribute&);
91 virtual void Verify();
93 //Typedef used by RootParser
94 typedef WrtDB::ConfigParserData& Data;
100 Unicode::Direction m_textDirection;
102 DPL::Optional<DPL::String> m_version;
103 std::list<DPL::String> m_windowModes;
104 DPL::Optional<DPL::String> m_defaultlocale;
105 std::list<DPL::String> m_nameSpaces;
109 struct ContentParser;
111 #endif // WIDGET_PARSER_H_