[Release] wrt-commons_0.2.145
[framework/web/wrt-commons.git] / modules / widget_dao / include / dpl / wrt-dao-ro / widget_dao_read_only.h
index 76292ad..56178d4 100644 (file)
@@ -39,7 +39,6 @@
 #include <dpl/wrt-dao-ro/common_dao_types.h>
 
 namespace WrtDB {
-
 /**
  * Widget's signature enum.
  * This enumerates signature type of widget.
@@ -90,12 +89,13 @@ struct WidgetCertificateData
     // Common name field in certificate
     DPL::String strCommonName;
 
-    bool operator== (const WidgetCertificateData& certData) const {
+    bool operator== (const WidgetCertificateData& certData) const
+    {
         return certData.chainId == chainId &&
-           certData.owner == owner &&
-           certData.strCommonName == strCommonName &&
-           certData.strMD5Fingerprint == strMD5Fingerprint &&
-           certData.strSHA1Fingerprint == strSHA1Fingerprint;
+               certData.owner == owner &&
+               certData.strCommonName == strCommonName &&
+               certData.strMD5Fingerprint == strMD5Fingerprint &&
+               certData.strSHA1Fingerprint == strSHA1Fingerprint;
     }
 };
 
@@ -115,11 +115,10 @@ struct WidgetRegisterInfo
     struct LocalizedIcon : public ConfigParserData::Icon
     {
         LocalizedIcon(const ConfigParserData::Icon& icon,
-                const LocaleSet& _availableLocales) :
+                      const LocaleSet& _availableLocales) :
             ConfigParserData::Icon(icon),
             availableLocales(_availableLocales)
-        {
-        }
+        {}
 
         LocaleSet availableLocales;
     };
@@ -158,26 +157,20 @@ struct WidgetRegisterInfo
     WidgetRegisterInfo() :
         webAppType(APP_TYPE_UNKNOWN),
         signatureType(SIGNATURE_TYPE_UNIDENTIFIED),
-        isTestWidget(0),
         configInfo(),
         packagingType(PKG_TYPE_UNKNOWN)
-    {
-    }
+    {}
 
     WidgetType webAppType;
-    WidgetType type; // TODO : This type will be removed.
     DPL::OptionalString guid;
     DPL::OptionalString version;
     DPL::OptionalString minVersion;
     std::string shareHref;
     std::string baseFolder;
     WidgetSignatureType signatureType;
-    int isTestWidget;
     ConfigParserData configInfo;
     LocalizationData localizationData;
 
-    DPL::OptionalString pkgname;
-    WidgetPkgName pkgName;
     TizenPkgId tzPkgid;
     TizenAppId tzAppid;
 
@@ -189,10 +182,10 @@ struct WidgetRegisterInfo
 };
 
 typedef std::list<std::string> CertificateChainList;
-class IWacSecurity
+class IWidgetSecurity
 {
   public:
-    virtual ~IWacSecurity();
+    virtual ~IWidgetSecurity();
 
     virtual const WidgetCertificateDataList& getCertificateList() const = 0;
 
@@ -200,10 +193,8 @@ class IWacSecurity
 
     virtual bool isDistributorSigned() const = 0;
 
-    virtual bool isWacSigned() const = 0;
-
     virtual void getCertificateChainList(CertificateChainList& list,
-            CertificateSource source) const = 0;
+                                         CertificateSource source) const = 0;
 };
 
 /**
@@ -300,7 +291,7 @@ class WidgetDAOReadOnly
      */
     WidgetDAOReadOnly(DbWidgetHandle widgetHandle);
     WidgetDAOReadOnly(DPL::OptionalString widgetGUID);
-    WidgetDAOReadOnly(DPL::String tzAppid);
+    WidgetDAOReadOnly(WrtDB::TizenAppId tzAppid);
 
     /**
      * Destructor
@@ -312,7 +303,8 @@ class WidgetDAOReadOnly
      *
      * @return widget handle(m_widgetHandle).
      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
-     * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
+     * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
+     * DB table.
      */
     DbWidgetHandle getHandle() const;
     static DbWidgetHandle getHandle(const WidgetGUID GUID);
@@ -323,24 +315,27 @@ class WidgetDAOReadOnly
      *
      * @return tzAppid;
      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
-     * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
+     * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
+     * DB table.
      */
 
     TizenAppId getTzAppId() const;
     static TizenAppId getTzAppId(const WidgetGUID GUID);
     static TizenAppId getTzAppId(const DbWidgetHandle handle);
+    static TizenAppId getTzAppId(const TizenPkgId tzPkgid);
 
     /**
-     * Returns WidgetPkgName for the specified widget
+     * Returns TizenPkgId for the specified widget
      *
-     * @return pkgName;
+     * @return TizenPkgId;
      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
-     * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
+     * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
+     * DB table.
      */
 
-    WidgetPkgName getPkgName() const;
-    static WidgetPkgName getPkgName(const WidgetGUID GUID);
-    static WidgetPkgName getPkgName(const DbWidgetHandle handle);
+    TizenPkgId getTzPkgId() const;
+    static TizenPkgId getTzPkgId(const DbWidgetHandle handle);
+    static TizenPkgId getTzPkgId(const TizenAppId tzAppid);
 
     /**
      * This method returns the root directory of widget resource.
@@ -350,7 +345,7 @@ class WidgetDAOReadOnly
      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
      * DB table.
      */
-    DPL::String getPath() const;
+    virtual DPL::String getPath() const;
 
     DPL::String getFullPath() const;
 
@@ -372,7 +367,7 @@ class WidgetDAOReadOnly
      * @return WidgetType
      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
-                                                records in DB table.
+     *                                          records in DB table.
      */
     WidgetType getWidgetType() const;
 
@@ -386,14 +381,14 @@ class WidgetDAOReadOnly
      */
     WidgetGUID getGUID() const;
 
-
     /**
-    * This method returns the App id of the widget.
-    *
-    * @return appid
-    * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
-    * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
-    */
+     * This method returns the App id of the widget.
+     *
+     * @return appid
+     * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
+     * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
+     * DB table.
+     */
     DPL::OptionalString getTizenAppId() const;
 
     /**
@@ -446,6 +441,8 @@ class WidgetDAOReadOnly
      * @param[out] outAccessInfoList list filled with access info structures
      */
     void getWidgetAccessInfo(WidgetAccessInfoList& outAccessInfoList) const;
+    void getWidgetAllowNavigationInfo(
+        WidgetAllowNavigationInfoList& allowNavigationInfoList) const;
 
     /**
      * WAC 2.0 extension
@@ -457,12 +454,6 @@ class WidgetDAOReadOnly
      * WAC 2.0 extension
      * @return
      */
-    bool isWacSigned() const;
-
-    /**
-     * WAC 2.0 extension
-     * @return
-     */
     bool isDistributorSigned() const;
 
     /**
@@ -472,12 +463,6 @@ class WidgetDAOReadOnly
     bool isTrusted() const;
 
     /**
-     * WAC 2.0 extension
-     * @return is WAC test widget
-     */
-    bool isTestWidget() const;
-
-    /**
      * This method returns window mode of widget.
      *
      * @return window modes of widget
@@ -505,6 +490,13 @@ class WidgetDAOReadOnly
     DPL::OptionalString getCspPolicy() const;
 
     /**
+     * This method is used as a getter for report only csp policy of widget.
+     * It may be provided in configuration file.
+     * @return global csp report only policy for widget
+     */
+    DPL::OptionalString getCspPolicyReportOnly() const;
+
+    /**
      * This method returns list filed with Common Name entries from certificate.
      *
      * @return Common Name of Distribuotor End Entity certificate.
@@ -513,8 +505,8 @@ class WidgetDAOReadOnly
      *  DB table.
      */
     WidgetCertificateCNList getKeyCommonNameList(
-            WidgetCertificateData::Owner owner,
-            WidgetCertificateData::Type type) const;
+        WidgetCertificateData::Owner owner,
+        WidgetCertificateData::Type type) const;
 
     /**
      * given a certificate owner (author / distributor) and type of certificate
@@ -522,8 +514,8 @@ class WidgetDAOReadOnly
      * function returns list of matching fingerprints
      */
     FingerPrintList getKeyFingerprints(
-            WidgetCertificateData::Owner owner,
-            WidgetCertificateData::Type type) const;
+        WidgetCertificateData::Owner owner,
+        WidgetCertificateData::Type type) const;
 
     /*
      *  This method gets certificate data list for a widget from database.
@@ -543,7 +535,6 @@ class WidgetDAOReadOnly
      */
     DbWidgetFeatureSet getFeaturesList() const;
 
