Rename invalid WRT_SMACK_LABEL macro to WRT_SMACK_ENABLED
[platform/framework/web/wrt-installer.git] / src / jobs / widget_install / job_widget_install.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    job_widget_install.h
18  * @author  Radoslaw Wicik r.wicik@samsung.com
19  * @author  Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
20  * @version 1.0
21  * @brief   Implementation file for main installer task
22  */
23 #ifndef WRT_SRC_INSTALLER_CORE_JOB_JOB_WIDGET_INSTALL_H_
24 #define WRT_SRC_INSTALLER_CORE_JOB_JOB_WIDGET_INSTALL_H_
25
26 #include <job.h>
27 #include <job_base.h>
28 #include <dpl/utils/widget_version.h>
29 #include "widget_installer_struct.h"
30 #include <widget_install/widget_install_context.h>
31
32 using namespace Jobs::Exceptions;
33
34 namespace Jobs {
35 namespace WidgetInstall {
36
37 typedef JobProgressBase<InstallerContext::InstallStep, InstallerContext::INSTALL_END> InstallerBase;
38 typedef JobContextBase<Jobs::WidgetInstall::WidgetInstallationStruct> WidgetInstallationBase;
39
40 class JobWidgetInstall :
41     public Job,
42     public InstallerBase,
43     public WidgetInstallationBase
44
45 {
46   private:
47     InstallerContext m_installerContext;
48
49     Jobs::Exceptions::Type m_exceptionCaught;
50     std::string m_exceptionMessage;
51
52   public:
53     /**
54      * @brief Automaticaly sets installation process
55      */
56     JobWidgetInstall(std::string const & widgetPath,
57          const Jobs::WidgetInstall::WidgetInstallationStruct &installerStruct);
58
59     //overrides
60     void SendProgress();
61     void SendFinishedSuccess();
62     void SendFinishedFailure();
63     void SendProgressIconPath(const std::string &path);
64
65     void SaveExceptionData(const Jobs::JobExceptionBase&);
66     void displayWidgetInfo();
67
68     //execution paths
69     void appendNewInstallationTaskList();
70     void appendUpdateInstallationTaskList();
71 };
72 } //namespace WidgetInstall
73 } //namespace Jobs
74
75 #endif // WRT_SRC_INSTALLER_CORE_JOB_JOB_WIDGET_INSTALL_H_