ac574325ed1addf451d1ab48757e12e6fe0232a2
[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 <wrt-commons/auto-save-dao/common_dao_types.h>
31
32 namespace AutoSaveDB {
33
34 class AutoSaveDAOReadOnly
35 {
36   public:
37     /**
38      * AutoSaveDAOReadOnly 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
49     AutoSaveDAOReadOnly();
50     virtual ~AutoSaveDAOReadOnly();
51
52     static void attachDatabaseRO(void);
53     static void detachDatabase(void);
54
55     /**
56      * This method gets Autofill for Webkit
57      */
58     static DPL::Optional<AutoSaveData> getAutoSaveIdPasswd(
59             const DPL::String &url);
60
61 };
62
63 } // namespace AutoSaveDB
64
65 #endif // _AUTO_SAVE_DAO_READ_ONLY_H_
66