b92cb38400918c96816508f03bc8dbb1705d3060
[platform/framework/web/wrt-commons.git] / modules / widget_dao / include / dpl / wrt-dao-ro / widget_dao_read_only.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /**
17  * This file contains the declaration of widget dao class.
18  *
19  * @file    widget_dao_read_only.h
20  * @author  Yang Jie (jie2.yang@samsung.com)
21  * @author  Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
22  * @author  Pawel Sikorski (p.sikorski@samsung.com)
23  * @version 1.0
24  * @brief   This file contains the declaration of widget dao
25  */
26
27 #ifndef _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
28 #define _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
29
30 #include <time.h>
31 #include <list>
32 #include <string>
33 #include <dpl/string.h>
34 #include <dpl/exception.h>
35 #include <dpl/db/orm.h>
36 #include <dpl/optional_typedefs.h>
37 #include <dpl/wrt-dao-ro/config_parser_data.h>
38 #include <dpl/wrt-dao-ro/property_dao_read_only.h>
39 #include <dpl/wrt-dao-ro/common_dao_types.h>
40
41 namespace WrtDB {
42 /**
43  * 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(WrtDB::TizenAppId 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 TizenPkgId for the specified widget
333      *
334      * @return TizenPkgId;
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     TizenPkgId getTzPkgId() const;
341
342     /**
343      * This method returns the root directory of widget resource.
344      *
345      * @return path name of root directory.
346      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
347      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
348      * DB table.
349      */
350     virtual DPL::String getPath() const;
351
352     DPL::String getFullPath() const;
353
354     /**
355      * This method returns the preferred size of the widget,
356      * including width and height.
357      *
358      * @see DbWidgetSize
359      * @return An structure type variable to hold widget's size.
360      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
361      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
362      *                                          DB table.
363      */
364     DbWidgetSize getPreferredSize() const;
365
366     /**
367      * This method returns the type of the widget.
368      *
369      * @return WidgetType
370      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
371      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
372      *                                          records in DB table.
373      */
374     WidgetType getWidgetType() const;
375
376     /**
377      * This method returns the id of the widget.
378      *
379      * @return widget id
380      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
381      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
382      *  DB table.
383      */
384     WidgetGUID getGUID() const;
385
386     /**
387      * This method returns the App id of the widget.
388      *
389      * @return appid
390      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
391      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
392      * DB table.
393      */
394     DPL::OptionalString getTizenAppId() const;
395
396     /**
397      * This method returns the defaultlocale for the widget.
398      *
399      * @return defaultlocale
400      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
401      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
402      *  DB table.
403      */
404     DPL::OptionalString getDefaultlocale() const;
405
406     /**
407      * This method returns list of localized icons files;
408      *
409      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
410      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
411      *  DB table.
412      */
413     WidgetLocalizedIconList getLocalizedIconList() const;
414
415     /**
416      * This method returns list of icons files;
417      *
418      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
419      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
420      *  DB table.
421      */
422     WidgetIconList getIconList() const;
423
424     /**
425      * This method returns list of localized start files;
426      *
427      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
428      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
429      *  DB table.
430      */
431     LocalizedStartFileList getLocalizedStartFileList() const;
432
433     /**
434      * This method returns list of start files;
435      *
436      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
437      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
438      *  DB table.
439      */
440     WidgetStartFileList getStartFileList() const;
441
442     /**
443      * @param[out] outAccessInfoList list filled with access info structures
444      */
445     void getWidgetAccessInfo(WidgetAccessInfoList& outAccessInfoList) 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 isWacSigned() const;
458
459     /**
460      * WAC 2.0 extension
461      * @return
462      */
463     bool isDistributorSigned() const;
464
465     /**
466      * WAC 2.0 extension
467      * @return trusted status
468      */
469     bool isTrusted() const;
470
471     /**
472      * WAC 2.0 extension
473      * @return is WAC test widget
474      */
475     bool isTestWidget() const;
476
477     /**
478      * This method returns window mode of widget.
479      *
480      * @return window modes of widget
481      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
482      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
483      *  DB table.
484      */
485     WindowModeList getWindowModes() const;
486
487     /**
488      * This method returns the version of the widget.
489      *
490      * @return version of widget
491      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
492      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
493      *  DB table.
494      */
495     DPL::OptionalString getVersion() const;
496
497     /**
498      * This method is used as a getter for csp policy of widget. It should be
499      * provided in configuration file.
500      * @return global csp policy for widget
501      */
502     DPL::OptionalString getCspPolicy() const;
503
504     /**
505      * This method is used as a getter for report only csp policy of widget.
506      * It may be provided in configuration file.
507      * @return global csp report only policy for widget
508      */
509     DPL::OptionalString getCspPolicyReportOnly() const;
510
511     /**
512      * This method returns list filed with Common Name entries from certificate.
513      *
514      * @return Common Name of Distribuotor End Entity certificate.
515      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
516      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
517      *  DB table.
518      */
519     WidgetCertificateCNList getKeyCommonNameList(
520         WidgetCertificateData::Owner owner,
521         WidgetCertificateData::Type type) const;
522
523     /**
524      * given a certificate owner (author / distributor) and type of certificate
525      * (end entity / ca)
526      * function returns list of matching fingerprints
527      */
528     FingerPrintList getKeyFingerprints(
529         WidgetCertificateData::Owner owner,
530         WidgetCertificateData::Type type) const;
531
532     /*
533      *  This method gets certificate data list for a widget from database.
534      */
535     WidgetCertificateDataList getCertificateDataList() const;
536
537     /**
538      * This method returns a list of widget features.
539      *
540      * @see WidgetFeature
541      * @see FreeFeatureList()
542      * @return list of widget features, type of list element is structure
543      *  WidgetFeature
544      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
545      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
546      *  DB table.
547      */
548     DbWidgetFeatureSet getFeaturesList() const;
549
550     /**
551      * This method checks whether widget has specified feature.
552      *
553      * @return true if has, false if has not
554      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
555      */
556     bool hasFeature(const std::string& featureName) const;
557
558     /**
559      * This method gets host list that widget can connect to.
560      *
561      * @return See above comment
562      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
563      */
564     HostList getAccessHostList() const;
565
566     /**
567      * This method gets widget's access on network: true or false.
568      *
569      * @return true: widget can access network; false: widget can not access
570      *  network.
571      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
572      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
573      *  DB table.
574      */
575     bool getAccessNetworkMode() const;
576
577     /**
578      * This method gets if widget needs webkit plugins enabled
579      *
580      * @return true: widget needs webkit plugins enabled
581      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
582      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
583      *  DB table.
584      */
585     bool getWebkitPluginsRequired() const;
586
587     /**
588      * This method returns a list of all the installed widgets' app id.
589      *
590      * @return list of installed widgets' app id.
591      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
592      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
593      *  DB table.
594      */
595     static DbWidgetHandleList getHandleList();
596
597     /**
598      * This method returns list of tizen application list of installed packages
599      * @return list of TizenAppIdList of installed packages
600      */
601     static TizenAppIdList getTizenAppidList();
602
603     /**
604      * This method returns a list of all the installed widgets.
605      *
606      * @return list of installed widgets.
607      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
608      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
609      *  DB table.
610      */
611     static DbWidgetDAOReadOnlyList getWidgetList();
612
613     /**
614      * This method removes a widget's information from EmDB.
615      *
616      * @see RegisterWidget()
617      * @param[in] widgetHandle    widget's app id
618      * @return true if succeed, false if fail.
619      */
620     static void unregisterWidget(DbWidgetHandle widgetHandle);
621
622     /**
623      * This method gets author's infomation of a widget which is parsed from
624      *  configiration document.
625      *
626      * @see WidgetAuthorInfo
627      * @param[out] pAuthorInfo
628      * @return true if succeed, false if fail.
629      */
630     WidgetAuthorInfo getAuthorInfo() const;
631
632     /**
633      * This method gets author's name of a widget which is parsed from
634      *  configiration document.
635      *
636      * @param[out] pAuthorInfo
637      * @return author's name.
638      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
639      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
640      *  DB table.
641      */
642     DPL::OptionalString getAuthorName() const;
643
644     /**
645      * This method gets author's email of a widget which is parsed from
646      *  configiration document.
647      *
648      * @param[out] pAuthorInfo
649      * @return author's email.
650      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
651      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
652      *  DB table.
653      */
654     DPL::OptionalString getAuthorEmail() const;
655
656     /**
657      * This method gets author's email of a widget which is parsed from
658      *  configiration document.
659      *
660      * @param[out] pAuthorInfo
661      * @return author's email.
662      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
663      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
664      *  DB table.
665      */
666     DPL::OptionalString getAuthorHref() const;
667
668     /**
669      * This method returns minimum version of WAC that WRT has to be compliant
670      *  to to run this widget
671      *
672      * @return Minimum version
673      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
674      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
675      *  DB table.
676      */
677     DPL::OptionalString getMinimumWacVersion() const;
678
679     /* This method get widget' share href.
680      *
681      * @return widget's share href
682      */
683     std::string getShareHref() const;
684
685     /**
686      * This method get widget installed time
687      *
688      * @return time_t : return widget's install time
689      */
690     time_t getInstallTime() const;
691
692     /**
693      * This method gets widget base folder.
694      *
695      * @return widget base folder.
696      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
697      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
698      *  DB table.
699      */
700     std::string getBaseFolder() const;
701
702     /* This method checks read only flag for given property
703      */
704     DPL::OptionalInt checkPropertyReadFlag(
705         const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
706
707     /* This method gets widget property key list
708      */
709     PropertyDAOReadOnly::WidgetPropertyKeyList getPropertyKeyList() const;
710
711     /* This method gets widget property list
712      */
713     PropertyDAOReadOnly::WidgetPreferenceList getPropertyList() const;
714
715     /* This method get widget property value
716      */
717     PropertyDAOReadOnly::WidgetPropertyValue getPropertyValue(
718         const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
719
720     LanguageTagList getLanguageTags() const;
721     LanguageTagList getIconLanguageTags() const;
722
723     WidgetLocalizedInfo getLocalizedInfo(const DPL::String& languageTag) const;
724     std::string getCookieDatabasePath() const;
725     // Local storage
726     std::string getPrivateLocalStoragePath() const;
727
728     bool getBackSupported() const;
729
730     static bool isWidgetInstalled(DbWidgetHandle handle);
731     static bool isWidgetInstalled(const TizenAppId & tzAppId);
732
733     /* This method get path of the splash image.
734      *
735      * @return path of the widget's splash image
736      */
737     DPL::OptionalString getSplashImgSrc() const;
738
739     ExternalLocationList getWidgetExternalLocations() const;
740
741     /*
742      * Default value is required to keep compatibility with
743      * wrt-installer and wrt.
744      */
745     CertificateChainList getWidgetCertificate(
746         CertificateSource source = SIGNATURE_DISTRIBUTOR) const;
747
748     void getWidgetSettings(WidgetSettings& outWidgetSettings) const;
749
750     /**
751      * This method gets application control list that define AUL value
752      *
753      * @return See above comment
754      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
755      */
756     void getAppControlList(
757         WidgetAppControlList& outAppControlList) const;
758
759     /**
760      * This method returns the type of the package.
761      *
762      * @return PackagingType
763      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
764      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
765      *                                          records in DB table.
766      */
767     PackagingType getPackagingType() const;
768
769     void getEncryptedFileList(EncryptedFileList& filesList) const;
770
771     /**
772      * This method returns widget's background page filename.
773      *
774      * @return Name of file containing background page
775      */
776     DPL::OptionalString getBackgroundPage() const;
777
778     /**
779      * @brief generateTizenId generates new package id
780      *
781      * If widget do not supplies it's own tizen package id, this method can be
782      * used,
783      * although it should be removed in future.
784      *
785      * @return new tizen package id
786      */
787     static TizenPkgId generatePkgId();
788     static TizenPkgId generateTizenId()
789     {
790         return generatePkgId();
791     }
792
793     /**
794      * @brief This method return each value for security setting
795      *
796      * @return SettingsType
797      *         SETTINGS_TYPE_UNKNOWN     : unknow value
798      *         SETTINGS_TYPE_ON                : enable
799      *         SETTINGS_TYPE_ALWAYS_ASK : ask by popup
800      *         SETTINGS_TYPE_OFF               : disable
801      */
802     SettingsType getSecurityPopupUsage() const;
803     SettingsType getGeolocationUsage() const;
804     SettingsType getWebNotificationUsage() const;
805     SettingsType getWebDatabaseUsage() const;
806     SettingsType getFileSystemUsage() const;
807
808     /**
809      * This method returns widget's installed path
810      *
811      * @return path of widget installed
812      */
813     DPL::OptionalString getWidgetInstalledPath() const;
814
815     /**
816      * This method returns tizen package id
817      *
818      * @return tizen package id
819      */
820     TizenPkgId getTizenPkgId() const;
821     PrivilegeList getWidgetPrivilege() const;
822 };
823 } // namespace WrtDB
824
825 #endif // _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
826