|
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: Property handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSENSRVPROPERTYHANDLER_H |
|
20 #define CSENSRVPROPERTYHANDLER_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "sensrvclient.h" |
|
25 #include "sensrvchannelinfo.h" |
|
26 |
|
27 class MSensrvPropertyHandlerObserver; |
|
28 |
|
29 /** |
|
30 * Property handler class |
|
31 * |
|
32 * @lib SensorClient.lib |
|
33 * @since S60 5.0 |
|
34 */ |
|
35 NONSHARABLE_CLASS( CSensrvPropertyHandler ) : public CActive |
|
36 { |
|
37 public: |
|
38 |
|
39 static CSensrvPropertyHandler* NewL( RSensrvClient& aSensrvClient, const TSensrvChannelInfo& aChannelInfo ); |
|
40 |
|
41 static CSensrvPropertyHandler* NewLC( RSensrvClient& aSensrvClient, const TSensrvChannelInfo& aChannelInfo ); |
|
42 |
|
43 /** |
|
44 * Destructor |
|
45 */ |
|
46 virtual ~CSensrvPropertyHandler(); |
|
47 |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Start property listening. Send request to server. |
|
52 * |
|
53 * @since S60 5.0 |
|
54 * @param aPropertyListener Property listener for channel. |
|
55 */ |
|
56 void StartListening( MSensrvPropertyHandlerObserver* aPropertyObserver ); |
|
57 |
|
58 protected: // From CActive |
|
59 |
|
60 void DoCancel(); |
|
61 void RunL(); |
|
62 TInt RunError(TInt aError); |
|
63 |
|
64 private: |
|
65 |
|
66 /** |
|
67 * Constructor |
|
68 */ |
|
69 CSensrvPropertyHandler( RSensrvClient& aSensrvClient, const TSensrvChannelInfo& aChannelInfo ); |
|
70 |
|
71 /** |
|
72 * Create and send request to server |
|
73 */ |
|
74 void CreateAndSendRequest(); |
|
75 |
|
76 |
|
77 private: // data |
|
78 |
|
79 /** |
|
80 * Client |
|
81 */ |
|
82 RSensrvClient& iSensrvClient; |
|
83 |
|
84 /** |
|
85 * The channel information |
|
86 */ |
|
87 TSensrvChannelInfo iChannelInfo; |
|
88 |
|
89 /** |
|
90 * Property listener |
|
91 * Not own. |
|
92 */ |
|
93 MSensrvPropertyHandlerObserver* iPropertyObserver; |
|
94 |
|
95 /** |
|
96 * Server writes changed property data here. |
|
97 */ |
|
98 TPropertyPckgBuf iPropertyPckgBuf; |
|
99 |
|
100 /** |
|
101 * Error count |
|
102 */ |
|
103 TInt iErrorCount; |
|
104 }; |
|
105 |
|
106 #endif // CSENSRVPROPERTYHANDLER_H |