[Release] wrt-installer_0.1.114
[framework/web/wrt-installer.git] / src / wrt-installer / wrt-installer.h
index 9cd0173..6752ea9 100644 (file)
@@ -27,7 +27,9 @@
 #include <dpl/task.h>
 #include <dpl/string.h>
 #include <string>
+#include <map>
 #include <wrt_installer_api.h>
+#include <wrt_install_mode.h>
 
 namespace WRTInstallerNS { //anonymous
 DECLARE_GENERIC_EVENT_0(QuitEvent)
@@ -37,12 +39,17 @@ DECLARE_GENERIC_EVENT_0(InstallPluginEvent)
 
 typedef void (*ShowResultCallback)(void *data, Evas_Object *obj,
                                    void *event_info);
-
-enum ReturnValue
-{
-    RE_SUCCESS,
-    RE_FAIL
-};
+namespace CSCConfiguration {
+typedef std::map<std::string, std::string> dataMap;
+typedef std::pair<std::string, std::string> dataPair;
+const char* const KEY_OP = "op";
+const char* const KEY_PATH = "path";
+const char* const KEY_REMOVABLE = "removable";
+const char* const VALUE_INSTALL = "install";
+const char* const VALUE_UNINSTALL = "uninstall";
+const char* const VALUE_TRUE = "true";
+const char* const VALUE_FALSE = "false";
+}
 
 class WrtInstaller :
     public DPL::Application,
@@ -68,6 +75,7 @@ class WrtInstaller :
 
   private:
     void         showHelpAndQuit();
+    void         showArguments();
 
     // Events
     virtual void OnEventReceived(const WRTInstallerNS::QuitEvent &event);
@@ -81,6 +89,7 @@ class WrtInstaller :
     void installPluginsStep();
     void uninstallPkgNameStep();
     void unistallWgtFileStep();
+    void removeUpdateStep();
     void shutdownStep();
 
     // Static callbacks
@@ -107,12 +116,22 @@ class WrtInstaller :
     static void failResultCallback(void *data, Evas_Object *obj,
                                    void *event_info);
 
+    static void staticWrtInitializeToPreloadCallback(std::string tizenId,
+                                        WrtErrStatus status,
+                                        void* userdata);
+
+    static void staticWrtInitPreloadStatusCallback(std::string tizenId,
+                                        WrtErrStatus status,
+                                        void* userdata);
+
     void installNewPlugins();
-    bool popupsEnabled() const;
+    CSCConfiguration::dataMap parseCSCConfiguration(std::string str);
+    void showErrorMsg(WrtErrStatus status, std::string tizenId, std::string
+            printMsg);
 
     // Private data
     std::shared_ptr<PackageManager::IPkgmgrSignal> pkgmgrSignalInterface;
-    WrtInstallMode m_installMode;
+    InstallMode m_installMode;
     std::string m_packagePath;
     std::string m_name;
     bool m_initialized;
@@ -120,8 +139,8 @@ class WrtInstaller :
     size_t m_totalPlugins;
     int m_returnStatus;
     bool m_installByPkgmgr;
-    bool m_quiet;
     bool m_startupPluginInstallation;
+    CSCConfiguration::dataMap m_CSCconfigurationMap;
 
     typedef std::list<std::string> PluginPathList;
     DPL::Optional<PluginPathList> m_pluginsPaths;