Update privilege string, PackageAppInfo for wgt
[platform/framework/native/appfw.git] / src / app / FAppSqlDataControl.cpp
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        FAppSqlDataControl.cpp
20  * @brief       This is the implementation for the %SqlDataControl class.
21  */
22
23 #include <FAppSqlDataControl.h>
24
25 #include <FBaseSysLog.h>
26 #include <FBase_NativeError.h>
27
28 #include "FApp_SqlDataControlImpl.h"
29
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
32
33 namespace Tizen { namespace App
34 {
35
36 SqlDataControl::SqlDataControl(void)
37         : __pSqlDataControlImpl(null)
38 {
39         __pSqlDataControlImpl = new _SqlDataControlImpl;
40 }
41
42 SqlDataControl::~SqlDataControl(void)
43 {
44         delete __pSqlDataControlImpl;
45 }
46
47 result
48 SqlDataControl::Select(const String& dataId, const IList* pColumnList, const String* pWhere,
49                 const String *pOrder, RequestId& reqId, int pageNo, int countPerPage)
50 {
51         SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
52                         "This instance has not been properly constructed.");
53
54         return __pSqlDataControlImpl->Select(dataId, pColumnList, pWhere, pOrder, reqId, pageNo, countPerPage);
55 }
56
57 result
58 SqlDataControl::Insert(const Tizen::Base::String& dataId, const Tizen::Base::Collection::IMap& insertMap,
59                 RequestId& reqId)
60 {
61         SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
62                         "This instance has not been properly constructed.");
63
64         return __pSqlDataControlImpl->Insert(dataId, insertMap, reqId);
65 }
66
67 result
68 SqlDataControl::Update(const Tizen::Base::String& dataId, const Tizen::Base::Collection::IMap& updateMap,
69                         const Tizen::Base::String* pWhere, RequestId& reqId)
70 {
71         SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE, "This instance has not been properly constructed.");
72
73         return __pSqlDataControlImpl->Update(dataId, updateMap, pWhere, reqId);
74 }
75
76 result
77 SqlDataControl::Delete(const Tizen::Base::String& dataId, const Tizen::Base::String* pWhere, RequestId& reqId)
78 {
79         SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
80                         "This instance has not been properly constructed.");
81
82         return __pSqlDataControlImpl->Delete(dataId, pWhere, reqId);
83 }
84
85 result
86 SqlDataControl::SetSqlDataControlResponseListener(ISqlDataControlResponseListener* pListener)
87 {
88         SysTryReturnResult(NID_APP, __pSqlDataControlImpl, E_INVALID_STATE,
89                                          "This instance has not been properly constructed yet.");
90
91         return __pSqlDataControlImpl->SetSqlDataControlResponseListener(pListener);
92 }
93
94 }} // Tizen::App
95