tizen 2.4 release
[framework/location/maps-plugin-here.git] / src / here / here_base.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
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 #include "here_base.h"
18 #include "here_manager.h"
19
20
21 HERE_PLUGIN_BEGIN_NAMESPACE
22
23 HereBase::HereBase()
24 {
25         m_nRestReqId = 0;
26         m_bCanceled = 0;
27         m_nReqId = 0;
28 }
29
30 HereBase::~HereBase()
31 {
32         if (HereManager::GetHandler())
33                 HereManager::GetHandler()->CloseInstance(m_nReqId);
34 }
35
36 void HereBase::TerminateService(void)
37 {
38         if(m_nRestReqId)
39         {
40                 m_bCanceled = 1;
41                 return;
42         }
43         delete this;
44 }
45
46 gint HereBase::GetReqId(void)
47 {
48         return m_nReqId;
49 }
50
51 gint HereBase::GetRestReqId(void)
52 {
53         return m_nRestReqId;
54 }
55
56 HERE_PLUGIN_END_NAMESPACE