summaryrefslogtreecommitdiff
path: root/src/XmlHandler/ManifestHandler.h
blob: 1a3e0a76a4f6840721efb4f2d0f8a32c2b8f71db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
//
// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/**
 * @file ManifestHandler.h
 * @brief	This is the header file for the %ManifestHandler class.
 *
 * This header file contains the declarations of the %ManifestHandler class.
 */
#ifndef _MANIFEST_HANDLER_H_
#define _MANIFEST_HANDLER_H_

#include <FAppPkg_PackageInfoImpl.h>
#include <FBaseString.h>

#include "XmlHandler.h"
#include "InstallationContext.h"

class ManifestParser;

/**
 * @class		ManifestHandler
 * @brief		This class represents the class of ManifestHandler.
 * @since		1.0
 *
 * This class represents the class of ManifestHandler.
 *
 */
class ManifestHandler
	: public XmlHandler
{
public:
	ManifestHandler(void);
	virtual ~ManifestHandler(void);

	bool Construct(InstallationContext *pConext);
	InstallationContext* GetContext(void);
	bool Parse(const char *pFilepath);

	AppData* GetAppData(void);
	char* GetDefaultIconType(void);

private:
	ManifestHandler(const ManifestHandler& value);
	ManifestHandler& operator =(const ManifestHandler& source);

	virtual bool OnStartElement(const char *pName);
	virtual bool OnEndElement(const char *pName);
	virtual bool OnCharacters(const char *pCharacters);

	// StartElement
	bool OnPrivilegesStartElement(void);
	bool OnUiAppStartElement(void);
	bool OnServiceAppStartElement(void);
	bool OnIconsStartElement(void);
	bool OnUiScalabilityStartElement(void);
	bool OnUiThemeStartElement(void);

	bool OnAppControlStartElement(void);
	bool OnCapabilityStartElement(void);
	bool OnResolutionStartElement(void);
	bool OnOperationStartElement(void);
	bool OnDataControlStartElement(void);

	bool OnContentsStartElement(void);
	bool OnContentStartElement(void);

	// Parsers
	bool OnLiveboxesStartElement(const char *pName);
	bool OnAccountsStartElement(const char *pName);
	bool OnAppControlsStartElement(const char *pName);

	// EndElement
	bool OnPrivilegesEndElement(void);
	bool OnUiAppEndElement(void);
	bool OnServiceAppEndElement(void);
	bool OnAppsEndElement(void);
	bool OnIconsEndElement(void);
	bool OnUiScalabilityEndElement(void);
	bool OnUiThemeEndElement(void);

	bool OnDataControlEndElement(void);
	bool OnDataControlTypeEndElement(void);
	bool OnConditionEndElement(void);
	bool OnNotificationEndElement(void);

	bool OnContentsEndElement(void);
	bool OnContentEndElement(void);

	// Parsers
	bool OnLiveboxesEndElement(void);
	bool OnAccountsEndElement(void);
	bool OnAppControlsEndElement(void);

	bool OnManifestEndElement(void);

	// OnValue
	bool OnIdValue(const char *pCharacters);
	bool OnVersionValue(const char *pCharacters);
	bool OnTypeValue(const char *pCharacters);
	bool OnAuthorValue(const char *pCharacters);
	bool OnUrlValue(const char *pCharacters);
	bool OnApiVersionValue(const char *pCharacters);
	bool OnPrivilegeValue(const char *pCharacters);
	bool OnIconValue(const char *pCharacters);
	bool OnNameValue(const char *pCharacters);
	bool OnDescriptionValue(const char *pCharacters);
	bool OnDataControlTypeValue(const char *pCharacters);
	bool OnConditionValue(const char *pCharacters);
	bool OnNotificationValue(const char *pCharacters);
	bool OnSizeValue(const char *pCharacters);
	bool OnInstallationLocationValue(const char *pCharacters);
	bool OnCategoryValue(const char *pCharacters);

	bool OnMimeTypeValue(const char* pCharacters);
	bool OnUriValue(const char* pCharacters);

	bool OnConfigurationAppControlAppIdValue(const char* pCharacters);

	// help functions
	bool FindElement(const char *pName);
	bool AddAppFeature(const Tizen::Base::String& name, const Tizen::Base::String& value);
	bool ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp);

private:
	InstallationContext* __pContext;
	Tizen::Base::Collection::ArrayList* __pPrivilegeList;
	Tizen::Base::Collection::ArrayList* __pContentDataList;
	Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
	Tizen::App::Package::_PackageAppInfoImpl* __pPackageAppInfoImpl;
	Tizen::App::Package::_AppControlInfoImpl* __pAppControlInfoImpl;
	Tizen::App::Package::_AppControlCapabilityInfoImpl* __pAppControlCapabilityInfoImpl;
	Tizen::App::Package::_AppControlResolutionInfoImpl* __pAppControlResolutionInfoImpl;
	Tizen::App::Package::_DataControlInfoImpl* __pDataControlInfoImpl;
	Tizen::App::Package::_DataControlTypeImpl* __pDataControlTypeImpl;
	Tizen::App::Package::_LaunchConditionInfoImpl* __pLaunchConditionImpl;
	Tizen::App::Package::_NotificationInfoImpl* __pNotificationImpl;

	ContentData* __pContentData;
	char* __pDefaultIconType;

	bool __isDefaultMainmenu;
	bool __isDefaultSetting;
	bool __isDefaultTicker;
	bool __isDefaultQuickpanel;
	bool __isDefaultLaunchImage;
	bool __isDefaultName;
	bool __isDefaultAppDetected;

	AppData* __pAppData;
	Tizen::Base::Collection::IListT<AppControlData*>* __pSubModeAppControlDataList;

	bool __isParserMode;
	ManifestParser* __pParser;

	friend class ManifestAppControlsParser;

}; // ManifestHandler

#endif // _MANIFEST_HANDLER_H_