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>
34 #include <pkgmgr_installer.h>
36 namespace WRTInstallerNS { //anonymous
37 DECLARE_GENERIC_EVENT_0(QuitEvent)
38 DECLARE_GENERIC_EVENT_0(NextStepEvent)
39 DECLARE_GENERIC_EVENT_0(InstallPluginEvent)
42 typedef void (*ShowResultCallback)(void *data, Evas_Object *obj,
52 public DPL::Application,
53 private DPL::Event::Controller<DPL::TypeListDecl<
54 WRTInstallerNS::QuitEvent,
55 WRTInstallerNS::NextStepEvent,
56 WRTInstallerNS::InstallPluginEvent>::Type>,
57 public DPL::TaskDecl<WrtInstaller>
60 WrtInstaller(int argc,
62 virtual ~WrtInstaller();
65 int getReturnStatus() const;
71 virtual ~InstallerPopup();
74 Evas_Object* createWin(const char* name);
75 void showPopup(void* userdata, const DPL::String& pkgMsg,
76 ShowResultCallback callback);
80 Evas_Object* m_progressbar;
84 virtual void OnStop();
85 virtual void OnCreate();
86 virtual void OnReset(bundle *b);
87 virtual void OnTerminate();
90 void showHelpAndQuit();
93 virtual void OnEventReceived(const WRTInstallerNS::QuitEvent &event);
94 virtual void OnEventReceived(const WRTInstallerNS::NextStepEvent& event);
95 virtual void OnEventReceived(const WRTInstallerNS::InstallPluginEvent& event);
100 void installNewPlugins();
101 void installPluginsStep();
102 void uninstallStep();
103 void uninstallPkgNameStep();
104 void uninstallGuidStep();
105 void unistallWgtFileStep();
107 void registerCallbackStep();
108 void queryListStep();
112 static void staticWrtInitCallback(WrtErrStatus status,
114 static void staticWrtStatusCallback(int handle,
117 static void staticWrtPluginInstallationCallback(WrtErrStatus status,
119 static void staticWrtPluginInstallProgressCb(float percent,
120 const char* description,
122 static void staticWrtInstallProgressCallback(float percent,
123 const char* description,
126 static void staticWrtUninstallProgressCallback(float percent,
127 const char* description,
130 static void showResultCallback(void *data, Evas_Object *obj,
132 static void failResultCallback(void *data, Evas_Object *obj,
136 wrt_widget_install_mode_e m_installPolicy;
137 std::string m_bundleValue;
138 std::string m_packagePath;
142 size_t m_numPluginsToInstall;
143 size_t m_totalPlugins;
145 bool m_installByPkgmgr;
147 InstallerPopup *m_popup;
148 bool m_startupPluginInstallation;
149 std::string m_webAppConfig;
150 std::string m_webAppIcon;
152 typedef std::list<std::string> PluginPathList;
153 DPL::Optional<PluginPathList> m_pluginsPaths;
155 #endif // WRT_CLIENT_H