2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file job_widet_uninstall.h
18 * @brief Uninstaller header file.
19 * @author Radoslaw Wicik r.wicik@samsung.com
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_
28 #include <widget_uninstall/widget_uninstaller_struct.h>
29 #include <widget_uninstall/uninstaller_context.h>
32 namespace WidgetUninstall {
34 enum class WidgetStatus
36 Ok, NOT_INSTALLED, PREALOAD, ABNORMAL, UNRECOGNIZED
39 typedef JobContextBase<WidgetUninstallationStruct> WidgetUnistallStructBase;
40 typedef JobProgressBase<UninstallerContext::UninstallStep, UninstallerContext::UNINSTALL_END> UninstallContextBase;
42 class JobWidgetUninstall :
44 public UninstallContextBase,
45 public WidgetUnistallStructBase
48 UninstallerContext m_context;
50 //TODO move it to base class of all jobs
51 Jobs::Exceptions::Type m_exceptionCaught;
52 std::string m_exceptionMessage;
56 * @brief Uninstaller must to know which widget to uninstall.
58 * @param[in] WrtDB::TizenAppId tzAppId - widget to uninstall
60 JobWidgetUninstall(const std::string &tizenAppId,
61 const WidgetUninstallationStruct& uninstallerStruct);
63 std::string getRemovedTizenId() const;
64 bool getRemoveStartedFlag() const;
65 bool getRemoveFinishedFlag() const;
67 WidgetStatus getWidgetStatus(const std::string &appId);
70 void SendFinishedSuccess();
71 void SendFinishedFailure();
72 void SaveExceptionData(const Jobs::JobExceptionBase &e);
74 } //namespace WidgetUninstall
77 #endif // WRT_SRC_INSTALLER_CORE_JOB_WIDGET_UNINSTALL_JOB_WIDGET_UNINSTALL_H_