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