5bb7f891527f1f20b3aaf38267f7521462cad8d8
[platform/core/appfw/wgt-backend.git] / src / wgt / step / pkgmgr / step_generate_xml.h
1 /* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */
2 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3 // Use of this source code is governed by a apache 2.0 license that can be
4 // found in the LICENSE file.
5
6 #ifndef  WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_
7 #define  WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_
8
9 #include <manifest_parser/utils/logging.h>
10
11 #include <libxml/xmlwriter.h>
12
13 #include <common/installer_context.h>
14 #include <common/step/step.h>
15
16 namespace wgt {
17 namespace pkgmgr {
18
19 class StepGenerateXml : public common_installer::Step {
20  public:
21   using Step::Step;
22
23   Status process() override;
24   Status clean() override { return Status::OK; }
25   Status undo() override;
26   Status precheck() override;
27
28  private:
29   enum class AppCompType {
30     UIAPP,
31     SVCAPP,
32     WIDGETAPP,
33     WATCHAPP
34   };
35
36   Step::Status GenerateApplicationCommonXml(application_x* app,
37                                             xmlTextWriterPtr writer,
38                                             AppCompType type);
39
40   Step::Status GenerateManifestElement(xmlTextWriterPtr writer);
41   void GenerateManifestElementAttributes(xmlTextWriterPtr writer);
42   void GenerateLangLabels(xmlTextWriterPtr writer);
43   void GenerateAuthor(xmlTextWriterPtr writer);
44   void GenerateDescription(xmlTextWriterPtr writer);
45   Step::Status GenerateApplications(xmlTextWriterPtr writer);
46   void GeneratePrivilege(xmlTextWriterPtr writer);
47   void GenerateProvidesAppDefinedPrivilege(xmlTextWriterPtr writer);
48   void GenerateAccount(xmlTextWriterPtr writer);
49   void GenerateIme(xmlTextWriterPtr writer);
50   void GenerateProfiles(xmlTextWriterPtr writer);
51   void GenerateShortcuts(xmlTextWriterPtr writer);
52
53   STEP_NAME(GenerateXML)
54 };
55
56 }  // namespace pkgmgr
57 }  // namespace wgt
58
59 #endif  // WGT_STEP_PKGMGR_STEP_GENERATE_XML_H_