76292ad16fa2969db82e7c53d3bdfce270b72a1a
[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 is used as a getter for csp policy of widget. It should be
502      * provided in configuration file.
503      * @return global csp policy for widget
504      */
505     DPL::OptionalString getCspPolicy() const;
506
507     /**
508      * This method returns list filed with Common Name entries from certificate.
509      *
510      * @return Common Name of Distribuotor End Entity certificate.
511      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
512      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
513      *  DB table.
514      */
515     WidgetCertificateCNList getKeyCommonNameList(
516             WidgetCertificateData::Owner owner,
517             WidgetCertificateData::Type type) const;
518
519     /**
520      * given a certificate owner (author / distributor) and type of certificate
521      * (end entity / ca)
522      * function returns list of matching fingerprints
523      */
524     FingerPrintList getKeyFingerprints(
525             WidgetCertificateData::Owner owner,
526             WidgetCertificateData::Type type) const;
527
528     /*
529      *  This method gets certificate data list for a widget from database.
530      */
531     WidgetCertificateDataList getCertificateDataList() const;
532
533     /**
534      * This method returns a list of widget features.
535      *
536      * @see WidgetFeature
537      * @see FreeFeatureList()
538      * @return list of widget features, type of list element is structure
539      *  WidgetFeature
540      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
541      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
542      *  DB table.
543      */
544     DbWidgetFeatureSet getFeaturesList() const;
545
546     static WidgetParamMap getFeatureParams(int widgetFeatureId);
547     /**
548      * This method checks whether widget has specified feature.
549      *
550      * @return true if has, false if has not
551      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
552      */
553     bool hasFeature(const std::string& featureName) const;
554
555     /**
556      * This method gets host list that widget can connect to.
557      *
558      * @return See above comment
559      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
560      */
561     HostList getAccessHostList() const;
562
563     /**
564      * This method gets widget's access on network: true or false.
565      *
566      * @return true: widget can access network; false: widget can not access
567      *  network.
568      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
569      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
570      *  DB table.
571      */
572     bool getAccessNetworkMode() const;
573
574     /**
575      * This method gets if widget needs webkit plugins enabled
576      *
577      * @return true: widget needs webkit plugins enabled
578      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
579      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
580      *  DB table.
581      */
582     bool getWebkitPluginsRequired() const;
583
584     /**
585      * This method returns a list of all the installed widgets' app id.
586      *
587      * @return list of installed widgets' app id.
588      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
589      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
590      *  DB table.
591      */
592     static DbWidgetHandleList getHandleList();
593
594     /**
595      * This method returns list of pkgname of installed packages
596      * @return list of pkgname of installed packages
597      */
598     static TizenAppIdList getTizenAppidList();
599     static WidgetPkgNameList getPkgnameList();
600
601     /**
602      * This method returns a list of all the installed widgets.
603      *
604      * @return list of installed widgets.
605      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
606      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
607      *  DB table.
608      */
609     static DbWidgetDAOReadOnlyList getWidgetList();
610
611    /**
612      * This method removes a widget's information from EmDB.
613      *
614      * @see RegisterWidget()
615      * @param[in] widgetHandle    widget's app id
616      * @return true if succeed, false if fail.
617      */
618     static void unregisterWidget(DbWidgetHandle widgetHandle);
619
620     /**
621      * This method gets author's infomation of a widget which is parsed from
622      *  configiration document.
623      *
624      * @see WidgetAuthorInfo
625      * @param[out] pAuthorInfo
626      * @return true if succeed, false if fail.
627      */
628     WidgetAuthorInfo getAuthorInfo() const;
629
630     /**
631      * This method gets author's name of a widget which is parsed from
632      *  configiration document.
633      *
634      * @param[out] pAuthorInfo
635      * @return author's name.
636      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
637      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
638      *  DB table.
639      */
640     DPL::OptionalString getAuthorName() const;
641
642     /**
643      * This method gets author's email of a widget which is parsed from
644      *  configiration document.
645      *
646      * @param[out] pAuthorInfo
647      * @return author's email.
648      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
649      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
650      *  DB table.
651      */
652     DPL::OptionalString getAuthorEmail() const;
653
654     /**
655      * This method gets author's email of a widget which is parsed from
656      *  configiration document.
657      *
658      * @param[out] pAuthorInfo
659      * @return author's email.
660      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
661      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
662      *  DB table.
663      */
664     DPL::OptionalString getAuthorHref() const;
665
666     /**
667      * This method returns minimum version of WAC that WRT has to be compliant
668      *  to to run this widget
669      *
670      * @return Minimum version
671      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
672      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
673      *  DB table.
674      */
675     DPL::OptionalString getMinimumWacVersion() const;
676
677     /* This method get widget' share href.
678      *
679      * @return widget's share href
680      */
681     std::string getShareHref() const;
682
683     /**
684      * This method get widget installed time
685      *
686      * @return time_t : return widget's install time
687      */
688     time_t getInstallTime() const;
689
690     /**
691      * This method gets widget base folder.
692      *
693      * @return widget base folder.
694      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
695      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
696      *  DB table.
697      */
698     std::string getBaseFolder() const;
699
700     /* This method gets the parameter list for resource.
701      */
702     ResourceAttributeList getResourceAttribute(
703             const std::string &resourceId) const;
704
705     /* This method checks read only flag for given property
706      */
707     DPL::OptionalInt checkPropertyReadFlag(
708             const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
709
710     /* This method gets widget property key list
711      */
712     PropertyDAOReadOnly::WidgetPropertyKeyList getPropertyKeyList() const;
713
714     /* This method gets widget property list
715      */
716     PropertyDAOReadOnly::WidgetPreferenceList getPropertyList() const;
717
718     /* This method get widget property value
719      */
720     PropertyDAOReadOnly::WidgetPropertyValue getPropertyValue(
721             const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
722
723     LanguageTagList getLanguageTags() const;
724     LanguageTagList getIconLanguageTags() const;
725
726
727
728     WidgetLocalizedInfo getLocalizedInfo(const DPL::String& languageTag) const;
729     std::string getCookieDatabasePath() const;
730     // Local storage
731     std::string getPrivateLocalStoragePath() const;
732
733     bool getBackSupported() const;
734
735     static bool isWidgetInstalled(DbWidgetHandle handle);
736     static bool isWidgetInstalled(const TizenAppId & tzAppId);
737
738     /* This method get path of the splash image.
739      *
740      * @return path of the widget's splash image
741      */
742     DPL::OptionalString getSplashImgSrc() const;
743
744     ExternalLocationList getWidgetExternalLocations() const;
745
746     /*
747      * Default value is required to keep compatibility with
748      * wrt-installer and wrt.
749      */
750     CertificateChainList getWidgetCertificate(
751             CertificateSource source = SIGNATURE_DISTRIBUTOR) const;
752
753     void getWidgetSettings(WidgetSettings& outWidgetSettings) const;
754
755     /**
756      * This method gets application service list that define AUL value
757      *
758      * @return See above comment
759      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
760      */
761     void getAppServiceList(
762             WidgetApplicationServiceList& outAppServiceList) const;
763
764     /**
765      * This method returns the type of the package.
766      *
767      * @return PackagingType
768      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
769      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
770                                                 records in DB table.
771      */
772     PackagingType getPackagingType() const;
773
774     void getEncryptedFileList(EncryptedFileList& filesList) const;
775
776     /**
777      * This method returns widget's background page filename.
778      *
779      * @return Name of file containing background page
780      */
781     DPL::OptionalString getBackgroundPage() const;
782
783     /**
784      * @brief generateTizenId generates new package id
785      *
786      * If widget do not supplies it's own tizen package id, this method can be used,
787      * although it should be removed in future.
788      *
789      * @return new tizen package id
790      */
791     static TizenPkgId generatePkgId();
792     static TizenPkgId generateTizenId() {
793         return generatePkgId();
794     }
795
796     /**
797      * @brief This method return each value for security setting
798      *
799      * @return SettingsType
800      *         SETTINGS_TYPE_UNKNOWN     : unknow value
801      *         SETTINGS_TYPE_ON                : enable
802      *         SETTINGS_TYPE_ALWAYS_ASK : ask by popup
803      *         SETTINGS_TYPE_OFF               : disable
804      */
805     SettingsType getSecurityPopupUsage() const;
806     SettingsType getGeolocationUsage() const;
807     SettingsType getWebNotificationUsage() const;
808     SettingsType getWebDatabaseUsage() const;
809     SettingsType getFileSystemUsage() const;
810
811     /**
812      * This method returns widget's installed path
813      *
814      * @return path of widget installed
815      */
816     DPL::OptionalString getWidgetInstalledPath() const;
817
818     /**
819      * This method returns tizen package id
820      *
821      * @return tizen package id
822      */
823     TizenPkgId getTizenPkgId() const;
824 };
825
826 } // namespace WrtDB
827
828 #endif // _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
829