sync with tizen_2.0
[platform/framework/native/appfw.git] / src / app / FAppMapDataControl.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        FAppMapDataControl.cpp
20  * @brief       This is the implementation for the %MapDataControl class.
21  */
22
23 #include <FAppMapDataControl.h>
24
25 #include <FBaseSysLog.h>
26 #include <FBase_NativeError.h>
27
28 #include "FApp_MapDataControlImpl.h"
29
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Collection;
32 using namespace Tizen::App;
33
34 namespace Tizen { namespace App {
35
36 MapDataControl::MapDataControl(void)
37         : __pMapDataControlImpl(null)
38 {
39         __pMapDataControlImpl = new _MapDataControlImpl;
40 }
41
42 MapDataControl::~MapDataControl(void)
43 {
44         delete __pMapDataControlImpl;
45 }
46
47 result
48 MapDataControl::GetValue(const String& dataId, const String& key,
49                 RequestId& reqId, int pageNo, int countPerPage)
50 {
51         SysTryReturnResult(NID_APP, __pMapDataControlImpl, E_INVALID_STATE,
52                         "This instance has not been properly constructed yet.");
53
54         return __pMapDataControlImpl->GetValue(dataId, key, reqId, pageNo, countPerPage);
55 }
56
57 result
58 MapDataControl::AddValue(const String& dataId, const String& key,
59                 const String& value, RequestId& reqId)
60 {
61         SysTryReturnResult(NID_APP, __pMapDataControlImpl, E_INVALID_STATE,
62                         "This instance has not been properly constructed yet.");
63
64         return __pMapDataControlImpl->AddValue(dataId, key, value, reqId);
65 }
66
67 result
68 MapDataControl::SetValue(const String& dataId, const String& key,
69                 const String& oldValue, const String& newValue, RequestId& reqId)
70 {
71         SysTryReturnResult(NID_APP, __pMapDataControlImpl, E_INVALID_STATE,
72                         "This instance has not been properly constructed yet.");
73
74         return __pMapDataControlImpl->SetValue(dataId, key, oldValue, newValue, reqId);
75 }
76
77 result
78 MapDataControl::RemoveValue(const String& dataId, const String& key,
79                 const String& value, RequestId& reqId)
80 {
81         SysTryReturnResult(NID_APP, __pMapDataControlImpl, E_INVALID_STATE,
82                         "This instance has not been properly constructed yet.");
83
84         return __pMapDataControlImpl->RemoveValue(dataId, key, value, reqId);
85 }
86
87 result
88 MapDataControl::SetMapDataControlResponseListener(IMapDataControlResponseListener* pListener)
89 {
90         SysTryReturnResult(NID_APP, __pMapDataControlImpl, E_INVALID_STATE,
91                         "This instance has not been properly constructed yet.");
92
93         return __pMapDataControlImpl->SetMapDataControlResponseListener(pListener);
94 }
95
96 }} // Tizen::App
97