Merge "Fix for the issue N_SE-29643." into tizen_2.1
[platform/framework/native/locations.git] / src / FLoc_LocProviderEventArg.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        FLoc_LocProviderEventArg.h
20  * @brief       This is the header file for the %_LocProviderEventArg class.
21  *
22  * This header file contains the declarations of the %_LocProviderEventArg class member variables.
23  */
24
25 #ifndef _FLOC_INTERNAL_LOC_PROVIDER_EVENT_ARG_H_
26 #define _FLOC_INTERNAL_LOC_PROVIDER_EVENT_ARG_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseRtIEventArg.h>
30 #include <FLocTypes.h>
31
32 namespace Tizen { namespace Locations
33 {
34
35 class Location;
36
37 enum _LocProviderEventType
38 {
39         _LOC_PRV_EVENT_SEND_LOC,
40         _LOC_PRV_EVENT_SEND_LOC_SVC_CB,
41         _LOC_PRV_EVENT_SEND_MONITOR_SVC_CB,
42 };
43
44 class _LocProviderEventArg
45         : public Tizen::Base::Object
46         , public Tizen::Base::Runtime::IEventArg
47 {
48 public:
49         _LocProviderEventArg(void)
50                 : Tizen::Base::Object()
51                 , __pLocation(null)
52         {
53         }
54
55         virtual ~_LocProviderEventArg(void)
56         {
57                 delete __pLocation;
58         }
59
60         void SetLocation(Location* pLocation)
61         {
62                 if (__pLocation)
63                 {
64                         delete __pLocation;
65                 }
66                 __pLocation = pLocation;
67         }
68
69         Location* GetLocationN(void)
70         {
71                 Location* pLocation = __pLocation;
72                 __pLocation = null;
73                 return pLocation;
74         }
75
76         void SetLocServiceStatus(LocationServiceStatus locSvcStatus)
77         {
78                 __locSvcStatus = locSvcStatus;
79         }
80
81         LocationServiceStatus GetLocServiceStatus(void)
82         {
83                 return __locSvcStatus;
84         }
85
86         void SetEventType(_LocProviderEventType eventType)
87         {
88                 __locProvEventType = eventType;
89         }
90
91         _LocProviderEventType GetEventType(void)
92         {
93                 return __locProvEventType;
94         }
95
96         void SetRequestId(RequestId reqId)
97         {
98                 __reqId = reqId;
99         }
100
101         RequestId GetRequestId(void)
102         {
103                 return __reqId;
104         }
105
106 private:
107         _LocProviderEventArg(const _LocProviderEventArg& rhs);
108
109         _LocProviderEventArg& operator =(const _LocProviderEventArg& rhs);
110
111 private:
112         LocationServiceStatus __locSvcStatus;
113         _LocProviderEventType __locProvEventType;
114         Location* __pLocation;
115         RequestId __reqId;
116 }; // class _LocProviderEventArg
117 }}
118
119 #endif //_FLOC_INTERNAL_LOC_PROVIDER_EVENT_ARG_H_