Tizen 2.0 Release
[framework/web/wrt-commons.git] / modules / custom_handler_dao / include / wrt-commons / custom-handler-dao-ro / custom_handler_dao_read_only.h
1 /*
2  * Copyright (c) 2012 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 custom handler dao class.
18  *
19  * @file    custom_handler_dao_read_only.h
20  * @author  Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
21  * @version 1.0
22  * @brief   This file contains the declaration of custom handler dao
23  */
24
25 #ifndef _CUSTOM_HANDLER_DAO_READ_ONLY_H_
26 #define _CUSTOM_HANDLER_DAO_READ_ONLY_H_
27
28 #include <dpl/string.h>
29 #include <dpl/exception.h>
30 #include "common_dao_types.h"
31
32 namespace CustomHandlerDB {
33
34 class CustomHandlerDAOReadOnly
35 {
36   public:
37     /**
38      * CustomHandlerDAOReadOnly Exception classes
39      */
40     class Exception
41     {
42       public:
43         DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
44         DECLARE_EXCEPTION_TYPE(Base, DatabaseError)
45     };
46
47   public:
48     explicit CustomHandlerDAOReadOnly(const DPL::String& pkgName);
49     virtual ~CustomHandlerDAOReadOnly();
50
51     /**
52      * Returns protocol handler
53      */
54     CustomHandlerPtr getProtocolHandler(const DPL::String& protocol,
55                                         const DPL::String& url);
56     CustomHandlerPtr getProtocolHandler(const DPL::String& protocol,
57                                         const DPL::String& url,
58                                         const DPL::String& baseURL);
59
60     /**
61      * Returns protocol handler that is agreed or agreed and saved and match tizenID
62      */
63     CustomHandlerPtr getActivProtocolHandler(const DPL::String& protocol);
64
65
66
67     /**
68      * Returns content handler
69      */
70     CustomHandlerPtr getContentHandler(const DPL::String& content,
71                                        const DPL::String& url);
72     CustomHandlerPtr getContentHandler(const DPL::String& protocol,
73                                        const DPL::String& url,
74                                        const DPL::String& baseURL);
75
76     /**
77      * Returns content handler that is agreed or agreed and saved and match tizenID
78      */
79     CustomHandlerPtr getActivContentHandler(const DPL::String& content);
80
81     /**
82      * Returns allowed handler for given protocol
83      */
84     CustomHandlerPtr getAllowedProtocolHandler(const DPL::String& protocol);
85
86     /**
87      * Returns allowed handler for given content
88      */
89     CustomHandlerPtr getAllowedContentHandler(const DPL::String& protocol);
90
91   protected:
92     DPL::String m_pkgName;
93 };
94
95 } // namespace CustomHandlerDB
96
97 #endif // _CUSTOM_HANDLER_DAO_READ_ONLY_H_
98