Merge "Fix Jira issue (db lock issue)" into tizen_2.1
[platform/framework/native/appfw.git] / src / io / inc / FIo_DataControlResultSetImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FIo_DataControlResultSetImpl.h
20  * @brief       This is the header file for the %_DataControlResultSetImpl class.
21  *
22  * This header file contains the declarations of the %_DataControlResultSetImpl class.
23  */
24
25 #ifndef _FIO_INTERNAL_DATACONTROL_RESULTSET_IMPL_H_
26 #define _FIO_INTERNAL_DATACONTROL_RESULTSET_IMPL_H_
27
28 #include <FBaseDataType.h>
29 #include <FBaseObject.h>
30 #include <FOspConfig.h>
31 #include <FIoDbEnumerator.h>
32
33 namespace Tizen { namespace App
34 {
35 class _AppImpl;
36 }}
37 namespace Tizen { namespace Base
38 {
39 class String;
40 }}
41
42 namespace Tizen { namespace Io
43 {
44
45 class DbEnumerator;
46
47 class _OSP_EXPORT_ _DataControlResultSetImpl
48         : public Tizen::Base::Object
49 {
50
51 public:
52         /**
53         * This is the constructor for this class.
54         *
55         * @since 2.1
56         * @param[in]    reqId           The request ID @n
57         *                                                       It is identification for data control request to be replied
58         */
59         _DataControlResultSetImpl(RequestId reqId);
60
61         /**
62         * This is the destructor for this class.
63         *
64         * @since 2.1
65         */
66         virtual ~_DataControlResultSetImpl(void);
67
68         /**
69         * Fills result set with the specified @c dbEnumerator.
70         *
71         * @since 2.1
72         * @return               An error code
73         * @param[in]    dbEnumerator            %Database enumerator instance
74         * @exception    E_SUCCESS                       The method was successful.
75         * @exception    E_INVALID_STATE         Either of the following conditions has occurred:
76         *                                                                       - This instance has not been properly constructed.
77         *                                                                       - The specified @c dbEnumerator has already been set.
78         * @exception    E_DATABASE                      Either of the following conditions has occurred:
79         *                                                                       - The database file was closed.
80         *                                                                       - The database engine has failed to execute query.
81         * @exception    E_IO                            Either of the following conditions has occurred:
82         *                                                                       - An unexpected device failure has occurred as the media ejected suddenly.
83         *                                                                       - Detected corruption of a file.
84         */
85         result FillWith(IDbEnumerator* pDbEnum);
86
87 private:
88         /**
89         * This is the default constructor for this class.
90         *
91         * @since 2.1
92         */
93         _DataControlResultSetImpl(void);
94
95         /**
96         * This is the default copy constructor for this class.
97         *
98         * @since 2.1
99         */
100         _DataControlResultSetImpl(const _DataControlResultSetImpl& rhs);
101
102         /**
103         * This is the assignment operator for this class.
104         *
105         * @since 2.1
106         */
107         _DataControlResultSetImpl& operator =(const _DataControlResultSetImpl& rhs);
108
109         /**
110         * Sets the range of a set of data to be added.
111         *
112         * @since 2.1
113         * @return       An error code
114         * @param[in]    pageNo              The page number of the data set. @n
115         *                                   It starts from @c 1.
116         * @param[in]    countPerPage        The desired maximum count of the data item on the page.
117         * @exception    E_SUCCESS                       The method was successful.
118         * @exception    E_INVALID_STATE     This instance has not been properly constructed yet.
119         * @exception    E_INVALID_ARG       Either of the following conditions has occurred: @n
120         *                                   - The specified @c pageNo parameter is less than @c 1.
121         *                                   - The specified @c countPerPage parameter is less than @c 1.
122         */
123         result SetCapacity(int pageNo = 1, int countPerPage = 20);
124
125         bool __constructed;
126         int __pageNo;
127         int __countPerPage;
128         result __result;
129         Tizen::Base::String __tmpPath;
130         RequestId __reqId;
131
132         friend class Tizen::App::_AppImpl;
133
134 }; // _DataControlResultSetImpl
135
136 }} // Tizen::Io
137
138 #endif // _FIO_INTERNAL_DATACONTROL_RESULTSET_IMPL_H_
139