-    static WidgetParamMap getFeatureParams(int widgetFeatureId);
     /**
      * This method checks whether widget has specified feature.
      *
@@ -592,11 +583,16 @@ class WidgetDAOReadOnly
     static DbWidgetHandleList getHandleList();
 
     /**
-     * This method returns list of pkgname of installed packages
-     * @return list of pkgname of installed packages
+     * This method returns list of tizen application list of installed packages
+     * @return list of TizenAppIdList of installed packages
      */
     static TizenAppIdList getTizenAppidList();
-    static WidgetPkgNameList getPkgnameList();
+
+    /**
+     * This method returns list of tizen package list of installed packages
+     * @return list of TizenPkgIdList of installed packages
+     */
+    static TizenPkgIdList getTizenPkgidList();
 
     /**
      * This method returns a list of all the installed widgets.
@@ -608,15 +604,6 @@ class WidgetDAOReadOnly
      */
     static DbWidgetDAOReadOnlyList getWidgetList();
 
-   /**
-     * 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.
-     */
-    static void unregisterWidget(DbWidgetHandle widgetHandle);
-
     /**
      * This method gets author's infomation of a widget which is parsed from
      *  configiration document.
@@ -697,15 +684,10 @@ class WidgetDAOReadOnly
      */
     std::string getBaseFolder() const;
 
