|
1 /* |
|
2 * Copyright (c) 2008 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: |
|
15 * |
|
16 */ |
|
17 #ifndef TSORIENTATIONMONITOR_H |
|
18 #define TSORIENTATIONMONITOR_H |
|
19 #include <e32base.h> |
|
20 #include <sensrvdatalistener.h> |
|
21 #include "tsorientationobserver.h" |
|
22 |
|
23 class CRepository; |
|
24 |
|
25 class CTsOrientationMonitor: public CActive, |
|
26 public MSensrvDataListener |
|
27 { |
|
28 public: |
|
29 static CTsOrientationMonitor* NewL( MTsOrientationObserver& aObserver ); |
|
30 ~CTsOrientationMonitor(); |
|
31 |
|
32 private: |
|
33 CTsOrientationMonitor( MTsOrientationObserver& aObserver ); |
|
34 void ConstructL(); |
|
35 void SubscribeL(); |
|
36 void StartSensorMonitoringL(); |
|
37 void StopSensorMonitoring(); |
|
38 |
|
39 private://from CActive |
|
40 void DoCancel(); |
|
41 void RunL(); |
|
42 TInt RunError(TInt aError); |
|
43 |
|
44 public: |
|
45 void DataReceived( CSensrvChannel& aChannel, |
|
46 TInt aCount, |
|
47 TInt aDataLost ); |
|
48 |
|
49 void DataError( CSensrvChannel& aChannel, |
|
50 TSensrvErrorSeverity aError ); |
|
51 |
|
52 void GetDataListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface ); |
|
53 |
|
54 private: |
|
55 MTsOrientationObserver& iObserver; |
|
56 CRepository* iRepository; |
|
57 CSensrvChannel* iChannel; |
|
58 |
|
59 }; |
|
60 #endif //TSORIENTATIONMONITOR_H |