Tizen 2.0 Release
[framework/web/wrt-commons.git] / modules / custom_handler_dao / include / wrt-commons / custom-handler-dao-rw / custom_handler_dao.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.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 #ifndef _CUSTOM_HANDLER_DAO_H_
25 #define _CUSTOM_HANDLER_DAO_H_
26
27 #include <wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h>
28
29 namespace CustomHandlerDB {
30
31 class CustomHandlerDAO : public CustomHandlerDAOReadOnly
32 {
33   public:
34     explicit CustomHandlerDAO(const DPL::String& pkgName);
35     virtual ~CustomHandlerDAO();
36
37     /**
38      * Registers custom content handler
39      */
40     void registerContentHandler(const CustomHandler& handler);
41
42     /**
43      * Registers custom protocol handler
44      */
45     void registerProtocolHandler(const CustomHandler& handler);
46
47     /**
48      * Unregisters custom content handler
49      */
50     void unregisterContentHandler(const DPL::String& target,
51                                   const DPL::String& burl);
52     /**
53      * Unregisters custom protocol handler
54      */
55     void unregisterProtocolHandler(const DPL::String& target,
56                                    const DPL::String& url);
57
58     void unregisterContentHandler(const DPL::String& target,
59                                   const DPL::String& url,
60                                   const DPL::String& baseURL);
61
62     void unregisterProtocolHandler(const DPL::String& target,
63                                    const DPL::String& url,
64                                    const DPL::String& baseURL);
65
66     /**
67      * Removes all widget entries connected to given ID
68      */
69     void removeWidgetProtocolHandlers();
70     void removeWidgetContentHandlers();
71 };
72
73 } // namespace CustomHandlerDB
74
75 #endif // _CUSTOM_HANDLER_DAO_H_