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