tizen beta release
[framework/web/wrt-installer.git] / src / jobs / widget_uninstall / job_widget_uninstall.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_widet_uninstall.h
18  * @brief Uninstaller header file.
19  * @author Radoslaw Wicik r.wicik@samsung.com
20  */
21
22 #ifndef WRT_SRC_INSTALLER_CORE_JOB_WIDGET_UNINSTALL_JOB_WIDGET_UNINSTALL_H_
23 #define WRT_SRC_INSTALLER_CORE_JOB_WIDGET_UNINSTALL_JOB_WIDGET_UNINSTALL_H_
24
25 #include <job.h>
26 #include <job_base.h>
27 #include <widget_uninstall/widget_uninstaller_struct.h>
28 #include <widget_uninstall/uninstaller_context.h>
29
30 namespace Jobs {
31 namespace WidgetUninstall {
32 class JobWidgetUninstall :
33     public Job,
34     public JobProgressBase<UninstallerContext::UninstallStep,
35                            UninstallerContext::UNINSTALL_END>,
36     public JobContextBase<WidgetUninstallationStruct>   //TODO typedef
37 {
38   private:
39     UninstallerContext m_context;
40
41     //TODO move it to base class of all jobs
42     Exceptions::Type m_exceptionCaught;
43     std::string m_exceptionMessage;
44
45   public:
46     /**
47      * @brief Uninstaller must to know which widget to uninstall.
48      *
49      * @param[in] const int& widget_id - wdget to uninstall
50      */
51     JobWidgetUninstall(WidgetHandle widgetHandle,
52             const WidgetUninstallationStruct& uninstallerStruct);
53
54     WidgetHandle getRemovedWidgetHandle() const;
55     bool getRemoveStartedFlag() const;
56     bool getRemoveFinishedFlag() const;
57
58     void SendProgress();
59     void SendFinishedSuccess();
60     void SendFinishedFailure();
61     void SaveExceptionData(const Jobs::JobExceptionBase &e);
62 };
63 } //namespace WidgetUninstall
64 } //namespace Jobs
65
66 #endif // WRT_SRC_INSTALLER_CORE_JOB_WIDGET_UNINSTALL_JOB_WIDGET_UNINSTALL_H_