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 wrt-installer.h
19 * @brief Implementation file for installer
21 #ifndef WRT_INSTALLER_H
22 #define WRT_INSTALLER_H
24 #include <dpl/application.h>
25 #include <dpl/generic_event.h>
26 #include <dpl/event/controller.h>
28 #include <dpl/string.h>
30 #include <wrt_installer_api.h>
32 namespace WRTInstallerNS { //anonymous
33 DECLARE_GENERIC_EVENT_0(QuitEvent)
34 DECLARE_GENERIC_EVENT_0(NextStepEvent)
35 DECLARE_GENERIC_EVENT_0(InstallPluginEvent)
38 typedef void (*ShowResultCallback)(void *data, Evas_Object *obj,
48 public DPL::Application,
49 private DPL::Event::Controller<DPL::TypeListDecl<
50 WRTInstallerNS::QuitEvent,
51 WRTInstallerNS::NextStepEvent,
52 WRTInstallerNS::InstallPluginEvent>::
54 public DPL::TaskDecl<WrtInstaller>
57 WrtInstaller(int argc,
59 virtual ~WrtInstaller();
61 int getReturnStatus() const;
67 virtual ~InstallerPopup();
70 Evas_Object* createWin(const char* name);
71 void showPopup(void* userdata, const DPL::String& pkgMsg,
72 ShowResultCallback callback);
76 Evas_Object* m_progressbar;
80 virtual void OnStop();
81 virtual void OnCreate();
82 virtual void OnReset(bundle *b);
83 virtual void OnTerminate();
86 void showHelpAndQuit();
89 virtual void OnEventReceived(const WRTInstallerNS::QuitEvent &event);
90 virtual void OnEventReceived(const WRTInstallerNS::NextStepEvent& event);
91 virtual void OnEventReceived(
92 const WRTInstallerNS::InstallPluginEvent& event);
97 void installPluginsStep();
98 void uninstallPkgNameStep();
99 void unistallWgtFileStep();
103 static void staticWrtInitCallback(WrtErrStatus status,
105 static void staticWrtStatusCallback(std::string tizenId,
108 static void staticWrtPluginInstallationCallback(WrtErrStatus status,
110 static void staticWrtPluginInstallProgressCb(float percent,
111 const char* description,
113 static void staticWrtInstallProgressCallback(float percent,
114 const char* description,
117 static void staticWrtUninstallProgressCallback(float percent,
118 const char* description,
121 static void showResultCallback(void *data, Evas_Object *obj,
123 static void failResultCallback(void *data, Evas_Object *obj,
126 void installNewPlugins();
127 bool popupsEnabled() const;
130 std::shared_ptr<PackageManager::IPkgmgrSignal> pkgmgrSignalInterface;
131 WrtInstallMode m_installMode;
132 std::string m_packagePath;
135 size_t m_numPluginsToInstall;
136 size_t m_totalPlugins;
138 bool m_installByPkgmgr;
140 InstallerPopup *m_popup;
141 bool m_startupPluginInstallation;
143 typedef std::list<std::string> PluginPathList;
144 DPL::Optional<PluginPathList> m_pluginsPaths;
146 #endif // WRT_INSTALLER_H