Revert "Unused fields in WidgetRegisterInfo"
[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     WidgetType type; // TODO : This type will be removed.
167     DPL::OptionalString guid;
168     DPL::OptionalString version;
169     DPL::OptionalString minVersion;
170     std::string shareHref;
171     std::string baseFolder;
172     WidgetSignatureType signatureType;
173     int isTestWidget;
174     ConfigParserData configInfo;
175     LocalizationData localizationData;
176
177     DPL::OptionalString pkgname;
178     WidgetPkgName pkgName;
179     TizenPkgId tzPkgid;
180     TizenAppId tzAppid;
181
182     time_t installedTime;
183     PackagingType packagingType;
184     EncryptedFileList encryptedFiles;
185     ExternalLocationList externalLocations;
186     DPL::OptionalString widgetInstalledPath;
187 };
188
189 typedef std::list<std::string> CertificateChainList;
190 class IWacSecurity
191 {
192   public:
193     virtual ~IWacSecurity();
194
195     virtual const WidgetCertificateDataList& getCertificateList() const = 0;
196
197     virtual bool isRecognized() const = 0;
198
199     virtual bool isDistributorSigned() const = 0;
200
201     virtual bool isWacSigned() const = 0;
202
203     virtual void getCertificateChainList(CertificateChainList& list,
204                                          CertificateSource source) const = 0;
205 };
206
207 /**
208  * WidgetAuthorInfo.
209  * Structure to hold the information of widget's author.
210  */
211 struct WidgetAuthorInfo
212 {
213     DPL::OptionalString name;
214     DPL::OptionalString email;
215     DPL::OptionalString href;
216 };
217
218 /**
219  * Widget update policy
220  */
221 enum WidgetUpdatePolicy
222 {
223     WIDGET_UPDATE_MONTHLY = 0,  //< monthly update
224     WIDGET_UPDATE_WEEKLY,       //< weekly update
225     WIDGET_UPDATE_DAILY,        //< daily update
226     WIDGET_UPDATE_STARTUP,      //< update when cell phone boots
227     WIDGET_UPDATE_NEVER         //< never update
228 };
229
230 typedef std::list <std::string> WidgetCertificateCNList;
231 typedef std::list<DPL::String> LanguageTagList;
232 typedef std::list<std::string> HostList;
233 typedef std::list<std::string> FingerPrintList;
234 typedef std::list<std::string> ResourceAttributeList;
235
236 class WidgetDAOReadOnly
237 {
238   public:
239     /**
240      * WidgetDAO Exception classes
241      */
242     class Exception
243     {
244       public:
245         DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
246         DECLARE_EXCEPTION_TYPE(Base, DatabaseError)
247         DECLARE_EXCEPTION_TYPE(Base, ReadOnlyProperty)
248         DECLARE_EXCEPTION_TYPE(Base, GUIDisNull)
249         DECLARE_EXCEPTION_TYPE(Base, UnexpectedEmptyResult)
250         DECLARE_EXCEPTION_TYPE(Base, WidgetNotExist)
251         DECLARE_EXCEPTION_TYPE(Base, AlreadyRegistered)
252     };
253
254   protected:
255     DbWidgetHandle m_widgetHandle;
256
257   public:
258     struct WidgetLocalizedIconRow
259     {
260         int appId;
261         int iconId;
262         DPL::String widgetLocale;
263     };
264     typedef std::list<WidgetLocalizedIconRow> WidgetLocalizedIconList;
265
266     struct WidgetIconRow
267     {
268         int iconId;
269         int appId;
270         DPL::String iconSrc;
271         DPL::OptionalInt iconWidth;
272         DPL::OptionalInt iconHeight;
273     };
274     typedef std::list<WidgetIconRow> WidgetIconList;
275
276     struct WidgetStartFileRow
277     {
278         int startFileId;
279         int appId;
280         DPL::String src;
281     };
282     typedef std::list<WidgetStartFileRow> WidgetStartFileList;
283
284     struct WidgetLocalizedStartFileRow
285     {
286         int startFileId;
287         int appId;
288         DPL::String widgetLocale;
289         DPL::String type;
290         DPL::String encoding;
291     };
292     typedef std::list<WidgetLocalizedStartFileRow> LocalizedStartFileList;
293
294     /**
295      * This is a constructor.
296      *
297      * @param[in] widgetHandle application id of widget.
298      */
299     WidgetDAOReadOnly(DbWidgetHandle widgetHandle);
300     WidgetDAOReadOnly(DPL::OptionalString widgetGUID);
301     WidgetDAOReadOnly(DPL::String tzAppid);
302
303     /**
304      * Destructor
305      */
306     virtual ~WidgetDAOReadOnly();
307
308     /**
309      * This method returns widget handle(m_widgetHandle).
310      *
311      * @return widget handle(m_widgetHandle).
312      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
313      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
314      * DB table.
315      */
316     DbWidgetHandle getHandle() const;
317     static DbWidgetHandle getHandle(const WidgetGUID GUID);
318     static DbWidgetHandle getHandle(const DPL::String pkgName);
319
320     /**
321      * Returns tizenAppId for the specified widget
322      *
323      * @return tzAppid;
324      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
325      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
326      * DB table.
327      */
328
329     TizenAppId getTzAppId() const;
330     static TizenAppId getTzAppId(const WidgetGUID GUID);
331     static TizenAppId getTzAppId(const DbWidgetHandle handle);
332     static TizenAppId getTzAppId(const TizenPkgId tzPkgid);
333
334     /**
335      * Returns WidgetPkgName for the specified widget
336      *
337      * @return pkgName;
338      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
339      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
340      * DB table.
341      */
342
343     WidgetPkgName getPkgName() const;
344     static WidgetPkgName getPkgName(const WidgetGUID GUID);
345     static WidgetPkgName getPkgName(const DbWidgetHandle handle);
346
347     /**
348      * This method returns the root directory of widget resource.
349      *
350      * @return path name of root directory.
351      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
352      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
353      * DB table.
354      */
355     DPL::String getPath() const;
356
357     DPL::String getFullPath() const;
358
359     /**
360      * This method returns the preferred size of the widget,
361      * including width and height.
362      *
363      * @see DbWidgetSize
364      * @return An structure type variable to hold widget's size.
365      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
366      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
367      *                                          DB table.
368      */
369     DbWidgetSize getPreferredSize() const;
370
371     /**
372      * This method returns the type of the widget.
373      *
374      * @return WidgetType
375      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
376      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching
377      *                                          records in DB table.
378      */
379     WidgetType getWidgetType() const;
380
381     /**
382      * This method returns the id of the widget.
383      *
384      * @return widget id
385      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
386      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
387      *  DB table.
388      */
389     WidgetGUID getGUID() const;
390
391     /**
392      * This method returns the App id of the widget.
393      *
394      * @return appid
395      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
396      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
397      * DB table.
398      */
399     DPL::OptionalString getTizenAppId() const;
400
401     /**
402      * This method returns the defaultlocale for the widget.
403      *
404      * @return defaultlocale
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     DPL::OptionalString getDefaultlocale() const;
410
411     /**
412      * This method returns list of localized 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     WidgetLocalizedIconList getLocalizedIconList() const;
419
420     /**
421      * This method returns list of icons 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     WidgetIconList getIconList() const;
428
429     /**
430      * This method returns list of localized 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     LocalizedStartFileList getLocalizedStartFileList() const;
437
438     /**
439      * This method returns list of start files;
440      *
441      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
442      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
443      *  DB table.
444      */
445     WidgetStartFileList getStartFileList() const;
446
447     /**
448      * @param[out] outAccessInfoList list filled with access info structures
449      */
450     void getWidgetAccessInfo(WidgetAccessInfoList& outAccessInfoList) const;
451
452     /**
453      * WAC 2.0 extension
454      * @return recognized status
455      */
456     bool isRecognized() const;
457
458     /**
459      * WAC 2.0 extension
460      * @return
461      */
462     bool isWacSigned() const;
463
464     /**
465      * WAC 2.0 extension
466      * @return
467      */
468     bool isDistributorSigned() const;
469
470     /**
471      * WAC 2.0 extension
472      * @return trusted status
473      */
474     bool isTrusted() const;
475
476     /**
477      * WAC 2.0 extension
478      * @return is WAC test widget
479      */
480     bool isTestWidget() const;
481
482     /**
483      * This method returns window mode of widget.
484      *
485      * @return window modes of widget
486      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
487      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
488      *  DB table.
489      */
490     WindowModeList getWindowModes() const;
491
492     /**
493      * This method returns the version of the widget.
494      *
495      * @return version of widget
496      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
497      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
498      *  DB table.
499      */
500     DPL::OptionalString getVersion() const;
501
502     /**
503      * This method is used as a getter for csp policy of widget. It should be
504      * provided in configuration file.
505      * @return global csp policy for widget
506      */
507     DPL::OptionalString getCspPolicy() const;
508
509     /**
510      * This method returns list filed with Common Name entries from certificate.
511      *
512      * @return Common Name of Distribuotor End Entity certificate.
513      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
514      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
515      *  DB table.
516      */
517     WidgetCertificateCNList getKeyCommonNameList(
518         WidgetCertificateData::Owner owner,
519         WidgetCertificateData::Type type) const;
520
521     /**
522      * given a certificate owner (author / distributor) and type of certificate
523      * (end entity / ca)
524      * function returns list of matching fingerprints
525      */
526     FingerPrintList getKeyFingerprints(
527         WidgetCertificateData::Owner owner,
528         WidgetCertificateData::Type type) const;
529
530     /*
531      *  This method gets certificate data list for a widget from database.
532      */
533     WidgetCertificateDataList getCertificateDataList() const;
534
535     /**
536      * This method returns a list of widget features.
537      *
538      * @see WidgetFeature
539      * @see FreeFeatureList()
540      * @return list of widget features, type of list element is structure
541      *  WidgetFeature
542      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
543      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
544      *  DB table.
545      */
546     DbWidgetFeatureSet getFeaturesList() const;
547
548     static WidgetParamMap getFeatureParams(int widgetFeatureId);
549     /**
550      * This method checks whether widget has specified feature.
551      *
552      * @return true if has, false if has not
553      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
554      */
555     bool hasFeature(const std::string& featureName) const;
556
557     /**
558      * This method gets host list that widget can connect to.
559      *
560      * @return See above comment
561      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
562      */
563     HostList getAccessHostList() const;
564
565     /**
566      * This method gets widget's access on network: true or false.
567      *
568      * @return true: widget can access network; false: widget can not access
569      *  network.
570      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
571      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
572      *  DB table.
573      */
574     bool getAccessNetworkMode() const;
575
576     /**
577      * This method gets if widget needs webkit plugins enabled
578      *
579      * @return true: widget needs webkit plugins enabled
580      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
581      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
582      *  DB table.
583      */
584     bool getWebkitPluginsRequired() const;
585
586     /**
587      * This method returns a list of all the installed widgets' app id.
588      *
589      * @return list of installed widgets' app id.
590      * @exception WRT_CONF_ERR_EMDB_FAILURE - Fail to query DB table.
591      * @exception WRT_CONF_ERR_EMDB_NO_RECORD - Can not find matching records in
592      *  DB table.
593      */
594     static DbWidgetHandleList getHandleList();
595
596     /**
597      * This method returns list of pkgname of installed packages
598      * @return list of pkgname of installed packages
599      */
600     static TizenAppIdList getTizenAppidList();
601     static WidgetPkgNameList getPkgnameList();
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 gets the parameter list for resource.
703      */
704     ResourceAttributeList getResourceAttribute(
705         const std::string &resourceId) const;
706
707     /* This method checks read only flag for given property
708      */
709     DPL::OptionalInt checkPropertyReadFlag(
710         const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
711
712     /* This method gets widget property key list
713      */
714     PropertyDAOReadOnly::WidgetPropertyKeyList getPropertyKeyList() const;
715
716     /* This method gets widget property list
717      */
718     PropertyDAOReadOnly::WidgetPreferenceList getPropertyList() const;
719
720     /* This method get widget property value
721      */
722     PropertyDAOReadOnly::WidgetPropertyValue getPropertyValue(
723         const PropertyDAOReadOnly::WidgetPropertyKey &key) const;
724
725     LanguageTagList getLanguageTags() const;
726     LanguageTagList getIconLanguageTags() const;
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
787      * used,
788      * although it should be removed in future.
789      *
790      * @return new tizen package id
791      */
792     static TizenPkgId generatePkgId();
793     static TizenPkgId generateTizenId()
794     {
795         return generatePkgId();
796     }
797
798     /**
799      * @brief This method return each value for security setting
800      *
801      * @return SettingsType
802      *         SETTINGS_TYPE_UNKNOWN     : unknow value
803      *         SETTINGS_TYPE_ON                : enable
804      *         SETTINGS_TYPE_ALWAYS_ASK : ask by popup
805      *         SETTINGS_TYPE_OFF               : disable
806      */
807     SettingsType getSecurityPopupUsage() const;
808     SettingsType getGeolocationUsage() const;
809     SettingsType getWebNotificationUsage() const;
810     SettingsType getWebDatabaseUsage() const;
811     SettingsType getFileSystemUsage() const;
812
813     /**
814      * This method returns widget's installed path
815      *
816      * @return path of widget installed
817      */
818     DPL::OptionalString getWidgetInstalledPath() const;
819
820     /**
821      * This method returns tizen package id
822      *
823      * @return tizen package id
824      */
825     TizenPkgId getTizenPkgId() const;
826 };
827 } // namespace WrtDB
828
829 #endif // _WRT_SRC_CONFIGURATION_WIDGET_DAO_READ_ONLY_H_
830