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;
64 virtual void OnStop();
65 virtual void OnCreate();
66 virtual void OnReset(bundle *b);
67 virtual void OnTerminate();
70 void showHelpAndQuit();
73 virtual void OnEventReceived(const WRTInstallerNS::QuitEvent &event);
74 virtual void OnEventReceived(const WRTInstallerNS::NextStepEvent& event);
75 virtual void OnEventReceived(
76 const WRTInstallerNS::InstallPluginEvent& event);
81 void installPluginsStep();
82 void uninstallPkgNameStep();
83 void unistallWgtFileStep();
87 static void staticWrtInitCallback(WrtErrStatus status,
89 static void staticWrtStatusCallback(std::string tizenId,
92 static void staticWrtPluginInstallationCallback(WrtErrStatus status,
94 static void staticWrtPluginInstallProgressCb(float percent,
95 const char* description,
97 static void staticWrtInstallProgressCallback(float percent,
98 const char* description,
101 static void staticWrtUninstallProgressCallback(float percent,
102 const char* description,
105 static void showResultCallback(void *data, Evas_Object *obj,
107 static void failResultCallback(void *data, Evas_Object *obj,
110 void installNewPlugins();
111 bool popupsEnabled() const;
114 std::shared_ptr<PackageManager::IPkgmgrSignal> pkgmgrSignalInterface;
115 WrtInstallMode m_installMode;
116 std::string m_packagePath;
119 size_t m_numPluginsToInstall;
120 size_t m_totalPlugins;
122 bool m_installByPkgmgr;
124 bool m_startupPluginInstallation;
126 typedef std::list<std::string> PluginPathList;
127 DPL::Optional<PluginPathList> m_pluginsPaths;
129 #endif // WRT_INSTALLER_H