2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef TIZENAPIS_TIZEN_DATACONTROL_CALLBACK_H_
20 #define TIZENAPIS_TIZEN_DATACONTROL_CALLBACK_H_
26 #include <appsvc/appsvc.h>
29 namespace DataControl {
31 // utils for common usage
32 std::vector<std::string> getDataArrayFromBundle(bundle *b, std::string key);
33 std::string getProviderApplicationId(const std::string type, const std::string& provId);
34 std::string getCurrentApplicationId();
35 std::string getProviderPkgId(const std::string& appId);
36 void SendAppControlLaunchToProvider(void* event, unsigned short& currentJob);
37 void handleRemainingPendingEvent();
38 std::string convertIntToString(unsigned int data);
39 void addArrayToBundle(bundle* passData, std::vector<std::string>& array);
40 std::string generateFileName(unsigned int reqId, const std::string currentAppId);
42 void dataControlCommonCallback(bundle* b, int request_code, appsvc_result_val res, void* data);
44 // callbacks for sqldatacontrol
45 void sqldataControlSelectCallback(bundle* b, int request_code, appsvc_result_val res, void* data);
46 void sqldataControlInsertCallback(bundle* b, int request_code, appsvc_result_val res, void* data);
47 void sqldataControlDeleteCallback(bundle* b, int request_code, appsvc_result_val res, void* data);
48 void sqldataControlUpdateCallback(bundle* b, int request_code, appsvc_result_val res, void* data);
49 // callbacks for mapped datacontrol
50 void MappedDataControlGetValueCallback(bundle* b, int request_code, appsvc_result_val res, void* data);
51 void MappedDataControlAddValueCallback(bundle* b, int request_code, appsvc_result_val res, void* data);
52 void MappedDataControlRemoveValueCallback(bundle* b, int request_code, appsvc_result_val res, void* data);
53 void MappedDataControlUpdateValueCallback(bundle* b, int request_code, appsvc_result_val res, void* data);