Tizen 2.0 Release
[framework/web/wrt-commons.git] / modules / auto_save_dao / include / wrt-commons / auto-save-dao-ro / auto_save_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 auto save dao class.
18  *
19  * @file    auto_save_dao_read_only.h
20  * @author  Jihoon Chung (jihoon.chung@samsung.com)
21  * @version 1.0
22  * @brief   This file contains the declaration of auto save dao
23  */
24
25 #ifndef _AUTO_SAVE_DAO_READ_ONLY_H_
26 #define _AUTO_SAVE_DAO_READ_ONLY_H_
27
28 #include <dpl/string.h>
29 #include <dpl/exception.h>
30 #include <dpl/optional.h>
31 #include <wrt-commons/auto-save-dao/common_dao_types.h>
32
33 namespace AutoSaveDB {
34
35 class AutoSaveDAOReadOnly
36 {
37   public:
38     /**
39      * AutoSaveDAOReadOnly Exception classes
40      */
41     class Exception
42     {
43       public:
44         DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
45         DECLARE_EXCEPTION_TYPE(Base, DatabaseError)
46     };
47
48   public:
49
50     AutoSaveDAOReadOnly();
51     virtual ~AutoSaveDAOReadOnly();
52
53     static void attachDatabaseRO(void);
54     static void detachDatabase(void);
55
56     /**
57      * This method gets Autofill for Webkit
58      */
59     static SubmitFormData getAutoSaveSubmitFormData(
60             const DPL::String &url);
61
62 };
63
64 } // namespace AutoSaveDB
65
66 #endif // _AUTO_SAVE_DAO_READ_ONLY_H_
67