Pkgname (tizen id) - not null
[platform/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     DPL::String pkgname_NOTNULL;
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      * This method returns the root directory of widget resource.
321      *
322      * @return path name of root directory.
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
325      * DB table.
326      */
327     DPL::String getPath() const;
328
329     DPL::String getFullPath() const;
330
331     /**
332      * This method returns the preferred size of the widget,
333      * including width and height.
334      *
335      * @see DbWidgetSize
336      * @return An structure type variable to hold widget's size.
337      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
338      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
339      *                                          DB table.
340      */
341     DbWidgetSize getPreferredSize() const;
342
343     /**
344      * This method returns the type of the widget.
345      *
346      * @return WidgetType
347      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
348      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
349                                                 records in DB table.
350      */
351     WidgetType getWidgetType() const;
352
353     /**
354      * This method returns the id of the widget.
355      *
356      * @return widget id
357      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
358      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
359      *  DB table.
360      */
361     WidgetGUID getGUID() const;
362
363     /**
364      * This method returns the Package name of the widget.
365      *
366      * @return pkgname
367      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
368      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
369      */
370     DPL::OptionalString getPkgname() const;
371
372     DPL::String getPkgname_NOTNULL() const;
373
374     /**
375      * This method returns the defaultlocale for the widget.
376      *
377      * @return defaultlocale
378      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
379      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
380      *  DB table.
381      */
382     DPL::OptionalString getDefaultlocale() const;
383
384     /**
385      * This method returns list of localized icons files;
386      *
387      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
388      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
389      *  DB table.
390      */
391     WidgetLocalizedIconList getLocalizedIconList() const;
392
393     /**
394      * This method returns list of icons files;
395      *
396      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
397      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
398      *  DB table.
399      */
400     WidgetIconList getIconList() const;
401
402     /**
403      * This method returns list of localized start files;
404      *
405      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
406      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
407      *  DB table.
408      */
409     LocalizedStartFileList getLocalizedStartFileList() const;
410
411     /**
412      * This method returns list of start files;
413      *
414      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
415      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
416      *  DB table.
417      */
418     WidgetStartFileList getStartFileList() const;
419
420     /**
421      * @param[out] outAccessInfoList list filled with access info structures
422      */
423     void getWidgetAccessInfo(WidgetAccessInfoList& outAccessInfoList) const;
424
425     /**
426      * WAC 2.0 extension
427      * @return recognized status
428      */
429     bool isRecognized() const;
430
431     /**
432      * WAC 2.0 extension
433      * @return
434      */
435     bool isWacSigned() const;
436
437     /**
438      * WAC 2.0 extension
439      * @return
440      */
441     bool isDistributorSigned() const;
442
443     /**
444      * WAC 2.0 extension
445      * @return trusted status
446      */
447     bool isTrusted() const;
448
449     /**
450      * WAC 2.0 extension
451      * @return is WAC test widget
452      */
453     bool isTestWidget() const;
454
455     /**
456      * This method returns window mode of widget.
457      *
458      * @return window modes of widget
459      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
460      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
461      *  DB table.
462      */
463     WindowModeList getWindowModes() const;
464
465     /**
466      * This method returns the version of the widget.
467      *
468      * @return version of widget
469      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
470      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
471      *  DB table.
472      */
473     DPL::OptionalString getVersion() const;
474
475     /**
476      * This method returns list filed with Common Name entries from certificate.
477      *
478      * @return Common Name of Distribuotor End Entity certificate.
479      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
480      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
481      *  DB table.
482      */
483     WidgetCertificateCNList getKeyCommonNameList(
484             WidgetCertificateData::Owner owner,
485             WidgetCertificateData::Type type) const;
486
487     /**
488      * given a certificate owner (author / distributor) and type of certificate
489      * (end entity / ca)
490      * function returns list of matching fingerprints
491      */
492     FingerPrintList getKeyFingerprints(
493             WidgetCertificateData::Owner owner,
494             WidgetCertificateData::Type type) const;
495
496     /*
497      *  This method gets certificate data list for a widget from database.
498      */
499     WidgetCertificateDataList getCertificateDataList() const;
500
501     /**
502      * This method returns a list of widget features.
503      *
504      * @see WidgetFeature
505      * @see FreeFeatureList()
506      * @return list of widget features, type of list element is structure
507      *  WidgetFeature
508      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
509      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
510      *  DB table.
511      */
512     DbWidgetFeatureSet getFeaturesList() const;
513
514     static WidgetParamMap getFeatureParams(int widgetFeatureId);
515     /**
516      * This method checks whether widget has specified feature.
517      *
518      * @return true if has, false if has not
519      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
520      */
521     bool hasFeature(const std::string& featureName) const;
522
523     /**
524      * This method gets host list that widget can connect to.
525      *
526      * @return See above comment
527      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
528      */
529     HostList getAccessHostList() const;
530
531     /**
532      * This method gets widget's access on network: true or false.
533      *
534      * @return true: widget can access network; false: widget can not access
535      *  network.
536      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
537      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
538      *  DB table.
539      */
540     bool getAccessNetworkMode() const;
541
542     /**
543      * This method gets if widget needs webkit plugins enabled
544      *
545      * @return true: widget needs webkit plugins enabled
546      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
547      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
548      *  DB table.
549      */
550     bool getWebkitPluginsRequired() const;
551
552     /**
553      * This method returns a list of all the installed widgets' app id.
554      *
555      * @return list of installed widgets' app id.
556      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
557      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
558      *  DB table.
559      */
560     static DbWidgetHandleList getHandleList();
561
562     /**
563      * This method returns list of pkgname of installed packages
564      * @return list of pkgname of installed packages
565      */
566     static WidgetPkgNameList getPkgnameList();
567     static WidgetPkgNameList_NOTNULL getPkgnameList_NOTNULL();
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      * This method removes a widget's information from EmDB.
580      *
581      * @see RegisterWidget()
582      * @param[in] widgetHandle    widget's app id
583      * @return true if succeed, false if fail.
584      */
585     static void unregisterWidget(DbWidgetHandle widgetHandle);
586
587     /**
588      * This method gets author's infomation of a widget which is parsed from
589      *  configiration document.
590      *
591      * @see WidgetAuthorInfo
592      * @param[out] pAuthorInfo
593      * @return true if succeed, false if fail.
594      */
595     WidgetAuthorInfo getAuthorInfo() const;
596
597     /**
598      * This method gets author's name of a widget which is parsed from
599      *  configiration document.
600      *
601      * @param[out] pAuthorInfo
602      * @return author's name.
603      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
604      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
605      *  DB table.
606      */
607     DPL::OptionalString getAuthorName() const;
608
609     /**
610      * This method gets author's email of a widget which is parsed from
611      *  configiration document.
612      *
613      * @param[out] pAuthorInfo
614      * @return author's email.
615      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
616      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
617      *  DB table.
618      */
619     DPL::OptionalString getAuthorEmail() const;
620
621     /**
622      * This method gets author's email of a widget which is parsed from
623      *  configiration document.
624      *
625      * @param[out] pAuthorInfo
626      * @return author's email.
627      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
628      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
629      *  DB table.
630      */
631     DPL::OptionalString getAuthorHref() const;
632
633     /**
634      * This method returns minimum version of WAC that WRT has to be compliant
635      *  to to run this widget
636      *
637      * @return Minimum version
638      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
639      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
640      *  DB table.
641      */
642     DPL::OptionalString getMinimumWacVersion() const;
643
644     /* This method get widget' share href.
645      *
646      * @return widget's share href
647      */
648     std::string getShareHref() const;
649
650     /**
651      * This method get widget installed time
652      *
653      * @return time_t : return widget's install time
654      */
655     time_t getInstallTime() const;
656
657     /**
658      * This method gets widget base folder.
659      *
660      * @return widget base folder.
661      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
662      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
663      *  DB table.
664      */
665     std::string getBaseFolder() const;
666
667     /* This method gets the parameter list for resource.
668      */
669     ResourceAttributeList getResourceAttribute(
670             const std::string &resourceId) const;
671
672     /* This method checks read only flag for given property
673      */
674     DPL::OptionalInt checkPropertyReadFlag(
675             const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
676
677     /* This method gets widget property key list
678      */
679     PropertyDAOReadOnly::WidgetPropertyKeyList getPropertyKeyList() const;
680
681     /* This method gets widget property list
682      */
683     PropertyDAOReadOnly::WidgetPreferenceList getPropertyList() const;
684
685     /* This method get widget property value
686      */
687     PropertyDAOReadOnly::WidgetPropertyValue getPropertyValue(
688             const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
689
690     LanguageTagList getLanguageTags() const;
691     LanguageTagList getIconLanguageTags() const;
692
693
694
695     WidgetLocalizedInfo getLocalizedInfo(const DPL::String& languageTag) const;
696     std::string getCookieDatabasePath() const;
697     // Local storage
698     std::string getPrivateLocalStoragePath() const;
699
700     bool getBackSupported() const;
701
702     static bool isWidgetInstalled(DbWidgetHandle handle);
703     static bool isWidgetInstalled(const WidgetPkgName & pkgName);
704
705     /* This method get path of the splash image.
706      *
707      * @return path of the widget's splash image
708      */
709     DPL::OptionalString getSplashImgSrc() const;
710
711     ExternalLocationList getWidgetExternalLocations() const;
712
713     /*
714      * Default value is required to keep compatibility with
715      * wrt-installer and wrt.
716      */
717     CertificateChainList getWidgetCertificate(
718             CertificateSource source = SIGNATURE_DISTRIBUTOR) const;
719
720     void getWidgetSettings(WidgetSettings& outWidgetSettings) const;
721
722     /**
723      * This method gets application service list that define AUL value
724      *
725      * @return See above comment
726      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
727      */
728     void getAppServiceList(
729             WidgetApplicationServiceList& outAppServiceList) const;
730
731     /**
732      * This method returns the type of the package.
733      *
734      * @return PackagingType
735      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
736      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
737                                                 records in DB table.
738      */
739     PackagingType getPackagingType() const;
740
741     void getEncryptedFileList(EncryptedFileList& filesList) const;
742
743     /**
744      * This method returns widget's background page filename.
745      *
746      * @return Name of file containing background page
747      */
748     DPL::OptionalString getBackgroundPage() const;
749
750     /**
751      * @brief generateTizenId generates new tizen id
752      *
753      * If widget do not supplies it's own tizen id, this method can be used,
754      * although it should be removed in future.
755      *
756      * @return new tizen id
757      */
758     static WidgetPkgName generateTizenId();
759
760     /**
761      * @brief This method return each value for security setting
762      *
763      * @return SettingsType
764      *         SETTINGS_TYPE_UNKNOWN     : unknow value
765      *         SETTINGS_TYPE_ON                : enable
766      *         SETTINGS_TYPE_ALWAYS_ASK : ask by popup
767      *         SETTINGS_TYPE_OFF               : disable
768      */
769     SettingsType getSecurityPopupUsage() const;
770     SettingsType getGeolocationUsage() const;
771     SettingsType getWebNotificationUsage() const;
772     SettingsType getWebDatabaseUsage() const;
773     SettingsType getFileSystemUsage() const;
774
775     /**
776      * This method returns widget's installed path
777      *
778      * @return path of widget installed
779      */
780     DPL::OptionalString getWidgetInstalledPath() const;
781 };
782
783 } // namespace WrtDB
784
785 #endif // _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
786