-    /* This method gets the parameter list for resource.
-     */
-    ResourceAttributeList getResourceAttribute(
-            const std::string &resourceId) const;
-
     /* This method checks read only flag for given property
      */
     DPL::OptionalInt checkPropertyReadFlag(
-            const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
+        const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
 
     /* This method gets widget property key list
      */
@@ -718,13 +700,11 @@ class WidgetDAOReadOnly
     /* This method get widget property value
      */
     PropertyDAOReadOnly::WidgetPropertyValue getPropertyValue(
-            const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
+        const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
 
     LanguageTagList getLanguageTags() const;
     LanguageTagList getIconLanguageTags() const;
 
-
-
     WidgetLocalizedInfo getLocalizedInfo(const DPL::String& languageTag) const;
     std::string getCookieDatabasePath() const;
     // Local storage
@@ -748,18 +728,18 @@ class WidgetDAOReadOnly
      * wrt-installer and wrt.
      */
     CertificateChainList getWidgetCertificate(
-            CertificateSource source = SIGNATURE_DISTRIBUTOR) const;
+        CertificateSource source = SIGNATURE_DISTRIBUTOR) const;
 
     void getWidgetSettings(WidgetSettings& outWidgetSettings) const;
 
     /**
-     * This method gets application service list that define AUL value
+     * This method gets application control list that define AUL value
      *
      * @return See above comment
      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
      */
-    void getAppServiceList(
-            WidgetApplicationServiceList& outAppServiceList) const;
+    void getAppControlList(
+        WidgetAppControlList& outAppControlList) const;
 
     /**
      * This method returns the type of the package.
@@ -767,7 +747,7 @@ class WidgetDAOReadOnly
      * @return PackagingType
      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
-                                                records in DB table.
+     *                                          records in DB table.
      */
     PackagingType getPackagingType() const;
 
@@ -783,13 +763,15 @@ class WidgetDAOReadOnly
     /**
      * @brief generateTizenId generates new package id
      *
-     * If widget do not supplies it's own tizen package id, this method can be used,
+     * If widget do not supplies it's own tizen package id, this method can be
+     * used,
      * although it should be removed in future.
      *
      * @return new tizen package id
      */
     static TizenPkgId generatePkgId();
-    static TizenPkgId generateTizenId() {
+    static TizenPkgId generateTizenId()
+    {
         return generatePkgId();
     }
 
@@ -806,7 +788,6 @@ class WidgetDAOReadOnly
     SettingsType getGeolocationUsage() const;
     SettingsType getWebNotificationUsage() const;
     SettingsType getWebDatabaseUsage() const;
-    SettingsType getFileSystemUsage() const;
 
     /**
      * This method returns widget's installed path
@@ -821,8 +802,10 @@ class WidgetDAOReadOnly
      * @return tizen package id
      */
     TizenPkgId getTizenPkgId() const;
-};
+    PrivilegeList getWidgetPrivilege() const;
+    WidgetSecurityModelVersion getSecurityModelVersion() const;
 
+};
 } // namespace WrtDB
 
 #endif // _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_