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