[Release] wrt-installer_0.1.58
[framework/web/wrt-installer.git] / src / jobs / widget_install / widget_installer_struct.h
old mode 100755 (executable)
new mode 100644 (file)
index 2a655c8..6f0c176
@@ -30,6 +30,7 @@
 #include <job_base.h>
 #include <job.h>
 #include <widget_install/widget_install_errors.h>
+#include <wrt_install_mode.h>
 #include <wrt_common_types.h>
 #include <pkgmgr_signal_interface.h>
 #include <memory>
 typedef void (*InstallerFinishedCallback)(
     void *userParam,
     std::string tizenId,
-    Jobs::WidgetInstall::Exceptions::Type);
+    Jobs::Exceptions::Type);
 
 typedef void (*InstallerProgressCallback)(void *userParam,
                                           ProgressPercent percent,
                                           const ProgressDescription &);
 
-namespace WidgetUpdateMode {
-enum Type
-{
-    Zero = 0,
-
-    // Bits
-    NotInstalled          = 1 << 0,
-    IncomingVersionNotStd = 1 << 1,
-    ExistingVersionNotStd = 1 << 2,
-    BothVersionsNotStd    = 1 << 3,
-    ExistingVersionOlder  = 1 << 4,
-    ExistingVersionEqual  = 1 << 5,
-    ExistingVersionNewer  = 1 << 6,
-
-    // Policies
-    PolicyNeverUpdate = NotInstalled,
-
-    PolicyWac = NotInstalled |
-        ExistingVersionOlder,
-
-    PolicyAlwaysInstall = NotInstalled |
-        IncomingVersionNotStd |
-        ExistingVersionNotStd |
-        BothVersionsNotStd |
-        ExistingVersionOlder |
-        ExistingVersionEqual |
-        ExistingVersionNewer,
-
-    PolicyForceInstall = PolicyAlwaysInstall,
-    PolicyDirectoryForceInstall
-};
-
-inline Type operator | (const Type &a,
-        const Type &b)
-{
-    return static_cast<Type>(static_cast<unsigned long>(a) |
-                             static_cast<unsigned long>(b));
-}
-
-inline Type operator & (const Type &a,
-        const Type &b)
-{
-    return static_cast<Type>(static_cast<unsigned long>(a) &
-                             static_cast<unsigned long>(b));
-}
-}
-
 //TODO into namespace
 //InstallationStruct
 typedef Jobs::JobCallbacksBase<InstallerFinishedCallback,
@@ -101,33 +55,23 @@ WidgetInstallCallbackBase;
 //Widget Installation Struct
 struct WidgetInstallationStruct : public WidgetInstallCallbackBase
 {
-    WidgetUpdateMode::Type updateMode;
-    bool m_quiet;
-    bool m_preload;
+    InstallMode m_installMode;
     std::shared_ptr<PackageManager::IPkgmgrSignal> pkgmgrInterface;
 
     // It must be empty-constructible as a parameter of generic event
-    WidgetInstallationStruct() : updateMode(WidgetUpdateMode::Zero),
-                                m_quiet(true),
-                                m_preload(false)
-    {
-    }
-
-    WidgetInstallationStruct(InstallerFinishedCallback finished,
-            InstallerProgressCallback progress,
-            void *param,
-            WidgetUpdateMode::Type mode,
-            bool quiet,
-            bool preload,
-            std::shared_ptr<PackageManager::IPkgmgrSignal> _pkgmgrInterface
-            ) :
+    WidgetInstallationStruct() {};
+    WidgetInstallationStruct(
+        InstallerFinishedCallback finished,
+        InstallerProgressCallback progress,
+        void *param,
+        InstallMode mode,
+        std::shared_ptr<PackageManager::IPkgmgrSignal>
+        _pkgmgrInterface
+        ) :
         WidgetInstallCallbackBase(finished, progress, param),
-        updateMode(mode),
-        m_quiet(quiet),
-        m_preload(preload),
+        m_installMode(mode),
         pkgmgrInterface(_pkgmgrInterface)
-    {
-    }
+    {}
 };
 
 #endif // WRT_SRC_INSTALLER_CORE_INSTALLER_TASKS_WIDGET_INSTALLER_STRUCT_H_