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