1a1597c32fc7efa0eef2940d81d50776f38be71e
[platform/framework/native/appfw.git] / inc / FIoDataSet.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            FIoDataSet.h
19 * @brief          This is the header file for the %DataSet class.
20 *
21 * This header file contains the declarations of the %DataSet class.
22 */
23
24 #ifndef _FIO_DATA_SET_H_
25 #define _FIO_DATA_SET_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseColIList.h>
29 #include <FIoDataRow.h>
30 #include <FIoDataSetEnumerator.h>
31
32 namespace Tizen { namespace Io
33 {
34
35 /**
36 * @class                DataSet
37 * @brief                This class provides methods to manipulate in-memory table.
38 *
39 * @since                2.1
40 *
41 * @final                This class is not intended for extension.
42 *
43 * The %DataSet class provides methods to manipulate in-memory table.
44 */
45 class _OSP_EXPORT_ DataSet
46            : public Tizen::Base::Object
47 {
48
49 public:
50         /**
51         * The object is not fully constructed after this constructor is called. For full construction,
52         * the Construct() method must be called right after calling this constructor.
53         *
54         * @since                2.1
55         */
56         DataSet(void);
57
58         /**
59         * This destructor overrides Tizen::Base::Object::~Object().
60         *
61         * @since                2.1
62         */
63         virtual ~DataSet(void);
64
65         /**
66         * Creates in-memory table.
67         *
68         * @since                2.1
69         *
70         * @return               An error code
71         * @param[in]            columnNames             The list of column names to create @n
72         *                                                               The object type in the specified list should be String.
73         * @exception            E_SUCCESS               The method is successful.
74         * @exception            E_INVALID_ARG   The specified @c columnNames has no element.
75         */
76         result Construct(const Tizen::Base::Collection::IList& columnNames);
77
78         /**
79         * Creates a row in the table.
80         *
81         * @since                2.1
82         *
83         * @return       A pointer to the DataRow instance, @n
84         *                       else @c null if the memory is insufficient
85         * @remarks      The column type is decided by the type of each element inserted in first row.
86         *                       If a specific column element on the first row is not inserted, then the column's type is @c DB_COLUMNTYPE_NULL
87         *                               In that case, when a new column element is added later,
88         *                               then the column's type will be changed according to the new element.
89         */
90         DataRow* CreateDataRowN(void);
91
92         /**
93         * Gets a table enumerator.
94         *
95         * @since                2.1
96         *
97         * @return       A pointer to the DataSetEnumerator instance, @n
98         *                       else @c null if the memory is insufficient
99         */
100         DataSetEnumerator* GetDataSetEnumeratorN(void);
101
102
103         /**
104         * Gets a copy of this instance.
105         *
106         * @since                2.1
107         *
108         * @return       A pointer to the copy of the %DataSet instance, @n
109         *                       else @c null if the memory is insufficient
110         */
111         DataSet* CloneN(void) const;
112
113         /**
114         * Checks whether the value of a specified instance of Tizen::Base::Object is equal to the value of a current instance of
115         * %DataSet.
116         *
117         * @since                2.1
118         *
119         * @return       @c true if the value of the specified instance of Tizen::Base::Object is equal to the value of the current
120         *                       instance of %DataSet, @n
121         *                       else @c false
122         * @param[in]    obj             An instance of Tizen::Base::Object to compare
123         * @remarks      This method returns @c false if the specified @c obj is not a %DataSet instance.
124         */
125         virtual bool Equals(const Tizen::Base::Object& obj) const;
126
127         /**
128         * Gets the hash value of a current instance.
129         *
130         * @since                2.1
131         *
132         * @return       The hash value of the current instance
133         */
134         virtual int GetHashCode(void) const;
135
136 private:
137         //
138         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
139         //
140         // @since       2.1
141         //
142
143         DataSet(const DataSet& value);
144
145         //
146         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
147         //
148         // @since       2.1
149         //
150         DataSet& operator =(const DataSet& rhs);
151
152         class _DataSetImpl* __pDataSetImpl;
153         friend class _DataSetImpl;
154
155 }; // DataSet
156
157 }} // Tizen::Io
158
159 #endif // _FIO_DATA_SET_H_