|
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: location triggering server client interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef LBTCLIENTREQUESTER_H |
|
21 #define LBTCLIENTREQUESTER_H |
|
22 |
|
23 #include <lbt.h> |
|
24 #include "lbtclientrequester.h" |
|
25 |
|
26 |
|
27 // Forward declaration |
|
28 class RLbt; |
|
29 /** |
|
30 * Client requestor class. |
|
31 * |
|
32 * This is a helper class used by RLbt class to serve the asyncronous operations |
|
33 * requested by the client. |
|
34 */ |
|
35 class CLbtClientRequester : public CActive |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * This is used to keep track of operation served by this object. |
|
40 */ |
|
41 enum TAsyncReqType |
|
42 { |
|
43 EListTriggerIdsCount = 1, |
|
44 EListTriggersCount = 2, |
|
45 EOpOther = 3 |
|
46 }; |
|
47 /** |
|
48 * Construct a CLbtClientRequester object. |
|
49 */ |
|
50 static CLbtClientRequester* NewL( RLbt& aLbt ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CLbtClientRequester(); |
|
56 |
|
57 /** |
|
58 * Starts the asyncronous operation by setting the iStatus to active |
|
59 */ |
|
60 void Start(); |
|
61 |
|
62 /** |
|
63 * Adds the buffer into the object. |
|
64 */ |
|
65 void SetBuffer(CBufFlat* aBuf ); |
|
66 |
|
67 /** |
|
68 * Starts the asyncronous operation by setting the iStatus to active. |
|
69 */ |
|
70 void Start(TAsyncReqType aType); |
|
71 |
|
72 /** |
|
73 * Stores the client's status. |
|
74 */ |
|
75 void SetStatus(TRequestStatus& aStatus); |
|
76 |
|
77 /** |
|
78 * Retrieves client's status |
|
79 */ |
|
80 TRequestStatus& Status(); |
|
81 |
|
82 /** |
|
83 * Stores the list trigger id data. |
|
84 */ |
|
85 void SetListTriggerIdData(RArray < TLbtTriggerId >* aTriggerIdArray); |
|
86 |
|
87 /** |
|
88 * Stores the list trigger data. |
|
89 */ |
|
90 void SetListTriggerData(RPointerArray < CLbtTriggerInfo >* aTriggerInfoList); |
|
91 |
|
92 |
|
93 /** |
|
94 * |
|
95 */ |
|
96 RPointerArray < CLbtTriggerInfo >* ListTriggerData(); |
|
97 |
|
98 /** |
|
99 * |
|
100 */ |
|
101 RArray < TLbtTriggerId >* ListTriggerIdData(); |
|
102 |
|
103 /** |
|
104 * Returns reference of list trigger size. |
|
105 */ |
|
106 TInt& ListTriggersSize(); |
|
107 |
|
108 |
|
109 private://Derived from CActive |
|
110 void RunL(); |
|
111 TInt RunError( TInt aError ); |
|
112 void DoCancel(); |
|
113 |
|
114 private: |
|
115 /** |
|
116 * C++ default constructor |
|
117 */ |
|
118 CLbtClientRequester( RLbt& aLbt); |
|
119 |
|
120 /** |
|
121 *Second phase constructor |
|
122 */ |
|
123 void ConstructL(); |
|
124 |
|
125 private:// data |
|
126 // Subsession handle |
|
127 RLbt& iLbt; |
|
128 |
|
129 // Pointer to client's status |
|
130 TRequestStatus* iClientStatus; |
|
131 |
|
132 // CBufFlat pointer array |
|
133 RPointerArray < CBufFlat > iClientBuf; |
|
134 |
|
135 // Type of asyncronous request served. |
|
136 TAsyncReqType iType; |
|
137 |
|
138 // TLbtTriggerId array. |
|
139 RArray < TLbtTriggerId >* iTriggerIdArray; |
|
140 |
|
141 // CLbtTriggerInfo pointer array. |
|
142 RPointerArray < CLbtTriggerInfo >* iTriggerInfoList; |
|
143 |
|
144 TInt iListTriggersSize; |
|
145 }; |
|
146 |
|
147 #endif // LBTTRIGGERCHANGEEVENTNOTIFIER_H |
|
148 |