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