Modify installed path for preload widget.
[framework/web/wrt-commons.git] / modules / widget_dao / include / dpl / wrt-dao-ro / widget_dao_read_only.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /**
17  * This file contains the declaration of widget dao class.
18  *
19  * @file    widget_dao_read_only.h
20  * @author  Yang Jie (jie2.yang@samsung.com)
21  * @author  Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
22  * @author  Pawel Sikorski (p.sikorski@samsung.com)
23  * @version 1.0
24  * @brief   This file contains the declaration of widget dao
25  */
26
27 #ifndef _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
28 #define _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
29
30 #include <time.h>
31 #include <list>
32 #include <string>
33 #include <dpl/string.h>
34 #include <dpl/exception.h>
35 #include <dpl/db/orm.h>
36 #include <dpl/optional_typedefs.h>
37 #include <dpl/wrt-dao-ro/config_parser_data.h>
38 #include <dpl/wrt-dao-ro/property_dao_read_only.h>
39 #include <dpl/wrt-dao-ro/common_dao_types.h>
40
41 namespace WrtDB {
42
43 /**
44  * Widget's signature enum.
45  * This enumerates signature type of widget.
46  */
47 enum WidgetSignatureType
48 {
49     SIGNATURE_TYPE_CARRIER = 0,
50     SIGNATURE_TYPE_IDENTIFIED,
51     SIGNATURE_TYPE_UNIDENTIFIED
52 };
53
54 enum CertificateSource {
55     SIGNATURE_DISTRIBUTOR = 0,
56     SIGNATURE_AUTHOR = 1
57 };
58
59 typedef std::list<DPL::String> StringList;
60
61 struct WidgetLocalizedInfo
62 {
63     DPL::OptionalString name;
64     DPL::OptionalString shortName;
65     DPL::OptionalString description;
66     DPL::OptionalString license;
67     DPL::OptionalString licenseHref;
68 };
69
70 /**
71  * CertificateData
72  * A structure to hold certificate fingerprints.
73  */
74 struct WidgetCertificateData
75 {
76     enum Owner { AUTHOR, DISTRIBUTOR, UNKNOWN };
77     enum Type { ROOT, ENDENTITY };
78
79     // type of signature: author/distributor
80     Owner owner;
81     // indicates whether this is ca certificate
82     Type type;
83
84     // chain id number: relative BASE, where BASE is signatureBASE.xml
85     int chainId;
86     // certificate fingerprint digested by md5
87     std::string strMD5Fingerprint;
88     // certificate fingerprint digestef by sha1
89     std::string strSHA1Fingerprint;
90     // Common name field in certificate
91     DPL::String strCommonName;
92
93     bool operator== (const WidgetCertificateData& certData) const {
94         return certData.chainId == chainId &&
95            certData.owner == owner &&
96            certData.strCommonName == strCommonName &&
97            certData.strMD5Fingerprint == strMD5Fingerprint &&
98            certData.strSHA1Fingerprint == strSHA1Fingerprint;
99     }
100 };
101
102 typedef std::list<WidgetCertificateData> WidgetCertificateDataList;
103
104 typedef DPL::String Locale;
105 typedef std::set<Locale> LocaleSet;
106 typedef std::list<std::string> ExternalLocationList;
107
108 /**
109  * WidgetRegisterInfo
110  * A structure to hold widget's information needed to be registered.
111  * @see WidgetConfigurationInfo
112  */
113 struct WidgetRegisterInfo
114 {
115     struct LocalizedIcon : public ConfigParserData::Icon
116     {
117         LocalizedIcon(const ConfigParserData::Icon& icon,
118                 const LocaleSet& _availableLocales) :
119             ConfigParserData::Icon(icon),
120             availableLocales(_availableLocales)
121         {
122         }
123
124         LocaleSet availableLocales;
125     };
126
127     struct StartFileProperties
128     {
129         DPL::String encoding;
130         DPL::String type;
131     };
132
133     typedef std::map<Locale,
134                      StartFileProperties> StartFilePropertiesForLocalesMap;
135     struct LocalizedStartFile
136     {
137         DPL::String path;
138         StartFilePropertiesForLocalesMap propertiesForLocales;
139     };
140
141     typedef std::list<LocalizedIcon> LocalizedIconList;
142     typedef std::list<LocalizedStartFile> LocalizedStartFileList;
143     struct LocalizationData
144     {
145         LocalizedIconList icons;
146         LocalizedStartFileList startFiles;
147     };
148
149     enum SecurityDomain
150     {
151         Untrusted,
152         Trusted,
153         Operator,
154         None
155     };
156
157     //Constructor
158     WidgetRegisterInfo() :
159         webAppType(APP_TYPE_UNKNOWN),
160         signatureType(SIGNATURE_TYPE_UNIDENTIFIED),
161         isTestWidget(0),
162         configInfo(),
163         packagingType(PKG_TYPE_UNKNOWN)
164     {
165     }
166
167     WidgetType webAppType;
168     WidgetType type; // TODO : This type will be removed.
169     DPL::OptionalString guid;
170     DPL::OptionalString version;
171     DPL::OptionalString minVersion;
172     std::string shareHref;
173     std::string baseFolder;
174     WidgetSignatureType signatureType;
175     int isTestWidget;
176     ConfigParserData configInfo;
177     LocalizationData localizationData;
178     DPL::OptionalString pkgname;
179     time_t installedTime;
180     PackagingType packagingType;
181     EncryptedFileList encryptedFiles;
182     ExternalLocationList externalLocations;
183     DPL::OptionalString widgetInstalledPath;
184 };
185
186 typedef std::list<std::string> CertificateChainList;
187 class IWacSecurity
188 {
189   public:
190     virtual ~IWacSecurity();
191
192     virtual const WidgetCertificateDataList& getCertificateList() const = 0;
193
194     virtual bool isRecognized() const = 0;
195
196     virtual bool isDistributorSigned() const = 0;
197
198     virtual bool isWacSigned() const = 0;
199
200     virtual void getCertificateChainList(CertificateChainList& list,
201             CertificateSource source) const = 0;
202 };
203
204 /**
205  * WidgetAuthorInfo.
206  * Structure to hold the information of widget's author.
207  */
208 struct WidgetAuthorInfo
209 {
210     DPL::OptionalString name;
211     DPL::OptionalString email;
212     DPL::OptionalString href;
213 };
214
215 /**
216  * Widget update policy
217  */
218 enum WidgetUpdatePolicy
219 {
220     WIDGET_UPDATE_MONTHLY = 0,  //< monthly update
221     WIDGET_UPDATE_WEEKLY,       //< weekly update
222     WIDGET_UPDATE_DAILY,        //< daily update
223     WIDGET_UPDATE_STARTUP,      //< update when cell phone boots
224     WIDGET_UPDATE_NEVER         //< never update
225 };
226
227 typedef std::list <std::string> WidgetCertificateCNList;
228 typedef std::list<DPL::String> LanguageTagList;
229 typedef std::list<std::string> HostList;
230 typedef std::list<std::string> FingerPrintList;
231 typedef std::list<std::string> ResourceAttributeList;
232
233 class WidgetDAOReadOnly
234 {
235   public:
236     /**
237      * WidgetDAO Exception classes
238      */
239     class Exception
240     {
241       public:
242         DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
243         DECLARE_EXCEPTION_TYPE(Base, DatabaseError)
244         DECLARE_EXCEPTION_TYPE(Base, ReadOnlyProperty)
245         DECLARE_EXCEPTION_TYPE(Base, GUIDisNull)
246         DECLARE_EXCEPTION_TYPE(Base, UnexpectedEmptyResult)
247         DECLARE_EXCEPTION_TYPE(Base, WidgetNotExist)
248         DECLARE_EXCEPTION_TYPE(Base, AlreadyRegistered)
249     };
250
251   protected:
252     DbWidgetHandle m_widgetHandle;
253
254   public:
255     struct WidgetLocalizedIconRow
256     {
257         int appId;
258         int iconId;
259         DPL::String widgetLocale;
260     };
261     typedef std::list<WidgetLocalizedIconRow> WidgetLocalizedIconList;
262
263     struct WidgetIconRow
264     {
265         int iconId;
266         int appId;
267         DPL::String iconSrc;
268         DPL::OptionalInt iconWidth;
269         DPL::OptionalInt iconHeight;
270     };
271     typedef std::list<WidgetIconRow> WidgetIconList;
272
273     struct WidgetStartFileRow
274     {
275         int startFileId;
276         int appId;
277         DPL::String src;
278     };
279     typedef std::list<WidgetStartFileRow> WidgetStartFileList;
280
281     struct WidgetLocalizedStartFileRow
282     {
283         int startFileId;
284         int appId;
285         DPL::String widgetLocale;
286         DPL::String type;
287         DPL::String encoding;
288     };
289     typedef std::list<WidgetLocalizedStartFileRow> LocalizedStartFileList;
290
291     /**
292      * This is a constructor.
293      *
294      * @param[in] widgetHandle application id of widget.
295      */
296     WidgetDAOReadOnly(DbWidgetHandle widgetHandle);
297     WidgetDAOReadOnly(DPL::OptionalString widgetGUID);
298     WidgetDAOReadOnly(DPL::String pkgName);
299
300     /**
301      * Destructor
302      */
303     virtual ~WidgetDAOReadOnly();
304
305     /**
306      * This method returns widget handle(m_widgetHandle).
307      *
308      * @return widget handle(m_widgetHandle).
309      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
310      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
311      */
312     DbWidgetHandle getHandle() const;
313     static DbWidgetHandle getHandle(const WidgetGUID GUID);
314     static DbWidgetHandle getHandle(const DPL::String pkgName);
315
316     /**
317      * This method returns the root directory of widget resource.
318      *
319      * @return path name of root directory.
320      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
321      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
322      * DB table.
323      */
324     DPL::String getPath() const;
325
326     DPL::String getFullPath() const;
327
328     /**
329      * This method returns the preferred size of the widget,
330      * including width and height.
331      *
332      * @see DbWidgetSize
333      * @return An structure type variable to hold widget's size.
334      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
335      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
336      *                                          DB table.
337      */
338     DbWidgetSize getPreferredSize() const;
339
340     /**
341      * This method returns the type of the widget.
342      *
343      * @return WidgetType
344      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
345      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
346                                                 records in DB table.
347      */
348     WidgetType getWidgetType() const;
349
350     /**
351      * This method returns the id of the widget.
352      *
353      * @return widget id
354      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
355      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
356      *  DB table.
357      */
358     WidgetGUID getGUID() const;
359
360     /**
361      * This method returns the Package name of the widget.
362      *
363      * @return pkgname
364      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
365      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
366      */
367     DPL::OptionalString getPkgname() const;
368
369     /**
370      * This method returns the defaultlocale for the widget.
371      *
372      * @return defaultlocale
373      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
374      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
375      *  DB table.
376      */
377     DPL::OptionalString getDefaultlocale() const;
378
379     /**
380      * This method returns list of localized icons files;
381      *
382      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
383      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
384      *  DB table.
385      */
386     WidgetLocalizedIconList getLocalizedIconList() const;
387
388     /**
389      * This method returns list of icons files;
390      *
391      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
392      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
393      *  DB table.
394      */
395     WidgetIconList getIconList() const;
396
397     /**
398      * This method returns list of localized start files;
399      *
400      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
401      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
402      *  DB table.
403      */
404     LocalizedStartFileList getLocalizedStartFileList() const;
405
406     /**
407      * This method returns list of start files;
408      *
409      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
410      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
411      *  DB table.
412      */
413     WidgetStartFileList getStartFileList() const;
414
415     /**
416      * @param[out] outAccessInfoList list filled with access info structures
417      */
418     void getWidgetAccessInfo(WidgetAccessInfoList& outAccessInfoList) const;
419
420     /**
421      * WAC 2.0 extension
422      * @return recognized status
423      */
424     bool isRecognized() const;
425
426     /**
427      * WAC 2.0 extension
428      * @return
429      */
430     bool isWacSigned() const;
431
432     /**
433      * WAC 2.0 extension
434      * @return
435      */
436     bool isDistributorSigned() const;
437
438     /**
439      * WAC 2.0 extension
440      * @return trusted status
441      */
442     bool isTrusted() const;
443
444     /**
445      * WAC 2.0 extension
446      * @return is WAC test widget
447      */
448     bool isTestWidget() const;
449
450     /**
451      * This method returns window mode of widget.
452      *
453      * @return window modes of widget
454      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
455      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
456      *  DB table.
457      */
458     WindowModeList getWindowModes() const;
459
460     /**
461      * This method returns the version of the widget.
462      *
463      * @return version of widget
464      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
465      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
466      *  DB table.
467      */
468     DPL::OptionalString getVersion() const;
469
470     /**
471      * This method returns list filed with Common Name entries from certificate.
472      *
473      * @return Common Name of Distribuotor End Entity certificate.
474      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
475      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
476      *  DB table.
477      */
478     WidgetCertificateCNList getKeyCommonNameList(
479             WidgetCertificateData::Owner owner,
480             WidgetCertificateData::Type type) const;
481
482     /**
483      * given a certificate owner (author / distributor) and type of certificate
484      * (end entity / ca)
485      * function returns list of matching fingerprints
486      */
487     FingerPrintList getKeyFingerprints(
488             WidgetCertificateData::Owner owner,
489             WidgetCertificateData::Type type) const;
490
491     /*
492      *  This method gets certificate data list for a widget from database.
493      */
494     WidgetCertificateDataList getCertificateDataList() const;
495
496     /**
497      * This method returns a list of widget features.
498      *
499      * @see WidgetFeature
500      * @see FreeFeatureList()
501      * @return list of widget features, type of list element is structure
502      *  WidgetFeature
503      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
504      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
505      *  DB table.
506      */
507     DbWidgetFeatureSet getFeaturesList() const;
508
509     static WidgetParamMap getFeatureParams(int widgetFeatureId);
510     /**
511      * This method checks whether widget has specified feature.
512      *
513      * @return true if has, false if has not
514      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
515      */
516     bool hasFeature(const std::string& featureName) const;
517
518     /**
519      * This method gets host list that widget can connect to.
520      *
521      * @return See above comment
522      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
523      */
524     HostList getAccessHostList() const;
525
526     /**
527      * This method gets widget's access on network: true or false.
528      *
529      * @return true: widget can access network; false: widget can not access
530      *  network.
531      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
532      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
533      *  DB table.
534      */
535     bool getAccessNetworkMode() const;
536
537     /**
538      * This method gets if widget needs webkit plugins enabled
539      *
540      * @return true: widget needs webkit plugins enabled
541      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
542      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
543      *  DB table.
544      */
545     bool getWebkitPluginsRequired() const;
546
547     /**
548      * This method returns a list of all the installed widgets' app id.
549      *
550      * @return list of installed widgets' app id.
551      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
552      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
553      *  DB table.
554      */
555     static DbWidgetHandleList getHandleList();
556
557     /**
558      * This method returns list of pkgname of installed packages
559      * @return list of pkgname of installed packages
560      */
561     static WidgetPkgNameList getPkgnameList();
562
563     /**
564      * This method returns a list of all the installed widgets.
565      *
566      * @return list of installed widgets.
567      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
568      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
569      *  DB table.
570      */
571     static DbWidgetDAOReadOnlyList getWidgetList();
572
573    /**
574      * This method removes a widget's information from EmDB.
575      *
576      * @see RegisterWidget()
577      * @param[in] widgetHandle    widget's app id
578      * @return true if succeed, false if fail.
579      */
580     static void unregisterWidget(DbWidgetHandle widgetHandle);
581
582     /**
583      * This method gets author's infomation of a widget which is parsed from
584      *  configiration document.
585      *
586      * @see WidgetAuthorInfo
587      * @param[out] pAuthorInfo
588      * @return true if succeed, false if fail.
589      */
590     WidgetAuthorInfo getAuthorInfo() const;
591
592     /**
593      * This method gets author's name of a widget which is parsed from
594      *  configiration document.
595      *
596      * @param[out] pAuthorInfo
597      * @return author's name.
598      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
599      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
600      *  DB table.
601      */
602     DPL::OptionalString getAuthorName() const;
603
604     /**
605      * This method gets author's email of a widget which is parsed from
606      *  configiration document.
607      *
608      * @param[out] pAuthorInfo
609      * @return author's email.
610      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
611      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
612      *  DB table.
613      */
614     DPL::OptionalString getAuthorEmail() const;
615
616     /**
617      * This method gets author's email of a widget which is parsed from
618      *  configiration document.
619      *
620      * @param[out] pAuthorInfo
621      * @return author's email.
622      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
623      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
624      *  DB table.
625      */
626     DPL::OptionalString getAuthorHref() const;
627
628     /**
629      * This method returns minimum version of WAC that WRT has to be compliant
630      *  to to run this widget
631      *
632      * @return Minimum version
633      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
634      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
635      *  DB table.
636      */
637     DPL::OptionalString getMinimumWacVersion() const;
638
639     /* This method get widget' share href.
640      *
641      * @return widget's share href
642      */
643     std::string getShareHref() const;
644
645     /**
646      * This method get widget installed time
647      *
648      * @return time_t : return widget's install time
649      */
650     time_t getInstallTime() const;
651
652     /**
653      * This method gets widget base folder.
654      *
655      * @return widget base folder.
656      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
657      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
658      *  DB table.
659      */
660     std::string getBaseFolder() const;
661
662     /* This method gets the parameter list for resource.
663      */
664     ResourceAttributeList getResourceAttribute(
665             const std::string &resourceId) const;
666
667     /* This method checks read only flag for given property
668      */
669     DPL::OptionalInt checkPropertyReadFlag(
670             const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
671
672     /* This method gets widget property key list
673      */
674     PropertyDAOReadOnly::WidgetPropertyKeyList getPropertyKeyList() const;
675
676     /* This method gets widget property list
677      */
678     PropertyDAOReadOnly::WidgetPreferenceList getPropertyList() const;
679
680     /* This method get widget property value
681      */
682     PropertyDAOReadOnly::WidgetPropertyValue getPropertyValue(
683             const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
684
685     LanguageTagList getLanguageTags() const;
686     LanguageTagList getIconLanguageTags() const;
687
688
689
690     WidgetLocalizedInfo getLocalizedInfo(const DPL::String& languageTag) const;
691     std::string getCookieDatabasePath() const;
692     // Local storage
693     std::string getPrivateLocalStoragePath() const;
694
695     bool getBackSupported() const;
696
697     static bool isWidgetInstalled(DbWidgetHandle handle);
698     static bool isWidgetInstalled(const WidgetPkgName & pkgName);
699
700     /* This method get path of the splash image.
701      *
702      * @return path of the widget's splash image
703      */
704     DPL::OptionalString getSplashImgSrc() const;
705
706     ExternalLocationList getWidgetExternalLocations() const;
707
708     /*
709      * Default value is required to keep compatibility with
710      * wrt-installer and wrt.
711      */
712     CertificateChainList getWidgetCertificate(
713             CertificateSource source = SIGNATURE_DISTRIBUTOR) const;
714
715     void getWidgetSettings(WidgetSettings& outWidgetSettings) const;
716
717     /**
718      * This method gets application service list that define AUL value
719      *
720      * @return See above comment
721      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
722      */
723     void getAppServiceList(
724             WidgetApplicationServiceList& outAppServiceList) const;
725
726     /**
727      * This method returns the type of the package.
728      *
729      * @return PackagingType
730      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
731      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
732                                                 records in DB table.
733      */
734     PackagingType getPackagingType() const;
735
736     void getEncryptedFileList(EncryptedFileList& filesList) const;
737
738     /**
739      * This method returns widget's background page filename.
740      *
741      * @return Name of file containing background page
742      */
743     DPL::OptionalString getBackgroundPage() const;
744
745     /**
746      * @brief generateTizenId generates new tizen id
747      *
748      * If widget do not supplies it's own tizen id, this method can be used,
749      * although it should be removed in future.
750      *
751      * @return new tizen id
752      */
753     static WidgetPkgName generateTizenId();
754
755     /**
756      * @brief This method return each value for security setting
757      *
758      * @return SettingsType
759      *         SETTINGS_TYPE_UNKNOWN     : unknow value
760      *         SETTINGS_TYPE_ON                : enable
761      *         SETTINGS_TYPE_ALWAYS_ASK : ask by popup
762      *         SETTINGS_TYPE_OFF               : disable
763      */
764     SettingsType getSecurityPopupUsage() const;
765     SettingsType getGeolocationUsage() const;
766     SettingsType getWebNotificationUsage() const;
767     SettingsType getWebDatabaseUsage() const;
768     SettingsType getFileSystemUsage() const;
769
770     /**
771      * This method returns widget's installed path
772      *
773      * @return path of widget installed
774      */
775     DPL::OptionalString getWidgetInstalledPath() const;
776 };
777
778 } // namespace WrtDB
779
780 #endif // _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
781