Enable build with iniparser v 3.1
[platform/framework/native/appfw.git] / inc / FAppISqlDataControlResponseListener.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         FAppISqlDataControlResponseListener.h
19 * @brief        This is the header file for the %ISqlDataControlResponseListener interface.
20 *
21 * This header file contains the declarations of the %ISqlDataControlResponseListener interface.
22 */
23
24 #ifndef _FAPP_ISQL_DATACONTROL_RESPONSE_LISTENER_H_
25 #define _FAPP_ISQL_DATACONTROL_RESPONSE_LISTENER_H_
26
27 #include <FBaseDataType.h>
28 #include <FBaseString.h>
29 #include <FBaseRtIEventListener.h>
30 #include <FIoIDbEnumerator.h>
31
32 namespace Tizen { namespace App
33 {
34
35 /**
36 *   @interface  ISqlDataControlResponseListener
37 *   @brief              This interface defines a listener for an SQL-friendly interface based data control response.
38 *
39 *   @since      2.0
40 *
41 *   The %ISqlDataControlResponseListener interface defines a listener for an SQL-friendly interface based data control response.
42 */
43 class _OSP_EXPORT_ ISqlDataControlResponseListener
44         : virtual public Tizen::Base::Runtime::IEventListener
45 {
46
47 public:
48         /**
49          * This polymorphic destructor should be overridden if required. @n
50          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
51          *
52          * @since       2.0
53          */
54         virtual ~ISqlDataControlResponseListener(void) {}
55
56         /**
57         * Called when the result set is received from an SQL-friendly interface based data control provider. @n
58         * The application requesting the data control can get the query result by implementing this listener. @n
59         * This listener must be registered by the SqlDataControl::SetSqlDataControlResponseListener() method for receiving the result set.
60         * It is called after the SqlDataControl::Select() method.
61         *
62         * @since        2.0
63         *
64         * @param[in]    reqId                           The request ID
65         * @param[in]    providerId                      The data control provider ID
66         * @param[in]    dataId                          The string that identifies the specific table to query from @n
67         *                                                                       The string consists of one or more components, separated by a slash('/').
68         * @param[in]    resultSetEnumerator     Navigates the result of the data control select request
69         * @param[in]    providerResult          Set to @c true if the data control provider successfully processed the query request, @n
70         *                                                                       else @c false
71         * @param[in]    pErrorMsg                       The error message from the data control provider
72         */
73         virtual void OnSqlDataControlSelectResponseReceived(RequestId reqId, const Tizen::Base::String& providerId,
74                         const Tizen::Base::String& dataId, Tizen::Io::IDbEnumerator& resultSetEnumerator, bool providerResult, const Tizen::Base::String* pErrorMsg) = 0;
75
76         /**
77         * Called when the response is received from an SQL-friendly interface based data control provider. @n
78         * The application requesting the data control can get the insert result by implementing this listener. @n
79         * This listener must be registered by the SqlDataControl::SetSqlDataControlResponseListener() method for receiving the result response.
80         * It is called after the SqlDataControl::Insert() method.
81         *
82         * @since        2.0
83         *
84         * @param[in]    reqId                           The request ID
85         * @param[in]    providerId                      The data control provider ID
86         * @param[in]    dataId                          The string that identifies the specific table to insert into @n
87         *                                                                       The string consists of one or more components, separated by a slash('/').
88         * @param[in]    insertRowId                     The inserted row ID set by the data control provider if the specified @c providerResult is @c true, @n
89         *                                                                       else @c -1 if it fails
90         * @param[in]    providerResult          Set to @c true if the data control provider successfully processed the insert request, @n
91         *                                                                       else @c false
92         * @param[in]    pErrorMsg                       The error message from the data control provider
93         */
94         virtual void OnSqlDataControlInsertResponseReceived(RequestId reqId, const Tizen::Base::String& providerId,
95                         const Tizen::Base::String& dataId, long long insertRowId, bool providerResult, const Tizen::Base::String* pErrorMsg) = 0;
96
97         /**
98         * Called when the response is received from an SQL-friendly interface based data control provider. @n
99         * The application requesting the data control can get the update result implementing this listener. @n
100         * This listener must be registered by the SqlDataControl::SetSqlDataControlResponseListener() method for receiving the result response.
101         * It is called after the SqlDataControl::Update() method.
102         *
103         * @since        2.0
104         *
105         * @param[in]    reqId                           The request ID
106         * @param[in]    providerId                      The data control provider ID
107         * @param[in]    dataId                          The string that identifies the specific table to update @n
108         *                                                                       The string consists of one or more components, separated by a slash('/').
109         * @param[in]    providerResult          Set to @c true if the data control provider successfully processed the update request, @n
110         *                                                                       else @c false
111         * @param[in]    pErrorMsg                       The error message from the data control provider
112         */
113         virtual void OnSqlDataControlUpdateResponseReceived(RequestId reqId, const Tizen::Base::String& providerId,
114                         const Tizen::Base::String& dataId, bool providerResult, const Tizen::Base::String* pErrorMsg) = 0;
115
116         /**
117         * Called when the response is received from an SQL-friendly interface based data control provider. @n
118         * The application requesting the data control can get the delete result by implementing this listener. @n
119         * This listener must be registered by the SqlDataControl::SetSqlDataControlResponseListener() method for receiving the result response.
120         * It is called after the SqlDataControl::Delete() method.
121         *
122         * @since        2.0
123         *
124         * @param[in]    reqId                           The request ID
125         * @param[in]    providerId                      The data control provider ID
126         * @param[in]    dataId                          The string that identifies the specific table to delete from @n
127         *                                                                       The string consists of one or more components, separated by a slash('/').
128         * @param[in]    providerResult          Set to @c true if the data control provider successfully processed the delete request, @n
129         *                                                                       else @c false
130         * @param[in]    pErrorMsg                       The error message from the data control provider
131         */
132         virtual void OnSqlDataControlDeleteResponseReceived(RequestId reqId, const Tizen::Base::String& providerId,
133                         const Tizen::Base::String& dataId, bool providerResult, const Tizen::Base::String* pErrorMsg) = 0;
134
135 protected:
136         //
137         // This method is for internal use only.
138         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
139         //
140         // This method is reserved and may change its name at any time without prior notice.
141         //
142         // @since       2.0
143         //
144         virtual void ISqlDataControlResponseListener_Reserved1(void) {}
145
146         //
147         // This method is for internal use only.
148         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
149         //
150         // This method is reserved and may change its name at any time without prior notice.
151         //
152         // @since       2.0
153         //
154         virtual void ISqlDataControlResponseListener_Reserved2(void) {}
155
156         //
157         // This method is for internal use only.
158         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
159         //
160         // This method is reserved and may change its name at any time without prior notice.
161         //
162         // @since       2.0
163         //
164         virtual void ISqlDataControlResponseListener_Reserved3(void) {}
165
166         //
167         // This method is for internal use only.
168         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
169         //
170         // This method is reserved and may change its name at any time without prior notice.
171         //
172         // @since       2.0
173         //
174         virtual void ISqlDataControlResponseListener_Reserved4(void) {}
175
176         //
177         // This method is for internal use only.
178         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
179         //
180         // This method is reserved and may change its name at any time without prior notice.
181         //
182         // @since       2.0
183         //
184         virtual void ISqlDataControlResponseListener_Reserved5(void) {}
185
186 }; // ISqlDataControlResponseListener
187
188 }} // Tizen::App
189
190 #endif // _FAPP_ISQL_DATACONTROL_RESPONSE_LISTENER_H_
191