tizen 2.4 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 class CustomHandlerDAO : public CustomHandlerDAOReadOnly
31 {
32   public:
33     explicit CustomHandlerDAO(const DPL::String& pkgName);
34     virtual ~CustomHandlerDAO();
35
36     /**
37      * Registers custom content handler
38      */
39     void registerContentHandler(const CustomHandler& handler);
40
41     /**
42      * Registers custom protocol handler
43      */
44     void registerProtocolHandler(const CustomHandler& handler);
45
46     /**
47      * Unregisters custom content handler
48      */
49     void unregisterContentHandler(const DPL::String& target,
50                                   const DPL::String& burl);
51     /**
52      * Unregisters custom protocol handler
53      */
54     void unregisterProtocolHandler(const DPL::String& target,
55                                    const DPL::String& url);
56
57     void unregisterContentHandler(const DPL::String& target,
58                                   const DPL::String& url,
59                                   const DPL::String& baseURL);
60
61     void unregisterProtocolHandler(const DPL::String& target,
62                                    const DPL::String& url,
63                                    const DPL::String& baseURL);
64
65     /**
66      * Removes all widget entries connected to given ID
67      */
68     void removeWidgetProtocolHandlers();
69     void removeWidgetContentHandlers();
70 };
71 } // namespace CustomHandlerDB
72
73 #endif // _CUSTOM_HANDLER_DAO_H_