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