upload tizen1.0 source
[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 <ace-dao-ro/AceDAOReadOnly.h>
33
34 namespace Jobs {
35 namespace WidgetInstall {
36 class JobWidgetInstall;
37 } //namespace Jobs
38 } //namespace WidgetInstall
39
40 class WidgetModel;
41
42 struct InstallerContext
43 {
44     typedef enum InstallStepEnum
45     {
46         INSTALL_START = 0,
47         INSTALL_WIDGET_CONFIG1,
48         INSTALL_WIDGET_CONFIG2,
49         INSTALL_WIDGET_CONFIG3,
50         INSTALL_WIDGET_CONFIG4,
51         INSTALL_WIDGET_CONFIG5,
52         INSTALL_DIGSIG_CHECK,
53         INSTALL_CERT_CHECK,
54         INSTALL_DB_UPDATE,
55         INSTALL_DIR_CREATE,
56         INSTALL_RENAME_PATH,
57         INSTALL_ACE_PREPARE,
58         INSTALL_ACE_CHECK,
59         INSTALL_SMACK_ENABLE,
60         INSTALL_COPY_ICONFILE,
61         INSTALL_CREATE_DESKTOP,
62         INSTALL_CREATE_EXECFILE,
63         INSTALL_CREATE_PRIVATE_STORAGE,
64         INSTALL_END
65     } InstallStep;
66
67     // Installation state variables
68     std::string widgetSource;           ///< Source widget zip file/widget url
69     std::string tempWidgetPath;           ///< Unpacked widget temporary path
70     WrtDB::WidgetRegisterInfo widgetConfig;      ///< WidgetConfigInfo
71     DPL::Optional<WrtDB::DbWidgetHandle> widgetHandle;
72     Jobs::WidgetInstall::WacSecurity wacSecurity;///< Widget Domain information.
73     InstallStep installStep;              ///< current step of installation
74     Jobs::WidgetInstall::JobWidgetInstall *job;
75         ///< pointer of instance of JobWidgetInstall
76     WidgetUpdateInfo::ExistingWidgetInfo existingWidgetInfo;
77         ///< Whether this is an update or normal installation
78     Jobs::WidgetInstall::FeatureLogicPtr featureLogic;
79     /** List of dev-caps that are requested in widget config file.
80     * Additional flag tells whether dev cap gets "static" permission
81     * (will always have PERMIT from ACE Policy). They will therefore receive
82     * static SMACK permission. (They may be forbidden because
83     * of ACE User Settings, but for now we do not protect this
84     * case with SMACK). */
85     AceDB::RequestedDevCapsMap staticPermittedDevCaps;
86     ///< Optional path to downloaded widget icon
87     std::string iconPath;
88 };
89
90 #endif // INSTALLER_CONTEXT_H