|
1 /* |
|
2 * Copyright (c) 2007-2009 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 |
|
18 |
|
19 |
|
20 #ifndef HWRMFMTXTESTOBSERVER_H |
|
21 #define HWRMFMTXTESTOBSERVER_H |
|
22 |
|
23 #include <e32property.h> |
|
24 #include "hwrmfmtxwatcherplugin.h" |
|
25 #include "hwrmfmtxconnobserver.h" |
|
26 |
|
27 /** |
|
28 * Active object for obtaining notification of changes in connections. |
|
29 * |
|
30 */ |
|
31 NONSHARABLE_CLASS(CHWRMFmtxTestObserver) : public CActive, |
|
32 public MHWRMFmtxConnObserver |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * This is a two-phase constructor method that is used to create a new |
|
37 * instance for listening to the changes. |
|
38 * |
|
39 * @param aObserver A reference to an observer instance. |
|
40 * @return A pointer to a new instance of the CHWRMFmtxUsbObserver class. |
|
41 * |
|
42 * @leave One of the Symbian OS error codes. |
|
43 */ |
|
44 static CHWRMFmtxTestObserver* NewL( MHWRMFmtxConnObserverCallback& aObserver ); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CHWRMFmtxTestObserver(); |
|
50 |
|
51 // From MHWRMFmtxConnObserver |
|
52 TBool GetStatusL(); |
|
53 void StartObservingL(); |
|
54 void StopObserving(); |
|
55 |
|
56 private: |
|
57 |
|
58 /** |
|
59 * Constructor. |
|
60 * |
|
61 * @param aObserver A reference to an observer instance. |
|
62 */ |
|
63 CHWRMFmtxTestObserver( MHWRMFmtxConnObserverCallback& aObserver ); |
|
64 |
|
65 /** |
|
66 * By default Symbian OS constructor is private. |
|
67 */ |
|
68 void ConstructL(); |
|
69 |
|
70 /** |
|
71 * Orders notification. |
|
72 */ |
|
73 void OrderNotification(); |
|
74 |
|
75 protected: |
|
76 |
|
77 // from CActive |
|
78 void RunL(); |
|
79 void DoCancel(); |
|
80 |
|
81 private: |
|
82 |
|
83 /** |
|
84 * Handle to test PubSub key. |
|
85 */ |
|
86 RProperty iTestPubSubKey; |
|
87 |
|
88 /** |
|
89 * Response callback pointer. |
|
90 */ |
|
91 MHWRMFmtxConnObserverCallback& iCallback; |
|
92 |
|
93 /** |
|
94 * Stores USB connection status, ETrue if connected. |
|
95 * Used for filtering out excess USB configuration change notifications. |
|
96 */ |
|
97 TBool iConnected; |
|
98 }; |
|
99 |
|
100 |
|
101 #endif // HWRMFMTXTESTOBSERVER_H |
|
102 |
|
103 // End of File |