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>
31 #include <wrt_installer_api.h>
33 namespace WRTInstallerNS { //anonymous
34 DECLARE_GENERIC_EVENT_0(QuitEvent)
35 DECLARE_GENERIC_EVENT_0(NextStepEvent)
36 DECLARE_GENERIC_EVENT_0(InstallPluginEvent)
39 typedef void (*ShowResultCallback)(void *data, Evas_Object *obj,
41 namespace CSCConfiguration {
42 typedef std::map<std::string, std::string> dataMap;
43 typedef std::pair<std::string, std::string> dataPair;
44 const char* const KEY_OP = "op";
45 const char* const KEY_PATH = "path";
46 const char* const VALUE_INSTALL = "install";
47 const char* const VALUE_UNINSTALL = "uninstall";
57 public DPL::Application,
58 private DPL::Event::Controller<DPL::TypeListDecl<
59 WRTInstallerNS::QuitEvent,
60 WRTInstallerNS::NextStepEvent,
61 WRTInstallerNS::InstallPluginEvent>::
63 public DPL::TaskDecl<WrtInstaller>
66 WrtInstaller(int argc,
68 virtual ~WrtInstaller();
70 int getReturnStatus() const;
73 virtual void OnStop();
74 virtual void OnCreate();
75 virtual void OnReset(bundle *b);
76 virtual void OnTerminate();
79 void showHelpAndQuit();
82 virtual void OnEventReceived(const WRTInstallerNS::QuitEvent &event);
83 virtual void OnEventReceived(const WRTInstallerNS::NextStepEvent& event);
84 virtual void OnEventReceived(
85 const WRTInstallerNS::InstallPluginEvent& event);
90 void installPluginsStep();
91 void uninstallPkgNameStep();
92 void unistallWgtFileStep();
96 static void staticWrtInitCallback(WrtErrStatus status,
98 static void staticWrtStatusCallback(std::string tizenId,
101 static void staticWrtPluginInstallationCallback(WrtErrStatus status,
103 static void staticWrtPluginInstallProgressCb(float percent,
104 const char* description,
106 static void staticWrtInstallProgressCallback(float percent,
107 const char* description,
110 static void staticWrtUninstallProgressCallback(float percent,
111 const char* description,
114 static void showResultCallback(void *data, Evas_Object *obj,
116 static void failResultCallback(void *data, Evas_Object *obj,
119 void installNewPlugins();
120 bool popupsEnabled() const;
121 CSCConfiguration::dataMap parseCSCConfiguration(std::string str);
124 std::shared_ptr<PackageManager::IPkgmgrSignal> pkgmgrSignalInterface;
125 WrtInstallMode m_installMode;
126 std::string m_packagePath;
129 size_t m_numPluginsToInstall;
130 size_t m_totalPlugins;
132 bool m_installByPkgmgr;
133 bool m_startupPluginInstallation;
134 CSCConfiguration::dataMap m_CSCconfigurationMap;
136 typedef std::list<std::string> PluginPathList;
137 DPL::Optional<PluginPathList> m_pluginsPaths;
139 #endif // WRT_INSTALLER_H