X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=modules%2Fwidget_dao%2Finclude%2Fdpl%2Fwrt-dao-rw%2Fwidget_dao.h;h=3f7b819acec3596528c131f77fd268a18db1f7b9;hb=refs%2Ftags%2Fsubmit%2Ftizen_2.0%2F20130215.191923;hp=1b8b50705963fda72a7d28db5fd43467a0bed6bd;hpb=45bf3bfbb061b87511ece6f50b1aa6c803844a65;p=framework%2Fweb%2Fwrt-commons.git diff --git a/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h b/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h index 1b8b507..3f7b819 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h +++ b/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h @@ -29,6 +29,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -41,14 +44,9 @@ class WidgetDAO : public WidgetDAOReadOnly public: typedef std::list LanguageTagsList; - /** - * This is a constructor. - * - * @param[in] widgetHandle application id of widget. - * @param[in] widgetGUID application guid of widget. - */ - WidgetDAO(DbWidgetHandle widgetHandle); + WidgetDAO(DbWidgetHandle handle); WidgetDAO(DPL::OptionalString widgetGUID); + WidgetDAO(DPL::String pkgName); /** * Destructor @@ -56,31 +54,76 @@ class WidgetDAO : public WidgetDAOReadOnly virtual ~WidgetDAO(); /** - * This method registers the widget information to the DB when it is installed. + * This method registers the widget information in the DB when it is installed. * * @see WidgetRegisterInfo * @see UnRegisterWidget() + * @param[in] widgetPkgname Widget Pkgname that will be registered. * @param[in] pWidgetRegisterInfo Specified the widget's information needed to be registered. - * @return widget's app id issued by app manager; 0 represents a failure during register. + * @param[in] wacSecurity Widget's security certificates. */ + static void registerWidget( + const WidgetPkgName & widgetPkgname, + const WidgetRegisterInfo &widgetRegInfo, + const IWacSecurity &wacSecurity); + static DbWidgetHandle registerWidget( - const WidgetRegisterInfo &pWidgetRegisterInfo, - const IWacSecurity &wacSecurity, - const LanguageTagsList& languageTags); + const WidgetRegisterInfo &pWidgetRegisterInfo, + const IWacSecurity &wacSecurity) __attribute__((deprecated)); + + /** + * @brief registerWidgetGenerateTizenId Registers widget with auto-generated tizen id + * + * This function is disadviced and should be used only in tests. + * Function is not thread-safe. + * + * @param pWidgetRegisterInfo registeration information + * @param wacSecurity Widget's security certificates. + * @return pkgname generated + */ + static WidgetPkgName registerWidgetGenerateTizenId( + const WidgetRegisterInfo &pWidgetRegisterInfo, + const IWacSecurity &wacSecurity); + + /** + * This method re-registers the widget information to the DB when it is installed. + * + * It performs unregistration and new registration of widget in db in one transaction. + * + * @see WidgetRegisterInfo + * @param[in] widgetName Widget pkgname that will be registered. + * @param[in] pWidgetRegisterInfo Specified the widget's information needed to be registered. + * @param[in] wacSecurity Widget's security certificates. + */ + static void registerOrUpdateWidget( + const WidgetPkgName & widgetName, + const WidgetRegisterInfo &widgetRegInfo, + const IWacSecurity &wacSecurity); + + static void registerWidget( + WrtDB::DbWidgetHandle handle, + const WidgetRegisterInfo &widgetRegInfo, + const IWacSecurity &wacSecurity) __attribute__((deprecated)); /** * This method removes a widget's information from EmDB. * * @see RegisterWidget() - * @param[in] widgetHandle widget's app id - * @return true if succeed, false if fail. + * @param[in] pkgName widgets name to be unregistered */ - static void unregisterWidget(DbWidgetHandle widgetHandle); + static void unregisterWidget(const WidgetPkgName & pkgName); + + static void unregisterWidget(WrtDB::DbWidgetHandle handle) __attribute__((deprecated)); /* This method removes widget property */ void removeProperty(const PropertyDAOReadOnly::WidgetPropertyKey &key); + /** + * @brief registerExternalLocations Removes rows from WidgetExternalLocations + */ + void unregisterAllExternalLocations(); + /* This method sets widget property */ void setProperty(const PropertyDAOReadOnly::WidgetPropertyKey &key, @@ -90,22 +133,36 @@ class WidgetDAO : public WidgetDAOReadOnly /* set PkgName */ void setPkgName(const DPL::OptionalString& pkgName); + void setPkgName_TEMPORARY_API(const WidgetPkgName& pkgName); + + /* This function will update of api-feature status. + * If status is true (feature rejected) plugin connected with this + * api feature mustn't be loaded durign widget launch. + */ + void updateFeatureRejectStatus(const DbWidgetFeature &widgetFeature); + + /* + * This method change security settings value + */ + void setSecurityPopupUsage(const SettingsType value); + void setGeolocationUsage(const SettingsType value); + void setWebNotificationUsage(const SettingsType value); + void setWebDatabaseUsage(const SettingsType value); + void setFileSystemUsage(const SettingsType value); private: //Methods used during widget registering static DbWidgetHandle registerWidgetInfo( + const WidgetPkgName & widgetName, const WidgetRegisterInfo ®Info, - const IWacSecurity &wacSecurity); + const IWacSecurity &wacSecurity, + const DPL::Optional handle = DPL::Optional()); static void registerWidgetExtendedInfo( DbWidgetHandle widgetHandle, const WidgetRegisterInfo ®Info); static void registerWidgetLocalizedInfo( DbWidgetHandle widgetHandle, const WidgetRegisterInfo ®Info); - static void registerWidgetUserAgentLocales( - DbWidgetHandle widgetHandle, - const WidgetRegisterInfo &rInf, - const LanguageTagsList& languageTags); static void registerWidgetIcons( DbWidgetHandle widgetHandle, const WidgetRegisterInfo ®Info); @@ -118,6 +175,9 @@ class WidgetDAO : public WidgetDAOReadOnly static void registerWidgetFeatures( DbWidgetHandle widgetHandle, const WidgetRegisterInfo ®Info); + static void registerWidgetPrivilege( + DbWidgetHandle widgetHandle, + const WidgetRegisterInfo ®Info); static void registerWidgetWindowModes( DbWidgetHandle widgetHandle, const WidgetRegisterInfo ®Info); @@ -127,11 +187,9 @@ class WidgetDAO : public WidgetDAOReadOnly static void registerWidgetCertificates( DbWidgetHandle widgetHandle, const IWacSecurity &wacSecurity); - static void registerWidgetPowderData( - DbWidgetHandle widgetHandle, - const WidgetRegisterInfo ®Info); - static void registerLaunchCertificates( + static void registerCertificatesChains( DbWidgetHandle widgetHandle, + CertificateSource certificateSource, const CertificateChainList &list); static void registerWidgetSettings( DbWidgetHandle widgetHandle, @@ -139,6 +197,25 @@ class WidgetDAO : public WidgetDAOReadOnly static void registerAppService( DbWidgetHandle widgetHandle, const WidgetRegisterInfo ®Info); + static void registerEncryptedResouceInfo( + DbWidgetHandle widgetHandle, + const WidgetRegisterInfo ®Info); + /** + * @brief registerExternalLocations Inserts new rows to WidgetExternalLocations + * @param externals list of files + */ + static void registerExternalLocations(DbWidgetHandle widgetHandle, + const ExternalLocationList & externals); + static void registerWidgetSecuritySettings(DbWidgetHandle widgetHandle); + + + static void registerWidgetInternal( + const WidgetPkgName & widgetName, + const WidgetRegisterInfo &widgetRegInfo, + const IWacSecurity &wacSecurity, + const DPL::Optional handle = DPL::Optional()); + static void unregisterWidgetInternal( + const WidgetPkgName & pkgName); }; } // namespace WrtDB