8be742c65b0a3d5212e3730dbfe91dd0e22546ac
[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
179     DPL::OptionalString pkgname;
180     WidgetPkgName pkgName;
181
182     time_t installedTime;
183     PackagingType packagingType;
184     EncryptedFileList encryptedFiles;
185     ExternalLocationList externalLocations;
186     DPL::OptionalString widgetInstalledPath;
187 };
188
189 typedef std::list<std::string> CertificateChainList;
190 class IWacSecurity
191 {
192   public:
193     virtual ~IWacSecurity();
194
195     virtual const WidgetCertificateDataList& getCertificateList() const = 0;
196
197     virtual bool isRecognized() const = 0;
198
199     virtual bool isDistributorSigned() const = 0;
200
201     virtual bool isWacSigned() const = 0;
202
203     virtual void getCertificateChainList(CertificateChainList& list,
204             CertificateSource source) const = 0;
205 };
206
207 /**
208  * WidgetAuthorInfo.
209  * Structure to hold the information of widget's author.
210  */
211 struct WidgetAuthorInfo
212 {
213     DPL::OptionalString name;
214     DPL::OptionalString email;
215     DPL::OptionalString href;
216 };
217
218 /**
219  * Widget update policy
220  */
221 enum WidgetUpdatePolicy
222 {
223     WIDGET_UPDATE_MONTHLY = 0,  //< monthly update
224     WIDGET_UPDATE_WEEKLY,       //< weekly update
225     WIDGET_UPDATE_DAILY,        //< daily update
226     WIDGET_UPDATE_STARTUP,      //< update when cell phone boots
227     WIDGET_UPDATE_NEVER         //< never update
228 };
229
230 typedef std::list <std::string> WidgetCertificateCNList;
231 typedef std::list<DPL::String> LanguageTagList;
232 typedef std::list<std::string> HostList;
233 typedef std::list<std::string> FingerPrintList;
234 typedef std::list<std::string> ResourceAttributeList;
235
236 class WidgetDAOReadOnly
237 {
238   public:
239     /**
240      * WidgetDAO Exception classes
241      */
242     class Exception
243     {
244       public:
245         DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
246         DECLARE_EXCEPTION_TYPE(Base, DatabaseError)
247         DECLARE_EXCEPTION_TYPE(Base, ReadOnlyProperty)
248         DECLARE_EXCEPTION_TYPE(Base, GUIDisNull)
249         DECLARE_EXCEPTION_TYPE(Base, UnexpectedEmptyResult)
250         DECLARE_EXCEPTION_TYPE(Base, WidgetNotExist)
251         DECLARE_EXCEPTION_TYPE(Base, AlreadyRegistered)
252     };
253
254   protected:
255     DbWidgetHandle m_widgetHandle;
256
257   public:
258     struct WidgetLocalizedIconRow
259     {
260         int appId;
261         int iconId;
262         DPL::String widgetLocale;
263     };
264     typedef std::list<WidgetLocalizedIconRow> WidgetLocalizedIconList;
265
266     struct WidgetIconRow
267     {
268         int iconId;
269         int appId;
270         DPL::String iconSrc;
271         DPL::OptionalInt iconWidth;
272         DPL::OptionalInt iconHeight;
273     };
274     typedef std::list<WidgetIconRow> WidgetIconList;
275
276     struct WidgetStartFileRow
277     {
278         int startFileId;
279         int appId;
280         DPL::String src;
281     };
282     typedef std::list<WidgetStartFileRow> WidgetStartFileList;
283
284     struct WidgetLocalizedStartFileRow
285     {
286         int startFileId;
287         int appId;
288         DPL::String widgetLocale;
289         DPL::String type;
290         DPL::String encoding;
291     };
292     typedef std::list<WidgetLocalizedStartFileRow> LocalizedStartFileList;
293
294     /**
295      * This is a constructor.
296      *
297      * @param[in] widgetHandle application id of widget.
298      */
299     WidgetDAOReadOnly(DbWidgetHandle widgetHandle);
300     WidgetDAOReadOnly(DPL::OptionalString widgetGUID);
301     WidgetDAOReadOnly(DPL::String pkgName);
302
303     /**
304      * Destructor
305      */
306     virtual ~WidgetDAOReadOnly();
307
308     /**
309      * This method returns widget handle(m_widgetHandle).
310      *
311      * @return widget handle(m_widgetHandle).
312      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
313      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
314      */
315     DbWidgetHandle getHandle() const;
316     static DbWidgetHandle getHandle(const WidgetGUID GUID);
317     static DbWidgetHandle getHandle(const DPL::String pkgName);
318
319     /**
320      * Returns pkgname for the specified widget
321      *
322      * @return pkgname
323      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
324      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
325      */
326     WidgetPkgName getPkgName() const;
327     static WidgetPkgName getPkgName(const WidgetGUID GUID);
328     static WidgetPkgName getPkgName(const DbWidgetHandle handle);
329
330     /**
331      * This method returns the root directory of widget resource.
332      *
333      * @return path name of root directory.
334      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
335      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
336      * DB table.
337      */
338     DPL::String getPath() const;
339
340     DPL::String getFullPath() const;
341
342     /**
343      * This method returns the preferred size of the widget,
344      * including width and height.
345      *
346      * @see DbWidgetSize
347      * @return An structure type variable to hold widget's size.
348      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
349      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
350      *                                          DB table.
351      */
352     DbWidgetSize getPreferredSize() const;
353
354     /**
355      * This method returns the type of the widget.
356      *
357      * @return WidgetType
358      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
359      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
360                                                 records in DB table.
361      */
362     WidgetType getWidgetType() const;
363
364     /**
365      * This method returns the id of the widget.
366      *
367      * @return widget id
368      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
369      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
370      *  DB table.
371      */
372     WidgetGUID getGUID() const;
373
374
375     /**
376      * This method returns the defaultlocale for the widget.
377      *
378      * @return defaultlocale
379      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
380      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
381      *  DB table.
382      */
383     DPL::OptionalString getDefaultlocale() const;
384
385     /**
386      * This method returns list of localized icons files;
387      *
388      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
389      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
390      *  DB table.
391      */
392     WidgetLocalizedIconList getLocalizedIconList() const;
393
394     /**
395      * This method returns list of icons files;
396      *
397      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
398      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
399      *  DB table.
400      */
401     WidgetIconList getIconList() const;
402
403     /**
404      * This method returns list of localized start files;
405      *
406      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
407      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
408      *  DB table.
409      */
410     LocalizedStartFileList getLocalizedStartFileList() const;
411
412     /**
413      * This method returns list of start files;
414      *
415      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
416      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
417      *  DB table.
418      */
419     WidgetStartFileList getStartFileList() const;
420
421     /**
422      * @param[out] outAccessInfoList list filled with access info structures
423      */
424     void getWidgetAccessInfo(WidgetAccessInfoList& outAccessInfoList) const;
425
426     /**
427      * WAC 2.0 extension
428      * @return recognized status
429      */
430     bool isRecognized() const;
431
432     /**
433      * WAC 2.0 extension
434      * @return
435      */
436     bool isWacSigned() const;
437
438     /**
439      * WAC 2.0 extension
440      * @return
441      */
442     bool isDistributorSigned() const;
443
444     /**
445      * WAC 2.0 extension
446      * @return trusted status
447      */
448     bool isTrusted() const;
449
450     /**
451      * WAC 2.0 extension
452      * @return is WAC test widget
453      */
454     bool isTestWidget() const;
455
456     /**
457      * This method returns window mode of widget.
458      *
459      * @return window modes of widget
460      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
461      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
462      *  DB table.
463      */
464     WindowModeList getWindowModes() const;
465
466     /**
467      * This method returns the version of the widget.
468      *
469      * @return version of widget
470      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
471      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
472      *  DB table.
473      */
474     DPL::OptionalString getVersion() const;
475
476     /**
477      * This method returns list filed with Common Name entries from certificate.
478      *
479      * @return Common Name of Distribuotor End Entity certificate.
480      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
481      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
482      *  DB table.
483      */
484     WidgetCertificateCNList getKeyCommonNameList(
485             WidgetCertificateData::Owner owner,
486             WidgetCertificateData::Type type) const;
487
488     /**
489      * given a certificate owner (author / distributor) and type of certificate
490      * (end entity / ca)
491      * function returns list of matching fingerprints
492      */
493     FingerPrintList getKeyFingerprints(
494             WidgetCertificateData::Owner owner,
495             WidgetCertificateData::Type type) const;
496
497     /*
498      *  This method gets certificate data list for a widget from database.
499      */
500     WidgetCertificateDataList getCertificateDataList() const;
501
502     /**
503      * This method returns a list of widget features.
504      *
505      * @see WidgetFeature
506      * @see FreeFeatureList()
507      * @return list of widget features, type of list element is structure
508      *  WidgetFeature
509      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
510      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
511      *  DB table.
512      */
513     DbWidgetFeatureSet getFeaturesList() const;
514
515     static WidgetParamMap getFeatureParams(int widgetFeatureId);
516     /**
517      * This method checks whether widget has specified feature.
518      *
519      * @return true if has, false if has not
520      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
521      */
522     bool hasFeature(const std::string& featureName) const;
523
524     /**
525      * This method gets host list that widget can connect to.
526      *
527      * @return See above comment
528      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
529      */
530     HostList getAccessHostList() const;
531
532     /**
533      * This method gets widget's access on network: true or false.
534      *
535      * @return true: widget can access network; false: widget can not access
536      *  network.
537      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
538      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
539      *  DB table.
540      */
541     bool getAccessNetworkMode() const;
542
543     /**
544      * This method gets if widget needs webkit plugins enabled
545      *
546      * @return true: widget needs webkit plugins enabled
547      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
548      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
549      *  DB table.
550      */
551     bool getWebkitPluginsRequired() const;
552
553     /**
554      * This method returns a list of all the installed widgets' app id.
555      *
556      * @return list of installed widgets' app id.
557      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
558      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
559      *  DB table.
560      */
561     static DbWidgetHandleList getHandleList();
562
563     /**
564      * This method returns list of pkgname of installed packages
565      * @return list of pkgname of installed packages
566      */
567     static WidgetPkgNameList getPkgnameList();
568
569     /**
570      * This method returns a list of all the installed widgets.
571      *
572      * @return list of installed widgets.
573      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
574      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
575      *  DB table.
576      */
577     static DbWidgetDAOReadOnlyList getWidgetList();
578
579    /**
580      * This method removes a widget's information from EmDB.
581      *
582      * @see RegisterWidget()
583      * @param[in] widgetHandle    widget's app id
584      * @return true if succeed, false if fail.
585      */
586     static void unregisterWidget(DbWidgetHandle widgetHandle);
587
588     /**
589      * This method gets author's infomation of a widget which is parsed from
590      *  configiration document.
591      *
592      * @see WidgetAuthorInfo
593      * @param[out] pAuthorInfo
594      * @return true if succeed, false if fail.
595      */
596     WidgetAuthorInfo getAuthorInfo() const;
597
598     /**
599      * This method gets author's name of a widget which is parsed from
600      *  configiration document.
601      *
602      * @param[out] pAuthorInfo
603      * @return author's name.
604      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
605      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
606      *  DB table.
607      */
608     DPL::OptionalString getAuthorName() const;
609
610     /**
611      * This method gets author's email of a widget which is parsed from
612      *  configiration document.
613      *
614      * @param[out] pAuthorInfo
615      * @return author's email.
616      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
617      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
618      *  DB table.
619      */
620     DPL::OptionalString getAuthorEmail() const;
621
622     /**
623      * This method gets author's email of a widget which is parsed from
624      *  configiration document.
625      *
626      * @param[out] pAuthorInfo
627      * @return author's email.
628      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
629      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
630      *  DB table.
631      */
632     DPL::OptionalString getAuthorHref() const;
633
634     /**
635      * This method returns minimum version of WAC that WRT has to be compliant
636      *  to to run this widget
637      *
638      * @return Minimum version
639      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
640      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
641      *  DB table.
642      */
643     DPL::OptionalString getMinimumWacVersion() const;
644
645     /* This method get widget' share href.
646      *
647      * @return widget's share href
648      */
649     std::string getShareHref() const;
650
651     /**
652      * This method get widget installed time
653      *
654      * @return time_t : return widget's install time
655      */
656     time_t getInstallTime() const;
657
658     /**
659      * This method gets widget base folder.
660      *
661      * @return widget base folder.
662      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
663      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
664      *  DB table.
665      */
666     std::string getBaseFolder() const;
667
668     /* This method gets the parameter list for resource.
669      */
670     ResourceAttributeList getResourceAttribute(
671             const std::string &resourceId) const;
672
673     /* This method checks read only flag for given property
674      */
675     DPL::OptionalInt checkPropertyReadFlag(
676             const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
677
678     /* This method gets widget property key list
679      */
680     PropertyDAOReadOnly::WidgetPropertyKeyList getPropertyKeyList() const;
681
682     /* This method gets widget property list
683      */
684     PropertyDAOReadOnly::WidgetPreferenceList getPropertyList() const;
685
686     /* This method get widget property value
687      */
688     PropertyDAOReadOnly::WidgetPropertyValue getPropertyValue(
689             const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
690
691     LanguageTagList getLanguageTags() const;
692     LanguageTagList getIconLanguageTags() const;
693
694
695
696     WidgetLocalizedInfo getLocalizedInfo(const DPL::String& languageTag) const;
697     std::string getCookieDatabasePath() const;
698     // Local storage
699     std::string getPrivateLocalStoragePath() const;
700
701     bool getBackSupported() const;
702
703     static bool isWidgetInstalled(DbWidgetHandle handle);
704     static bool isWidgetInstalled(const WidgetPkgName & pkgName);
705
706     /* This method get path of the splash image.
707      *
708      * @return path of the widget's splash image
709      */
710     DPL::OptionalString getSplashImgSrc() const;
711
712     ExternalLocationList getWidgetExternalLocations() const;
713
714     /*
715      * Default value is required to keep compatibility with
716      * wrt-installer and wrt.
717      */
718     CertificateChainList getWidgetCertificate(
719             CertificateSource source = SIGNATURE_DISTRIBUTOR) const;
720
721     void getWidgetSettings(WidgetSettings& outWidgetSettings) const;
722
723     /**
724      * This method gets application service list that define AUL value
725      *
726      * @return See above comment
727      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
728      */
729     void getAppServiceList(
730             WidgetApplicationServiceList& outAppServiceList) const;
731
732     /**
733      * This method returns the type of the package.
734      *
735      * @return PackagingType
736      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
737      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
738                                                 records in DB table.
739      */
740     PackagingType getPackagingType() const;
741
742     void getEncryptedFileList(EncryptedFileList& filesList) const;
743
744     /**
745      * This method returns widget's background page filename.
746      *
747      * @return Name of file containing background page
748      */
749     DPL::OptionalString getBackgroundPage() const;
750
751     /**
752      * @brief generateTizenId generates new tizen id
753      *
754      * If widget do not supplies it's own tizen id, this method can be used,
755      * although it should be removed in future.
756      *
757      * @return new tizen id
758      */
759     static WidgetPkgName generateTizenId();
760
761     /**
762      * @brief This method return each value for security setting
763      *
764      * @return SettingsType
765      *         SETTINGS_TYPE_UNKNOWN     : unknow value
766      *         SETTINGS_TYPE_ON                : enable
767      *         SETTINGS_TYPE_ALWAYS_ASK : ask by popup
768      *         SETTINGS_TYPE_OFF               : disable
769      */
770     SettingsType getSecurityPopupUsage() const;
771     SettingsType getGeolocationUsage() const;
772     SettingsType getWebNotificationUsage() const;
773     SettingsType getWebDatabaseUsage() const;
774     SettingsType getFileSystemUsage() const;
775
776     /**
777      * This method returns widget's installed path
778      *
779      * @return path of widget installed
780      */
781     DPL::OptionalString getWidgetInstalledPath() const;
782 };
783
784 } // namespace WrtDB
785
786 #endif // _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
787