X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fjobs%2Fwidget_install%2Fwidget_installer_struct.h;h=608cf443a0304f69b2bd6de9a9362b3047c7e7a5;hb=ecc6669ea1fd9a3e3406b5482f36a38599e423bc;hp=2c7e3c8c0d494d8d866c8ac8013589274a8cc2bc;hpb=78f11c1f44034926ac24a9a88c7ebf3b607e27a6;p=framework%2Fweb%2Fwrt-installer.git diff --git a/src/jobs/widget_install/widget_installer_struct.h b/src/jobs/widget_install/widget_installer_struct.h old mode 100755 new mode 100644 index 2c7e3c8..608cf44 --- a/src/jobs/widget_install/widget_installer_struct.h +++ b/src/jobs/widget_install/widget_installer_struct.h @@ -31,62 +31,28 @@ #include #include #include +#include +#include #include //Widget Installer typedefs 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 { +namespace InstallMode { 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 + INSTALL_MODE_WGT = 0, + INSTALL_MODE_DIRECTORY, + INSTALL_MODE_PRELOAD, + REINSTALL_MODE_DIRECTORY }; - -inline Type operator | (const Type &a, - const Type &b) -{ - return static_cast(static_cast(a) | - static_cast(b)); -} - -inline Type operator & (const Type &a, - const Type &b) -{ - return static_cast(static_cast(a) & - static_cast(b)); -} } //TODO into namespace @@ -98,25 +64,30 @@ WidgetInstallCallbackBase; //Widget Installation Struct struct WidgetInstallationStruct : public WidgetInstallCallbackBase { - WidgetUpdateMode::Type updateMode; + InstallMode::Type m_installMode; bool m_quiet; + std::shared_ptr pkgmgrInterface; // It must be empty-constructible as a parameter of generic event - WidgetInstallationStruct() : updateMode(WidgetUpdateMode::Zero), - m_quiet(true) - { - } - - WidgetInstallationStruct(InstallerFinishedCallback finished, - InstallerProgressCallback progress, - void *param, - WidgetUpdateMode::Type mode, - bool quiet) : + WidgetInstallationStruct() : + m_installMode(InstallMode::Type::INSTALL_MODE_WGT), + m_quiet(true) + {} + + WidgetInstallationStruct( + InstallerFinishedCallback finished, + InstallerProgressCallback progress, + void *param, + InstallMode::Type mode, + bool quiet, + std::shared_ptr + _pkgmgrInterface + ) : WidgetInstallCallbackBase(finished, progress, param), - updateMode(mode), - m_quiet(quiet) - { - } + m_installMode(mode), + m_quiet(quiet), + pkgmgrInterface(_pkgmgrInterface) + {} }; #endif // WRT_SRC_INSTALLER_CORE_INSTALLER_TASKS_WIDGET_INSTALLER_STRUCT_H_