b7b2bfe910514042b268ec54c1d7187b46798987
[framework/web/wrt-installer.git] / src / jobs / widget_install / widget_install_context.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /**
17  * @file    installer_structs.h
18  * @author  Pawel Sikorski (p.sikorski@samgsung.com)
19  * @version
20  * @brief   Definition file of installer tasks data structures
21  */
22 #ifndef INSTALLER_CONTEXT_H
23 #define INSTALLER_CONTEXT_H
24
25 #include <map>
26 #include <string>
27 #include <dpl/string.h>
28 #include <dpl/wrt-dao-rw/widget_dao.h>
29 #include <widget_install/wac_security.h>
30 #include <feature_logic.h>
31 #include <widget_install/widget_update_info.h>
32 #include <widget_location.h>
33
34 namespace Jobs {
35 namespace WidgetInstall {
36 class JobWidgetInstall;
37 } //namespace Jobs
38 } //namespace WidgetInstall
39
40 class WidgetModel;
41
42 typedef std::map<DPL::String, bool> RequestedDevCapsMap;
43
44 struct InstallerContext
45 {
46     typedef enum InstallStepEnum
47     {
48         INSTALL_START = 0,
49         INSTALL_CHECK_FILE,
50         INSTALL_UNZIP_FILES,
51         INSTALL_WIDGET_CONFIG1,
52         INSTALL_WIDGET_CONFIG2,
53         INSTALL_DIGSIG_CHECK,
54         INSTALL_CERT_CHECK,
55         INSTALL_ECRYPTION_FILES,
56         INSTALL_DIR_CREATE,
57         INSTALL_RENAME_PATH,
58
59         INSTALL_CREATE_BACKUP_DIR,                     /* For Update */
60         INSTALL_BACKUP_RES_FILES,                      /* For Update */
61         INSTALL_BACKUP_EXEC,                           /* For Update */
62
63         INSTALL_SMACK_ENABLE,
64         INSTALL_BACKUP_ICONFILE,                         /* For Update */
65         INSTALL_COPY_ICONFILE,
66         INSTALL_CREATE_EXECFILE,
67         INSTALL_CREATE_MANIFEST,
68         INSTALL_CREATE_SHORTCUT,
69         INSTALL_SET_CERTINFO,
70         INSTALL_INSTALL_OSPSVC,
71         INSTALL_REMOVE_BACKUP_FILE,
72         INSTALL_PLUGINS_COPY,
73         INSTALL_NEW_DB_INSERT,
74         INSTALL_ACE_PREPARE,
75         INSTALL_ACE_CHECK,
76
77         INSTALL_END
78     } InstallStep;
79
80     // Installation state variables
81     WrtDB::WidgetRegisterInfo widgetConfig;      ///< WidgetConfigInfo
82     DPL::Optional<WidgetLocation> locations;
83     Jobs::WidgetInstall::WacSecurity wacSecurity; ///< Widget Domain
84                                                   // information.
85     InstallStep installStep;              ///< current step of installation
86     Jobs::WidgetInstall::JobWidgetInstall *job;
87      ///< Whether this is an update or normal installation
88     Jobs::WidgetInstall::FeatureLogicPtr featureLogic;
89     /** List of dev-caps that are requested in widget config file.
90      * Additional flag tells whether dev cap gets "static" permission
91      * (will always have PERMIT from ACE Policy). They will therefore receive
92      * static SMACK permission. (They may be forbidden because
93      * of ACE User Settings, but for now we do not protect this
94      * case with SMACK). */
95     RequestedDevCapsMap staticPermittedDevCaps;
96     std::string installInfo;            ///<For recovery>
97     bool m_quiet;
98     InstallLocationType locationType;
99     bool isUpdateMode;
100 };
101
102 #endif // INSTALLER_CONTEXT_H