fa099011ca614ea0bd8ed06757f036a6b6175909
[framework/web/wrt-commons.git] / modules / widget_dao / include / dpl / wrt-dao-ro / widget_dao_read_only.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 /**
17  * This file contains the declaration of widget dao class.
18  *
19  * @file    widget_dao_read_only.h
20  * @author  Yang Jie (jie2.yang@samsung.com)
21  * @author  Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
22  * @author  Pawel Sikorski (p.sikorski@samsung.com)
23  * @version 1.0
24  * @brief   This file contains the declaration of widget dao
25  */
26
27 #ifndef _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
28 #define _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
29
30 #include <time.h>
31 #include <list>
32 #include <string>
33 #include <dpl/string.h>
34 #include <dpl/exception.h>
35 #include <dpl/db/orm.h>
36 #include <dpl/optional_typedefs.h>
37 #include <dpl/wrt-dao-ro/config_parser_data.h>
38 #include <dpl/wrt-dao-ro/property_dao_read_only.h>
39 #include <dpl/wrt-dao-ro/common_dao_types.h>
40
41 namespace WrtDB {
42
43 /**
44  * Widget's signature enum.
45  * This enumerates signature type of widget.
46  */
47 enum WidgetSignatureType
48 {
49     SIGNATURE_TYPE_CARRIER = 0,
50     SIGNATURE_TYPE_IDENTIFIED,
51     SIGNATURE_TYPE_UNIDENTIFIED
52 };
53
54 enum CertificateSource {
55     SIGNATURE_DISTRIBUTOR = 0,
56     SIGNATURE_AUTHOR = 1
57 };
58
59 typedef std::list<DPL::String> StringList;
60
61 struct WidgetLocalizedInfo
62 {
63     DPL::OptionalString name;
64     DPL::OptionalString shortName;
65     DPL::OptionalString description;
66     DPL::OptionalString license;
67     DPL::OptionalString licenseHref;
68 };
69
70 /**
71  * CertificateData
72  * A structure to hold certificate fingerprints.
73  */
74 struct WidgetCertificateData
75 {
76     enum Owner { AUTHOR, DISTRIBUTOR, UNKNOWN };
77     enum Type { ROOT, ENDENTITY };
78
79     // type of signature: author/distributor
80     Owner owner;
81     // indicates whether this is ca certificate
82     Type type;
83
84     // chain id number: relative BASE, where BASE is signatureBASE.xml
85     int chainId;
86     // certificate fingerprint digested by md5
87     std::string strMD5Fingerprint;
88     // certificate fingerprint digestef by sha1
89     std::string strSHA1Fingerprint;
90     // Common name field in certificate
91     DPL::String strCommonName;
92
93     bool operator== (const WidgetCertificateData& certData) const {
94         return certData.chainId == chainId &&
95            certData.owner == owner &&
96            certData.strCommonName == strCommonName &&
97            certData.strMD5Fingerprint == strMD5Fingerprint &&
98            certData.strSHA1Fingerprint == strSHA1Fingerprint;
99     }
100 };
101
102 typedef std::list<WidgetCertificateData> WidgetCertificateDataList;
103
104 typedef DPL::String Locale;
105 typedef std::set<Locale> LocaleSet;
106 typedef std::list<std::string> ExternalLocationList;
107
108 /**
109  * WidgetRegisterInfo
110  * A structure to hold widget's information needed to be registered.
111  * @see WidgetConfigurationInfo
112  */
113 struct WidgetRegisterInfo
114 {
115     struct LocalizedIcon : public ConfigParserData::Icon
116     {
117         LocalizedIcon(const ConfigParserData::Icon& icon,
118                 const LocaleSet& _availableLocales) :
119             ConfigParserData::Icon(icon),
120             availableLocales(_availableLocales)
121         {
122         }
123
124         LocaleSet availableLocales;
125     };
126
127     struct StartFileProperties
128     {
129         DPL::String encoding;
130         DPL::String type;
131     };
132
133     typedef std::map<Locale,
134                      StartFileProperties> StartFilePropertiesForLocalesMap;
135     struct LocalizedStartFile
136     {
137         DPL::String path;
138         StartFilePropertiesForLocalesMap propertiesForLocales;
139     };
140
141     typedef std::list<LocalizedIcon> LocalizedIconList;
142     typedef std::list<LocalizedStartFile> LocalizedStartFileList;
143     struct LocalizationData
144     {
145         LocalizedIconList icons;
146         LocalizedStartFileList startFiles;
147     };
148
149     enum SecurityDomain
150     {
151         Untrusted,
152         Trusted,
153         Operator,
154         None
155     };
156
157     //Constructor
158     WidgetRegisterInfo() :
159         webAppType(APP_TYPE_UNKNOWN),
160         signatureType(SIGNATURE_TYPE_UNIDENTIFIED),
161         isTestWidget(0),
162         configInfo(),
163         packagingType(PKG_TYPE_UNKNOWN)
164     {
165     }
166
167     WidgetType webAppType;
168     WidgetType type; // TODO : This type will be removed.
169     DPL::OptionalString guid;
170     DPL::OptionalString version;
171     DPL::OptionalString minVersion;
172     std::string shareHref;
173     std::string baseFolder;
174     WidgetSignatureType signatureType;
175     int isTestWidget;
176     ConfigParserData configInfo;
177     LocalizationData localizationData;
178
179     DPL::OptionalString pkgname;
180     WidgetPkgName pkgName;
181     TizenPkgId tzPkgid;
182     TizenAppId tzAppid;
183
184     time_t installedTime;
185     PackagingType packagingType;
186     EncryptedFileList encryptedFiles;
187     ExternalLocationList externalLocations;
188     DPL::OptionalString widgetInstalledPath;
189 };
190
191 typedef std::list<std::string> CertificateChainList;
192 class IWacSecurity
193 {
194   public:
195     virtual ~IWacSecurity();
196
197     virtual const WidgetCertificateDataList& getCertificateList() const = 0;
198
199     virtual bool isRecognized() const = 0;
200
201     virtual bool isDistributorSigned() const = 0;
202
203     virtual bool isWacSigned() const = 0;
204
205     virtual void getCertificateChainList(CertificateChainList& list,
206             CertificateSource source) const = 0;
207 };
208
209 /**
210  * WidgetAuthorInfo.
211  * Structure to hold the information of widget's author.
212  */
213 struct WidgetAuthorInfo
214 {
215     DPL::OptionalString name;
216     DPL::OptionalString email;
217     DPL::OptionalString href;
218 };
219
220 /**
221  * Widget update policy
222  */
223 enum WidgetUpdatePolicy
224 {
225     WIDGET_UPDATE_MONTHLY = 0,  //< monthly update
226     WIDGET_UPDATE_WEEKLY,       //< weekly update
227     WIDGET_UPDATE_DAILY,        //< daily update
228     WIDGET_UPDATE_STARTUP,      //< update when cell phone boots
229     WIDGET_UPDATE_NEVER         //< never update
230 };
231
232 typedef std::list <std::string> WidgetCertificateCNList;
233 typedef std::list<DPL::String> LanguageTagList;
234 typedef std::list<std::string> HostList;
235 typedef std::list<std::string> FingerPrintList;
236 typedef std::list<std::string> ResourceAttributeList;
237
238 class WidgetDAOReadOnly
239 {
240   public:
241     /**
242      * WidgetDAO Exception classes
243      */
244     class Exception
245     {
246       public:
247         DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
248         DECLARE_EXCEPTION_TYPE(Base, DatabaseError)
249         DECLARE_EXCEPTION_TYPE(Base, ReadOnlyProperty)
250         DECLARE_EXCEPTION_TYPE(Base, GUIDisNull)
251         DECLARE_EXCEPTION_TYPE(Base, UnexpectedEmptyResult)
252         DECLARE_EXCEPTION_TYPE(Base, WidgetNotExist)
253         DECLARE_EXCEPTION_TYPE(Base, AlreadyRegistered)
254     };
255
256   protected:
257     DbWidgetHandle m_widgetHandle;
258
259   public:
260     struct WidgetLocalizedIconRow
261     {
262         int appId;
263         int iconId;
264         DPL::String widgetLocale;
265     };
266     typedef std::list<WidgetLocalizedIconRow> WidgetLocalizedIconList;
267
268     struct WidgetIconRow
269     {
270         int iconId;
271         int appId;
272         DPL::String iconSrc;
273         DPL::OptionalInt iconWidth;
274         DPL::OptionalInt iconHeight;
275     };
276     typedef std::list<WidgetIconRow> WidgetIconList;
277
278     struct WidgetStartFileRow
279     {
280         int startFileId;
281         int appId;
282         DPL::String src;
283     };
284     typedef std::list<WidgetStartFileRow> WidgetStartFileList;
285
286     struct WidgetLocalizedStartFileRow
287     {
288         int startFileId;
289         int appId;
290         DPL::String widgetLocale;
291         DPL::String type;
292         DPL::String encoding;
293     };
294     typedef std::list<WidgetLocalizedStartFileRow> LocalizedStartFileList;
295
296     /**
297      * This is a constructor.
298      *
299      * @param[in] widgetHandle application id of widget.
300      */
301     WidgetDAOReadOnly(DbWidgetHandle widgetHandle);
302     WidgetDAOReadOnly(DPL::OptionalString widgetGUID);
303     WidgetDAOReadOnly(DPL::String tzAppid);
304
305     /**
306      * Destructor
307      */
308     virtual ~WidgetDAOReadOnly();
309
310     /**
311      * This method returns widget handle(m_widgetHandle).
312      *
313      * @return widget handle(m_widgetHandle).
314      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
315      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
316      */
317     DbWidgetHandle getHandle() const;
318     static DbWidgetHandle getHandle(const WidgetGUID GUID);
319     static DbWidgetHandle getHandle(const DPL::String pkgName);
320
321     /**
322      * Returns tizenAppId for the specified widget
323      *
324      * @return tzAppid; 
325      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
326      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
327      */
328
329     TizenAppId getTzAppId() const;
330     static TizenAppId getTzAppId(const WidgetGUID GUID);
331     static TizenAppId getTzAppId(const DbWidgetHandle handle);
332
333     /**
334      * Returns WidgetPkgName for the specified widget
335      *
336      * @return pkgName; 
337      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
338      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
339      */
340
341     WidgetPkgName getPkgName() const;
342     static WidgetPkgName getPkgName(const WidgetGUID GUID);
343     static WidgetPkgName getPkgName(const DbWidgetHandle handle);
344
345     /**
346      * This method returns the root directory of widget resource.
347      *
348      * @return path name of root directory.
349      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
350      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
351      * DB table.
352      */
353     DPL::String getPath() const;
354
355     DPL::String getFullPath() const;
356
357     /**
358      * This method returns the preferred size of the widget,
359      * including width and height.
360      *
361      * @see DbWidgetSize
362      * @return An structure type variable to hold widget's size.
363      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
364      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
365      *                                          DB table.
366      */
367     DbWidgetSize getPreferredSize() const;
368
369     /**
370      * This method returns the type of the widget.
371      *
372      * @return WidgetType
373      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
374      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
375                                                 records in DB table.
376      */
377     WidgetType getWidgetType() const;
378
379     /**
380      * This method returns the id of the widget.
381      *
382      * @return widget id
383      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
384      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
385      *  DB table.
386      */
387     WidgetGUID getGUID() const;
388
389
390     /**
391     * This method returns the App id of the widget.
392     *
393     * @return appid
394     * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
395     * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in DB table.
396     */
397     DPL::OptionalString getTizenAppId() const;
398
399     /**
400      * This method returns the defaultlocale for the widget.
401      *
402      * @return defaultlocale
403      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
404      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
405      *  DB table.
406      */
407     DPL::OptionalString getDefaultlocale() const;
408
409     /**
410      * This method returns list of localized icons files;
411      *
412      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
413      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
414      *  DB table.
415      */
416     WidgetLocalizedIconList getLocalizedIconList() const;
417
418     /**
419      * This method returns list of icons files;
420      *
421      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
422      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
423      *  DB table.
424      */
425     WidgetIconList getIconList() const;
426
427     /**
428      * This method returns list of localized start files;
429      *
430      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
431      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
432      *  DB table.
433      */
434     LocalizedStartFileList getLocalizedStartFileList() const;
435
436     /**
437      * This method returns list of start files;
438      *
439      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
440      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
441      *  DB table.
442      */
443     WidgetStartFileList getStartFileList() const;
444
445     /**
446      * @param[out] outAccessInfoList list filled with access info structures
447      */
448     void getWidgetAccessInfo(WidgetAccessInfoList& outAccessInfoList) const;
449
450     /**
451      * WAC 2.0 extension
452      * @return recognized status
453      */
454     bool isRecognized() const;
455
456     /**
457      * WAC 2.0 extension
458      * @return
459      */
460     bool isWacSigned() const;
461
462     /**
463      * WAC 2.0 extension
464      * @return
465      */
466     bool isDistributorSigned() const;
467
468     /**
469      * WAC 2.0 extension
470      * @return trusted status
471      */
472     bool isTrusted() const;
473
474     /**
475      * WAC 2.0 extension
476      * @return is WAC test widget
477      */
478     bool isTestWidget() const;
479
480     /**
481      * This method returns window mode of widget.
482      *
483      * @return window modes of widget
484      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
485      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
486      *  DB table.
487      */
488     WindowModeList getWindowModes() const;
489
490     /**
491      * This method returns the version of the widget.
492      *
493      * @return version of widget
494      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
495      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
496      *  DB table.
497      */
498     DPL::OptionalString getVersion() const;
499
500     /**
501      * This method returns list filed with Common Name entries from certificate.
502      *
503      * @return Common Name of Distribuotor End Entity certificate.
504      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
505      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
506      *  DB table.
507      */
508     WidgetCertificateCNList getKeyCommonNameList(
509             WidgetCertificateData::Owner owner,
510             WidgetCertificateData::Type type) const;
511
512     /**
513      * given a certificate owner (author / distributor) and type of certificate
514      * (end entity / ca)
515      * function returns list of matching fingerprints
516      */
517     FingerPrintList getKeyFingerprints(
518             WidgetCertificateData::Owner owner,
519             WidgetCertificateData::Type type) const;
520
521     /*
522      *  This method gets certificate data list for a widget from database.
523      */
524     WidgetCertificateDataList getCertificateDataList() const;
525
526     /**
527      * This method returns a list of widget features.
528      *
529      * @see WidgetFeature
530      * @see FreeFeatureList()
531      * @return list of widget features, type of list element is structure
532      *  WidgetFeature
533      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
534      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
535      *  DB table.
536      */
537     DbWidgetFeatureSet getFeaturesList() const;
538
539     static WidgetParamMap getFeatureParams(int widgetFeatureId);
540     /**
541      * This method checks whether widget has specified feature.
542      *
543      * @return true if has, false if has not
544      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
545      */
546     bool hasFeature(const std::string& featureName) const;
547
548     /**
549      * This method gets host list that widget can connect to.
550      *
551      * @return See above comment
552      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
553      */
554     HostList getAccessHostList() const;
555
556     /**
557      * This method gets widget's access on network: true or false.
558      *
559      * @return true: widget can access network; false: widget can not access
560      *  network.
561      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
562      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
563      *  DB table.
564      */
565     bool getAccessNetworkMode() const;
566
567     /**
568      * This method gets if widget needs webkit plugins enabled
569      *
570      * @return true: widget needs webkit plugins enabled
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 getWebkitPluginsRequired() const;
576
577     /**
578      * This method returns a list of all the installed widgets' app id.
579      *
580      * @return list of installed widgets' app id.
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     static DbWidgetHandleList getHandleList();
586
587     /**
588      * This method returns list of pkgname of installed packages
589      * @return list of pkgname of installed packages
590      */
591     static TizenAppIdList getTizenAppidList();
592     static WidgetPkgNameList getPkgnameList();
593
594     /**
595      * This method returns a list of all the installed widgets.
596      *
597      * @return list of installed widgets.
598      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
599      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
600      *  DB table.
601      */
602     static DbWidgetDAOReadOnlyList getWidgetList();
603
604    /**
605      * This method removes a widget's information from EmDB.
606      *
607      * @see RegisterWidget()
608      * @param[in] widgetHandle    widget's app id
609      * @return true if succeed, false if fail.
610      */
611     static void unregisterWidget(DbWidgetHandle widgetHandle);
612
613     /**
614      * This method gets author's infomation of a widget which is parsed from
615      *  configiration document.
616      *
617      * @see WidgetAuthorInfo
618      * @param[out] pAuthorInfo
619      * @return true if succeed, false if fail.
620      */
621     WidgetAuthorInfo getAuthorInfo() const;
622
623     /**
624      * This method gets author's name of a widget which is parsed from
625      *  configiration document.
626      *
627      * @param[out] pAuthorInfo
628      * @return author's name.
629      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
630      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
631      *  DB table.
632      */
633     DPL::OptionalString getAuthorName() const;
634
635     /**
636      * This method gets author's email of a widget which is parsed from
637      *  configiration document.
638      *
639      * @param[out] pAuthorInfo
640      * @return author's email.
641      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
642      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
643      *  DB table.
644      */
645     DPL::OptionalString getAuthorEmail() const;
646
647     /**
648      * This method gets author's email of a widget which is parsed from
649      *  configiration document.
650      *
651      * @param[out] pAuthorInfo
652      * @return author's email.
653      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
654      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
655      *  DB table.
656      */
657     DPL::OptionalString getAuthorHref() const;
658
659     /**
660      * This method returns minimum version of WAC that WRT has to be compliant
661      *  to to run this widget
662      *
663      * @return Minimum version
664      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
665      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
666      *  DB table.
667      */
668     DPL::OptionalString getMinimumWacVersion() const;
669
670     /* This method get widget' share href.
671      *
672      * @return widget's share href
673      */
674     std::string getShareHref() const;
675
676     /**
677      * This method get widget installed time
678      *
679      * @return time_t : return widget's install time
680      */
681     time_t getInstallTime() const;
682
683     /**
684      * This method gets widget base folder.
685      *
686      * @return widget base folder.
687      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
688      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
689      *  DB table.
690      */
691     std::string getBaseFolder() const;
692
693     /* This method gets the parameter list for resource.
694      */
695     ResourceAttributeList getResourceAttribute(
696             const std::string &resourceId) const;
697
698     /* This method checks read only flag for given property
699      */
700     DPL::OptionalInt checkPropertyReadFlag(
701             const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
702
703     /* This method gets widget property key list
704      */
705     PropertyDAOReadOnly::WidgetPropertyKeyList getPropertyKeyList() const;
706
707     /* This method gets widget property list
708      */
709     PropertyDAOReadOnly::WidgetPreferenceList getPropertyList() const;
710
711     /* This method get widget property value
712      */
713     PropertyDAOReadOnly::WidgetPropertyValue getPropertyValue(
714             const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
715
716     LanguageTagList getLanguageTags() const;
717     LanguageTagList getIconLanguageTags() const;
718
719
720
721     WidgetLocalizedInfo getLocalizedInfo(const DPL::String& languageTag) const;
722     std::string getCookieDatabasePath() const;
723     // Local storage
724     std::string getPrivateLocalStoragePath() const;
725
726     bool getBackSupported() const;
727
728     static bool isWidgetInstalled(DbWidgetHandle handle);
729     static bool isWidgetInstalled(const TizenAppId & tzAppId);
730
731     /* This method get path of the splash image.
732      *
733      * @return path of the widget's splash image
734      */
735     DPL::OptionalString getSplashImgSrc() const;
736
737     ExternalLocationList getWidgetExternalLocations() const;
738
739     /*
740      * Default value is required to keep compatibility with
741      * wrt-installer and wrt.
742      */
743     CertificateChainList getWidgetCertificate(
744             CertificateSource source = SIGNATURE_DISTRIBUTOR) const;
745
746     void getWidgetSettings(WidgetSettings& outWidgetSettings) const;
747
748     /**
749      * This method gets application service list that define AUL value
750      *
751      * @return See above comment
752      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
753      */
754     void getAppServiceList(
755             WidgetApplicationServiceList& outAppServiceList) const;
756
757     /**
758      * This method returns the type of the package.
759      *
760      * @return PackagingType
761      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
762      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
763                                                 records in DB table.
764      */
765     PackagingType getPackagingType() const;
766
767     void getEncryptedFileList(EncryptedFileList& filesList) const;
768
769     /**
770      * This method returns widget's background page filename.
771      *
772      * @return Name of file containing background page
773      */
774     DPL::OptionalString getBackgroundPage() const;
775
776     /**
777      * @brief generateTizenId generates new package id
778      *
779      * If widget do not supplies it's own tizen package id, this method can be used,
780      * although it should be removed in future.
781      *
782      * @return new tizen package id
783      */
784     static TizenPkgId generatePkgId();
785     static TizenPkgId generateTizenId() {
786         return generatePkgId();
787     }
788
789     /**
790      * @brief This method return each value for security setting
791      *
792      * @return SettingsType
793      *         SETTINGS_TYPE_UNKNOWN     : unknow value
794      *         SETTINGS_TYPE_ON                : enable
795      *         SETTINGS_TYPE_ALWAYS_ASK : ask by popup
796      *         SETTINGS_TYPE_OFF               : disable
797      */
798     SettingsType getSecurityPopupUsage() const;
799     SettingsType getGeolocationUsage() const;
800     SettingsType getWebNotificationUsage() const;
801     SettingsType getWebDatabaseUsage() const;
802     SettingsType getFileSystemUsage() const;
803
804     /**
805      * This method returns widget's installed path
806      *
807      * @return path of widget installed
808      */
809     DPL::OptionalString getWidgetInstalledPath() const;
810
811     /**
812      * This method returns tizen package id
813      *
814      * @return tizen package id
815      */
816     TizenPkgId getTizenPkgId() const;
817 };
818
819 } // namespace WrtDB
820
821 #endif // _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
822