|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Representing filter based on the geographical area |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef LBTTRIGGERFILTERBYAREA_H |
|
20 #define LBTTRIGGERFILTERBYAREA_H |
|
21 |
|
22 #include <lbttriggerfilterbase.h> |
|
23 |
|
24 class CLbtGeoAreaBase; |
|
25 |
|
26 /** |
|
27 * Class representing filter based on the geographical area. |
|
28 * |
|
29 * This class defines the geographical area filter used in retrieving triggers |
|
30 * from Location Triggering Server. When this filter is used, only triggers that |
|
31 * are inside the defined area will be retrieved. The area can be a geographical |
|
32 * circle or rectangle. |
|
33 * |
|
34 * If the area is not set and the filter is used in listing triggers, no trigger |
|
35 * will be returned. |
|
36 * |
|
37 * If the center of the geographical circular area is not specified(NaN), |
|
38 * latest acquired location of the Location Triggering Server is |
|
39 * used as the center. If the radius of the geographical circular area is zero, |
|
40 * no triggers will be retrieved. |
|
41 * |
|
42 * @lib lbt.lib |
|
43 * @since S60 5.1 |
|
44 */ |
|
45 class CLbtTriggerFilterByArea : public CLbtTriggerFilterBase |
|
46 { |
|
47 public: |
|
48 /** |
|
49 * Returns CLbtTriggerFilterBase::EFilterByArea. |
|
50 * |
|
51 * @return CLbtTriggerFilterBase::EFilterByArea. |
|
52 */ |
|
53 IMPORT_C virtual TFilterType Type() const; |
|
54 |
|
55 /** |
|
56 * Constructs a new instance of CLbtTriggerFilterByArea. |
|
57 * |
|
58 * @param[in] aArea Pointer to the geographical area object. |
|
59 * Ownership of aArea is transferred to this object. |
|
60 * If the center of the geographical circular area is omitted, |
|
61 * latest acquired location is used when retrieving triggers. |
|
62 * @return New instance of CLbtTriggerFilterByArea. |
|
63 */ |
|
64 IMPORT_C static CLbtTriggerFilterByArea* NewL( |
|
65 CLbtGeoAreaBase* aArea ); |
|
66 |
|
67 /** |
|
68 * Constructs a new instance of CLbtTriggerFilterByArea. |
|
69 * The returned object has no geographical area set. |
|
70 * |
|
71 * @return New instance of CLbtTriggerFilterByArea. |
|
72 */ |
|
73 IMPORT_C static CLbtTriggerFilterByArea* NewL(); |
|
74 |
|
75 /** |
|
76 * Constructs a new instance of CLbtTriggerFilterByArea |
|
77 * and pushes it onto cleanup stack. |
|
78 * The returned object has no geographical area set. |
|
79 * |
|
80 * @return New instance of CLbtTriggerFilterByArea. |
|
81 */ |
|
82 IMPORT_C static CLbtTriggerFilterByArea* NewLC(); |
|
83 |
|
84 /** |
|
85 * Destructor. |
|
86 */ |
|
87 IMPORT_C virtual ~CLbtTriggerFilterByArea(); |
|
88 |
|
89 /** |
|
90 * Gets the geographical area, inside which the triggers are |
|
91 * retrieved. |
|
92 * |
|
93 * If the area has not been set, this function returns NULL. |
|
94 * |
|
95 * @return The pointer to the geographical area object. Ownership is not |
|
96 * transferred to the client. |
|
97 */ |
|
98 IMPORT_C CLbtGeoAreaBase* Area(); |
|
99 |
|
100 /** |
|
101 * Sets the geographical area in the filter. Only triggers that have |
|
102 * triggering area inside the defined area are retrieved. |
|
103 * |
|
104 * @param[in] aArea The pointer to the geographical area object. |
|
105 * Ownership of aArea is transferred to this object. |
|
106 * If the area is a geographical circular area and the center of the |
|
107 * area is not set, latest acquired location is used by Location |
|
108 * Triggering Server when retrieving triggers. |
|
109 */ |
|
110 IMPORT_C void SetArea( CLbtGeoAreaBase* aArea ); |
|
111 |
|
112 protected: |
|
113 /** |
|
114 * Externalize method that subclass must implement. |
|
115 * @param[in] aStream Stream to which the object should be externalized. |
|
116 */ |
|
117 virtual void DoExternalizeL(RWriteStream& aStream) const ; |
|
118 |
|
119 /** |
|
120 * Internalize method that subclass must implement. |
|
121 * @param[in] aStream Stream from which the object should be internalized. |
|
122 */ |
|
123 virtual void DoInternalizeL(RReadStream& aStream) ; |
|
124 |
|
125 |
|
126 private: |
|
127 /** |
|
128 * Default constructor. |
|
129 */ |
|
130 void ConstructL(CLbtGeoAreaBase* aArea); |
|
131 |
|
132 /** |
|
133 * By default, prohibit copy constructor |
|
134 */ |
|
135 CLbtTriggerFilterByArea( const CLbtTriggerFilterByArea& ); |
|
136 |
|
137 /** |
|
138 * Prohibit assigment operator |
|
139 */ |
|
140 CLbtTriggerFilterByArea& operator= ( const CLbtTriggerFilterByArea& ); |
|
141 |
|
142 /** |
|
143 * Constructor. |
|
144 */ |
|
145 CLbtTriggerFilterByArea(); |
|
146 |
|
147 private: |
|
148 /** |
|
149 * The geographical area that the trigger lies in |
|
150 */ |
|
151 CLbtGeoAreaBase* iGeoArea; |
|
152 |
|
153 }; |
|
154 |
|
155 |
|
156 #endif // LBTTRIGGERFILTERBYAREA_H |