Add an E_RESOURCE_UNAVAILABLE in IPC
[platform/framework/native/appfw.git] / src / io / inc / FIo_DbStatementImpl.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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 /**
18  * @file        FIo_DbEnumeratorImpl.h
19  * @brief       This is the header file for the %_DbEnumeratorImpl class.
20  *
21  * This header file contains declarations of the %_DbEnumeratorImpl class.
22  */
23
24 #ifndef _FIO_INTERNAL_DBSTATEMENT_IMPL_H_
25 #define _FIO_INTERNAL_DBSTATEMENT_IMPL_H_
26
27 #include <FOspConfig.h>
28
29 #include <FIoDbStatement.h>
30
31 namespace Tizen { namespace Base
32 {
33 class String;
34 class ByteBuffer;
35 class DateTime;
36 }}
37
38 namespace Tizen { namespace Io
39 {
40
41 class _DatabaseImpl;
42
43 /**
44  * @enum        _DbStatementType
45  * Defines      types of statement.
46  * @since 2.1
47  */
48 enum _DbStatementType
49 {
50         DB_STATEMENT_TYPE_OTHER = 0,
51         DB_STATEMENT_TYPE_SELECT = 1
52 };
53
54 /**
55  * @class       _DbStatementImpl
56  * @brief       This class implements the DbStatement.
57  * @since 2.1
58  *
59  * @see Tizen::Io::DbStatement
60  */
61 class _OSP_EXPORT_ _DbStatementImpl
62         : public Tizen::Base::Object
63 {
64
65 public:
66         _DbStatementImpl(void);
67
68         virtual ~_DbStatementImpl(void);
69
70         result BindInt(int columnIndex, int value);
71
72         result BindInt64(int columnIndex, long long value);
73
74         result BindDouble(int columnIndex, double value);
75
76         result BindString(int columnIndex, const Tizen::Base::String& value);
77
78         result BindBlob(int columnIndex, const Tizen::Base::ByteBuffer& value);
79
80         result BindBlob(int columnIndex, const void* buffer, int size);
81
82         result BindDateTime(int columnIndex, const Tizen::Base::DateTime& value);
83
84         result BindNull(int columnIndex);
85
86         static _DbStatementImpl* GetInstance(DbStatement& dbStatement);
87
88         static const _DbStatementImpl* GetInstance(const DbStatement& dbStatement);
89
90         static DbStatement* CreateDbStatementInstanceN(void);
91 private:
92         bool __shouldReleaseResource;
93         _DbStatementType __stmtType;
94         void* __pStmt;
95         void* __pDatabase;
96
97         friend class _DatabaseImpl;
98
99 }; //_DbStatementImpl
100
101 }} // Tizen::Io
102
103 #endif  //_FIO_INTERNAL_DBSTATEMENT_IMPL_H_
104