tizen beta release
[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 <string>
26 #include <dpl/wrt-dao-rw/widget_dao.h>
27 #include <widget_install/wac_security.h>
28 #include <feature_logic.h>
29 #include <widget_install/widget_update_info.h>
30
31 namespace Jobs {
32 namespace WidgetInstall {
33 class JobWidgetInstall;
34 } //namespace Jobs
35 } //namespace WidgetInstall
36
37 class WidgetModel;
38
39 struct InstallerContext
40 {
41     typedef enum InstallStepEnum
42     {
43         INSTALL_START = 0,
44         INSTALL_WIDGET_CONFIG1,
45         INSTALL_WIDGET_CONFIG2,
46         INSTALL_WIDGET_CONFIG3,
47         INSTALL_WIDGET_CONFIG4,
48         INSTALL_WIDGET_CONFIG5,
49         INSTALL_DB_UPDATE,
50         INSTALL_RENAME_PATH,
51         INSTALL_CREATE_DESKTOP,
52         INSTALL_CREATE_EXECFILE,
53         INSTALL_COPY_ICONFILE,
54         INSTALL_CREATE_PRIVATE_STORAGE,
55         INSTALL_END
56     } InstallStep;
57
58     // Installation state variables
59     std::string widgetFilePath;           ///< Source widget zip file
60     std::string tempWidgetPath;           ///< Unpacked widget temporary path
61     WrtDB::WidgetRegisterInfo widgetConfig;      ///< WidgetConfigInfo
62     DPL::Optional<WrtDB::DbWidgetHandle> widgetHandle;
63     Jobs::WidgetInstall::WacSecurity wacSecurity;///< Widget Domain information.
64     bool unzipStarted;
65         ///< flag that indicates whether installer starts to unzip .wgt file
66     bool unzipFinished;
67         ///< flag that indicates whether installer finishes to unzip completely.
68     InstallStep installStep;              ///< current step of installation
69     Jobs::WidgetInstall::JobWidgetInstall *job;
70         ///< pointer of instance of JobWidgetInstall
71     WidgetUpdateInfo::ExistingWidgetInfo existingWidgetInfo;
72         ///< Whether this is an update or normal installation
73     Jobs::WidgetInstall::FeatureLogicPtr featureLogic;
74     /** List of dev-caps that get "static" permission (will always
75     * have PERMIT from ACE Policy). They will therefore receive
76     * static SMACK permission. (They may be forbidden because
77     * of ACE User Settings, but for now we do not protect this
78     * case with SMACK). */
79     std::set<DPL::String> staticPermittedDevCaps;
80 };
81
82 #endif // INSTALLER_CONTEXT_H