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
24 #include <dpl/application.h>
25 #include <dpl/generic_event.h>
26 #include <dpl/event/controller.h>
27 #include <dpl/type_list.h>
29 #include <dpl/log/log.h>
30 #include <dpl/string.h>
33 #include <wrt_installer_api.h>
35 #include <pkg-manager/pkgmgr_signal_interface.h>
36 #include <pkg-manager/pkgmgr_signal_dummy.h>
37 #include <pkg-manager/pkgmgr_signal.h>
40 namespace WRTInstallerNS { //anonymous
41 DECLARE_GENERIC_EVENT_0(QuitEvent)
42 DECLARE_GENERIC_EVENT_0(NextStepEvent)
43 DECLARE_GENERIC_EVENT_0(InstallPluginEvent)
46 typedef void (*ShowResultCallback)(void *data, Evas_Object *obj,
56 public DPL::Application,
57 private DPL::Event::Controller<DPL::TypeListDecl<
58 WRTInstallerNS::QuitEvent,
59 WRTInstallerNS::NextStepEvent,
60 WRTInstallerNS::InstallPluginEvent>::
62 public DPL::TaskDecl<WrtInstaller>
65 WrtInstaller(int argc,
67 virtual ~WrtInstaller();
69 int getReturnStatus() const;
75 virtual ~InstallerPopup();
78 Evas_Object* createWin(const char* name);
79 void showPopup(void* userdata, const DPL::String& pkgMsg,
80 ShowResultCallback callback);
84 Evas_Object* m_progressbar;
88 virtual void OnStop();
89 virtual void OnCreate();
90 virtual void OnReset(bundle *b);
91 virtual void OnTerminate();
94 void showHelpAndQuit();
97 virtual void OnEventReceived(const WRTInstallerNS::QuitEvent &event);
98 virtual void OnEventReceived(const WRTInstallerNS::NextStepEvent& event);
99 virtual void OnEventReceived(
100 const WRTInstallerNS::InstallPluginEvent& event);
102 // Installation steps
105 void installNewPlugins();
106 void installPluginsStep();
107 void uninstallPkgNameStep();
108 void unistallWgtFileStep();
110 void registerCallbackStep();
111 void queryListStep();
114 static void staticWrtInitCallback(WrtErrStatus status,
116 static void staticWrtStatusCallback(std::string tizenId,
119 static void staticWrtPluginInstallationCallback(WrtErrStatus status,
121 static void staticWrtPluginInstallProgressCb(float percent,
122 const char* description,
124 static void staticWrtInstallProgressCallback(float percent,
125 const char* description,
128 static void staticWrtUninstallProgressCallback(float percent,
129 const char* description,
132 static void showResultCallback(void *data, Evas_Object *obj,
134 static void failResultCallback(void *data, Evas_Object *obj,
137 bool popupsEnabled() const;
140 std::shared_ptr<PackageManager::IPkgmgrSignal> pkgmgrSignalInterface;
141 wrt_widget_install_mode_e m_installPolicy;
142 std::string m_bundleValue;
143 std::string m_packagePath;
147 size_t m_numPluginsToInstall;
148 size_t m_totalPlugins;
150 bool m_installByPkgmgr;
152 InstallerPopup *m_popup;
153 bool m_startupPluginInstallation;
154 std::string m_webAppConfig;
155 std::string m_webAppIcon;
156 bool m_preloadWidget;
158 typedef std::list<std::string> PluginPathList;
159 DPL::Optional<PluginPathList> m_pluginsPaths;
161 #endif // WRT_CLIENT_H