Unused fields in WidgetRegisterInfo
[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  * Widget's signature enum.
44  * This enumerates signature type of widget.
45  */
46 enum WidgetSignatureType
47 {
48     SIGNATURE_TYPE_CARRIER = 0,
49     SIGNATURE_TYPE_IDENTIFIED,
50     SIGNATURE_TYPE_UNIDENTIFIED
51 };
52
53 enum CertificateSource {
54     SIGNATURE_DISTRIBUTOR = 0,
55     SIGNATURE_AUTHOR = 1
56 };
57
58 typedef std::list<DPL::String> StringList;
59
60 struct WidgetLocalizedInfo
61 {
62     DPL::OptionalString name;
63     DPL::OptionalString shortName;
64     DPL::OptionalString description;
65     DPL::OptionalString license;
66     DPL::OptionalString licenseHref;
67 };
68
69 /**
70  * CertificateData
71  * A structure to hold certificate fingerprints.
72  */
73 struct WidgetCertificateData
74 {
75     enum Owner { AUTHOR, DISTRIBUTOR, UNKNOWN };
76     enum Type { ROOT, ENDENTITY };
77
78     // type of signature: author/distributor
79     Owner owner;
80     // indicates whether this is ca certificate
81     Type type;
82
83     // chain id number: relative BASE, where BASE is signatureBASE.xml
84     int chainId;
85     // certificate fingerprint digested by md5
86     std::string strMD5Fingerprint;
87     // certificate fingerprint digestef by sha1
88     std::string strSHA1Fingerprint;
89     // Common name field in certificate
90     DPL::String strCommonName;
91
92     bool operator== (const WidgetCertificateData& certData) const
93     {
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         LocaleSet availableLocales;
124     };
125
126     struct StartFileProperties
127     {
128         DPL::String encoding;
129         DPL::String type;
130     };
131
132     typedef std::map<Locale,
133                      StartFileProperties> StartFilePropertiesForLocalesMap;
134     struct LocalizedStartFile
135     {
136         DPL::String path;
137         StartFilePropertiesForLocalesMap propertiesForLocales;
138     };
139
140     typedef std::list<LocalizedIcon> LocalizedIconList;
141     typedef std::list<LocalizedStartFile> LocalizedStartFileList;
142     struct LocalizationData
143     {
144         LocalizedIconList icons;
145         LocalizedStartFileList startFiles;
146     };
147
148     enum SecurityDomain
149     {
150         Untrusted,
151         Trusted,
152         Operator,
153         None
154     };
155
156     //Constructor
157     WidgetRegisterInfo() :
158         webAppType(APP_TYPE_UNKNOWN),
159         signatureType(SIGNATURE_TYPE_UNIDENTIFIED),
160         isTestWidget(0),
161         configInfo(),
162         packagingType(PKG_TYPE_UNKNOWN)
163     {}
164
165     WidgetType webAppType;
166     DPL::OptionalString guid;
167     DPL::OptionalString version;
168     DPL::OptionalString minVersion;
169     std::string shareHref;
170     std::string baseFolder;
171     WidgetSignatureType signatureType;
172     int isTestWidget;
173     ConfigParserData configInfo;
174     LocalizationData localizationData;
175
176     TizenPkgId tzPkgid;
177     TizenAppId tzAppid;
178
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 tzAppid);
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
311      * DB table.
312      */
313     DbWidgetHandle getHandle() const;
314     static DbWidgetHandle getHandle(const WidgetGUID GUID);
315     static DbWidgetHandle getHandle(const DPL::String pkgName);
316
317     /**
318      * Returns tizenAppId for the specified widget
319      *
320      * @return tzAppid;
321      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
322      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
323      * DB table.
324      */
325
326     TizenAppId getTzAppId() const;
327     static TizenAppId getTzAppId(const WidgetGUID GUID);
328     static TizenAppId getTzAppId(const DbWidgetHandle handle);
329     static TizenAppId getTzAppId(const TizenPkgId tzPkgid);
330
331     /**
332      * Returns WidgetPkgName for the specified widget
333      *
334      * @return pkgName;
335      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
336      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
337      * DB table.
338      */
339
340     WidgetPkgName getPkgName() const;
341     static WidgetPkgName getPkgName(const WidgetGUID GUID);
342     static WidgetPkgName getPkgName(const DbWidgetHandle handle);
343
344     /**
345      * This method returns the root directory of widget resource.
346      *
347      * @return path name of root directory.
348      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
349      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
350      * DB table.
351      */
352     DPL::String getPath() const;
353
354     DPL::String getFullPath() const;
355
356     /**
357      * This method returns the preferred size of the widget,
358      * including width and height.
359      *
360      * @see DbWidgetSize
361      * @return An structure type variable to hold widget's size.
362      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
363      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
364      *                                          DB table.
365      */
366     DbWidgetSize getPreferredSize() const;
367
368     /**
369      * This method returns the type of the widget.
370      *
371      * @return WidgetType
372      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
373      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
374      *                                          records in DB table.
375      */
376     WidgetType getWidgetType() const;
377
378     /**
379      * This method returns the id of the widget.
380      *
381      * @return widget id
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     WidgetGUID getGUID() const;
387
388     /**
389      * This method returns the App id of the widget.
390      *
391      * @return appid
392      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
393      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
394      * DB table.
395      */
396     DPL::OptionalString getTizenAppId() const;
397
398     /**
399      * This method returns the defaultlocale for the widget.
400      *
401      * @return defaultlocale
402      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
403      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
404      *  DB table.
405      */
406     DPL::OptionalString getDefaultlocale() const;
407
408     /**
409      * This method returns list of localized icons files;
410      *
411      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
412      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
413      *  DB table.
414      */
415     WidgetLocalizedIconList getLocalizedIconList() const;
416
417     /**
418      * This method returns list of icons files;
419      *
420      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
421      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
422      *  DB table.
423      */
424     WidgetIconList getIconList() const;
425
426     /**
427      * This method returns list of localized start files;
428      *
429      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
430      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
431      *  DB table.
432      */
433     LocalizedStartFileList getLocalizedStartFileList() const;
434
435     /**
436      * This method returns list of start files;
437      *
438      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
439      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
440      *  DB table.
441      */
442     WidgetStartFileList getStartFileList() const;
443
444     /**
445      * @param[out] outAccessInfoList list filled with access info structures
446      */
447     void getWidgetAccessInfo(WidgetAccessInfoList& outAccessInfoList) const;
448
449     /**
450      * WAC 2.0 extension
451      * @return recognized status
452      */
453     bool isRecognized() const;
454
455     /**
456      * WAC 2.0 extension
457      * @return
458      */
459     bool isWacSigned() const;
460
461     /**
462      * WAC 2.0 extension
463      * @return
464      */
465     bool isDistributorSigned() const;
466
467     /**
468      * WAC 2.0 extension
469      * @return trusted status
470      */
471     bool isTrusted() const;
472
473     /**
474      * WAC 2.0 extension
475      * @return is WAC test widget
476      */
477     bool isTestWidget() const;
478
479     /**
480      * This method returns window mode of widget.
481      *
482      * @return window modes of widget
483      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
484      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
485      *  DB table.
486      */
487     WindowModeList getWindowModes() const;
488
489     /**
490      * This method returns the version of the widget.
491      *
492      * @return version of widget
493      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
494      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
495      *  DB table.
496      */
497     DPL::OptionalString getVersion() const;
498
499     /**
500      * This method is used as a getter for csp policy of widget. It should be
501      * provided in configuration file.
502      * @return global csp policy for widget
503      */
504     DPL::OptionalString getCspPolicy() const;
505
506     /**
507      * This method returns list filed with Common Name entries from certificate.
508      *
509      * @return Common Name of Distribuotor End Entity certificate.
510      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
511      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
512      *  DB table.
513      */
514     WidgetCertificateCNList getKeyCommonNameList(
515         WidgetCertificateData::Owner owner,
516         WidgetCertificateData::Type type) const;
517
518     /**
519      * given a certificate owner (author / distributor) and type of certificate
520      * (end entity / ca)
521      * function returns list of matching fingerprints
522      */
523     FingerPrintList getKeyFingerprints(
524         WidgetCertificateData::Owner owner,
525         WidgetCertificateData::Type type) const;
526
527     /*
528      *  This method gets certificate data list for a widget from database.
529      */
530     WidgetCertificateDataList getCertificateDataList() const;
531
532     /**
533      * This method returns a list of widget features.
534      *
535      * @see WidgetFeature
536      * @see FreeFeatureList()
537      * @return list of widget features, type of list element is structure
538      *  WidgetFeature
539      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
540      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
541      *  DB table.
542      */
543     DbWidgetFeatureSet getFeaturesList() const;
544
545     static WidgetParamMap getFeatureParams(int widgetFeatureId);
546     /**
547      * This method checks whether widget has specified feature.
548      *
549      * @return true if has, false if has not
550      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
551      */
552     bool hasFeature(const std::string& featureName) const;
553
554     /**
555      * This method gets host list that widget can connect to.
556      *
557      * @return See above comment
558      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
559      */
560     HostList getAccessHostList() const;
561
562     /**
563      * This method gets widget's access on network: true or false.
564      *
565      * @return true: widget can access network; false: widget can not access
566      *  network.
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     bool getAccessNetworkMode() const;
572
573     /**
574      * This method gets if widget needs webkit plugins enabled
575      *
576      * @return true: widget needs webkit plugins enabled
577      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
578      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
579      *  DB table.
580      */
581     bool getWebkitPluginsRequired() const;
582
583     /**
584      * This method returns a list of all the installed widgets' app id.
585      *
586      * @return list of installed widgets' app id.
587      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
588      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
589      *  DB table.
590      */
591     static DbWidgetHandleList getHandleList();
592
593     /**
594      * This method returns list of pkgname of installed packages
595      * @return list of pkgname of installed packages
596      */
597     static TizenAppIdList getTizenAppidList();
598     static WidgetPkgNameList getPkgnameList();
599
600     /**
601      * This method returns a list of all the installed widgets.
602      *
603      * @return list of installed widgets.
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     static DbWidgetDAOReadOnlyList getWidgetList();
609
610     /**
611      * This method removes a widget's information from EmDB.
612      *
613      * @see RegisterWidget()
614      * @param[in] widgetHandle    widget's app id
615      * @return true if succeed, false if fail.
616      */
617     static void unregisterWidget(DbWidgetHandle widgetHandle);
618
619     /**
620      * This method gets author's infomation of a widget which is parsed from
621      *  configiration document.
622      *
623      * @see WidgetAuthorInfo
624      * @param[out] pAuthorInfo
625      * @return true if succeed, false if fail.
626      */
627     WidgetAuthorInfo getAuthorInfo() const;
628
629     /**
630      * This method gets author's name of a widget which is parsed from
631      *  configiration document.
632      *
633      * @param[out] pAuthorInfo
634      * @return author's name.
635      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
636      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
637      *  DB table.
638      */
639     DPL::OptionalString getAuthorName() const;
640
641     /**
642      * This method gets author's email of a widget which is parsed from
643      *  configiration document.
644      *
645      * @param[out] pAuthorInfo
646      * @return author's email.
647      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
648      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
649      *  DB table.
650      */
651     DPL::OptionalString getAuthorEmail() const;
652
653     /**
654      * This method gets author's email of a widget which is parsed from
655      *  configiration document.
656      *
657      * @param[out] pAuthorInfo
658      * @return author's email.
659      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
660      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
661      *  DB table.
662      */
663     DPL::OptionalString getAuthorHref() const;
664
665     /**
666      * This method returns minimum version of WAC that WRT has to be compliant
667      *  to to run this widget
668      *
669      * @return Minimum version
670      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
671      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
672      *  DB table.
673      */
674     DPL::OptionalString getMinimumWacVersion() const;
675
676     /* This method get widget' share href.
677      *
678      * @return widget's share href
679      */
680     std::string getShareHref() const;
681
682     /**
683      * This method get widget installed time
684      *
685      * @return time_t : return widget's install time
686      */
687     time_t getInstallTime() const;
688
689     /**
690      * This method gets widget base folder.
691      *
692      * @return widget base folder.
693      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
694      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
695      *  DB table.
696      */
697     std::string getBaseFolder() const;
698
699     /* This method gets the parameter list for resource.
700      */
701     ResourceAttributeList getResourceAttribute(
702         const std::string &resourceId) const;
703
704     /* This method checks read only flag for given property
705      */
706     DPL::OptionalInt checkPropertyReadFlag(
707         const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
708
709     /* This method gets widget property key list
710      */
711     PropertyDAOReadOnly::WidgetPropertyKeyList getPropertyKeyList() const;
712
713     /* This method gets widget property list
714      */
715     PropertyDAOReadOnly::WidgetPreferenceList getPropertyList() const;
716
717     /* This method get widget property value
718      */
719     PropertyDAOReadOnly::WidgetPropertyValue getPropertyValue(
720         const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
721
722     LanguageTagList getLanguageTags() const;
723     LanguageTagList getIconLanguageTags() const;
724
725     WidgetLocalizedInfo getLocalizedInfo(const DPL::String& languageTag) const;
726     std::string getCookieDatabasePath() const;
727     // Local storage
728     std::string getPrivateLocalStoragePath() const;
729
730     bool getBackSupported() const;
731
732     static bool isWidgetInstalled(DbWidgetHandle handle);
733     static bool isWidgetInstalled(const TizenAppId & tzAppId);
734
735     /* This method get path of the splash image.
736      *
737      * @return path of the widget's splash image
738      */
739     DPL::OptionalString getSplashImgSrc() const;
740
741     ExternalLocationList getWidgetExternalLocations() const;
742
743     /*
744      * Default value is required to keep compatibility with
745      * wrt-installer and wrt.
746      */
747     CertificateChainList getWidgetCertificate(
748         CertificateSource source = SIGNATURE_DISTRIBUTOR) const;
749
750     void getWidgetSettings(WidgetSettings& outWidgetSettings) const;
751
752     /**
753      * This method gets application service list that define AUL value
754      *
755      * @return See above comment
756      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
757      */
758     void getAppServiceList(
759         WidgetApplicationServiceList& outAppServiceList) const;
760
761     /**
762      * This method returns the type of the package.
763      *
764      * @return PackagingType
765      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
766      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
767      *                                          records in DB table.
768      */
769     PackagingType getPackagingType() const;
770
771     void getEncryptedFileList(EncryptedFileList& filesList) const;
772
773     /**
774      * This method returns widget's background page filename.
775      *
776      * @return Name of file containing background page
777      */
778     DPL::OptionalString getBackgroundPage() const;
779
780     /**
781      * @brief generateTizenId generates new package id
782      *
783      * If widget do not supplies it's own tizen package id, this method can be
784      * used,
785      * although it should be removed in future.
786      *
787      * @return new tizen package id
788      */
789     static TizenPkgId generatePkgId();
790     static TizenPkgId generateTizenId()
791     {
792         return generatePkgId();
793     }
794
795     /**
796      * @brief This method return each value for security setting
797      *
798      * @return SettingsType
799      *         SETTINGS_TYPE_UNKNOWN     : unknow value
800      *         SETTINGS_TYPE_ON                : enable
801      *         SETTINGS_TYPE_ALWAYS_ASK : ask by popup
802      *         SETTINGS_TYPE_OFF               : disable
803      */
804     SettingsType getSecurityPopupUsage() const;
805     SettingsType getGeolocationUsage() const;
806     SettingsType getWebNotificationUsage() const;
807     SettingsType getWebDatabaseUsage() const;
808     SettingsType getFileSystemUsage() const;
809
810     /**
811      * This method returns widget's installed path
812      *
813      * @return path of widget installed
814      */
815     DPL::OptionalString getWidgetInstalledPath() const;
816
817     /**
818      * This method returns tizen package id
819      *
820      * @return tizen package id
821      */
822     TizenPkgId getTizenPkgId() const;
823 };
824 } // namespace WrtDB
825
826 #endif // _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
827