62ae28840fe6c02494eecb604097a322aba07a8a
[platform/framework/native/appfw.git] / inc / FIoDataRow.h
1 //
2 // Copyright (c) 2013 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         FIoDataRow.h
19 * @brief                This is the header file for the %DataRow class.
20 *
21 * This header file contains the declarations of the %DataRow class.
22 */
23
24 #ifndef _FIO_DATA_ROW_H_
25 #define _FIO_DATA_ROW_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseByteBuffer.h>
29 #include <FBaseDateTime.h>
30
31 namespace Tizen { namespace Io
32 {
33
34 /**
35 * @class                DataRow
36
37 * @brief                This class provides methods to create a row in in-memory table.
38 *
39 * @since                2.1
40 *
41 * @final                This class is not intended for extension.
42 *
43 * The %DataRow class provides methods to create a row in in-memory table.
44 *
45 * @see Tizen::Io::DataSet
46 */
47 class _OSP_EXPORT_ DataRow
48            : public Tizen::Base::Object
49 {
50
51 public:
52         /**
53         * This destructor overrides Tizen::Base::Object::~Object().
54         *
55         * @since                2.1
56         */
57         virtual ~DataRow(void);
58
59         /**
60         * Sets a Tizen::Base::ByteBuffer value to the column whose index is specified.
61         *
62         * @since                2.1
63         *
64         * @return               An error code
65         * @param[in]            columnIndex             The index of the column whose value is set @n
66         *                                                               The column index starts from 0.
67         * @param[in]            pValue                  The value to set @n
68         *                                                               The specified @c pValue is a pointer to user-provided Tizen::Base::ByteBuffer type buffer.
69         * @exception            E_SUCCESS               The method is successful.
70         * @exception            E_INVALID_ARG   Either of the following conditions has occurred: @n
71         *                                                                       - The specified @c columnIndex is out of range.
72         *                                                                       - The specified @c pValue is @c null.
73         * @exception            E_TYPE_MISMATCH The operation has attempted to access columns of different types.
74         * @remarks              This method performs a shallow copy. It copies only the pointer; not the element itself. @n
75         *                               The platform will take the ownership of @c pValue after calling this method.
76         */
77         result SetBlobAt(int columnIndex, Tizen::Base::ByteBuffer* pValue);
78
79
80         /**
81         * Sets a Tizen::Base::DateTime value to the column whose index is specified.
82         *
83         * @since                2.1
84         *
85         * @return               An error code
86         * @param[in]    columnIndex                     The index of the column whose value is set @n
87         *                                                                       The column index starts from 0.
88         * @param[in]    value                           The value to set
89         * @exception    E_SUCCESS                       The method is successful.
90         * @exception    E_INVALID_ARG           The specified @c columnIndex is out of range.
91         * @exception    E_TYPE_MISMATCH         The operation has attempted to access columns of different types.
92         * @remarks              Tizen::Io::DbColumnType of the specified @c value is DB_COLUMNTYPE_TEXT.
93         */
94         result SetDateTimeAt(int columnIndex, const Tizen::Base::DateTime& value);
95
96
97         /**
98         * Sets a @c double value to the column whose index is specified.
99         *
100         * @since                2.1
101         *
102         * @return               An error code
103         * @param[in]            columnIndex             The index of the column whose value is set @n
104         *                                                               The column index starts from 0.
105         * @param[in]            value                   The value to set
106         * @exception            E_SUCCESS                       The method is successful.
107         * @exception            E_INVALID_ARG           The specified @c columnIndex is out of range.
108         * @exception            E_TYPE_MISMATCH The operation has attempted to access columns of different types.
109         */
110         result SetDoubleAt(int columnIndex, double value);
111
112         /**
113         * Sets an @c int value to the column whose index is specified.
114         *
115         * @since                2.1
116         *
117         * @return               An error code
118         * @param[in]            columnIndex             The index of the column whose value is set @n
119         *                                                               The column index starts from 0.
120         * @param[in]            value                   The value to set
121         * @exception            E_SUCCESS                       The method is successful.
122         * @exception            E_INVALID_ARG           The specified @c columnIndex is out of range.
123         * @exception            E_TYPE_MISMATCH The operation has attempted to access columns of different types.
124         */
125         result SetIntAt(int columnIndex, int value);
126
127         /**
128         * Sets a @c long @c long value to the column whose index is specified.
129         *
130         * @since                2.1
131         *
132         * @return               An error code
133         * @param[in]            columnIndex             The index of the column whose value is set @n
134         *                                                               The column index starts from 0.
135         * @param[in]            value                   The value to set
136         * @exception            E_SUCCESS                       The method is successful.
137         * @exception            E_INVALID_ARG           The specified @c columnIndex is out of range.
138         * @exception            E_TYPE_MISMATCH The operation has attempted to access columns of different types.
139         */
140         result SetInt64At(int columnIndex, long long value);
141
142         /**
143         * Sets a Tizen::Base::String value to the column whose index is specified.
144         *
145         * @since                2.1
146         *
147         * @return               An error code
148         * @param[in]            columnIndex             The index of the column whose value is set @n
149         *                                                               The column index starts from 0.
150         * @param[in]            value                   The value to set
151         * @exception            E_SUCCESS                       The method is successful.
152         * @exception            E_INVALID_ARG           The specified @c columnIndex is out of range.
153         * @exception            E_TYPE_MISMATCH The operation has attempted to access columns of different types.
154         */
155         result SetStringAt(int columnIndex, const Tizen::Base::String& value);
156
157 private:
158         //
159         // This default constructor is intentionally declared as private so that only the platform can create an instance.
160         //
161         // @since       2.1
162         //
163         DataRow(void);
164
165         //
166         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
167         //
168         // @since       2.1
169         //
170         DataRow(const DataRow& rhs);
171
172         //
173         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
174         //
175         // @since       2.1
176         //
177         DataRow& operator =(const DataRow& rhs);
178
179         class _DataRowImpl* __pDataRowImpl;
180         friend class _DataRowImpl;
181
182 }; // DataRow
183
184 }} // Tizen::Io
185
186 #endif // _FIO_DATA_ROW_H_