|
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 HWRMFMTXWATCHERPLUGIN_H_ |
|
21 #define HWRMFMTXWATCHERPLUGIN_H_ |
|
22 |
|
23 #include <hwrmpluginservice.h> |
|
24 #include <babitflags.h> |
|
25 #include "hwrmfmtxconnobserver.h" |
|
26 #include "hwrmfmtxplugintimer.h" |
|
27 |
|
28 /** |
|
29 * FM Tx watcher plugin implementation. |
|
30 */ |
|
31 class CHWRMFmtxWatcherPlugin : public CHWRMPluginService, |
|
32 public MHWRMFmtxPluginTimerCallback, |
|
33 public MHWRMFmtxConnObserver, |
|
34 public MHWRMFmtxConnObserverCallback |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * This is a two-phase constructor method that is used to create a new |
|
40 * instance of fmtx watcher plugin. |
|
41 * |
|
42 * @leave One of the Symbian OS error codes. |
|
43 */ |
|
44 static CHWRMFmtxWatcherPlugin* NewL(); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CHWRMFmtxWatcherPlugin(); |
|
50 |
|
51 private: |
|
52 // from CHWRMPluginService |
|
53 /** |
|
54 * Method to invoke a particular command in the plugin |
|
55 * @param aCommandId Command ID |
|
56 * @param aTransId Transaction ID |
|
57 * @param aData Data associated with command |
|
58 */ |
|
59 virtual void ProcessCommandL(const TInt aCommandId, |
|
60 const TUint8 aTransId, |
|
61 TDesC8& aData); |
|
62 |
|
63 /** |
|
64 * Method to cancel a particular command |
|
65 * @param aTransId Transaction ID |
|
66 * @param aCommandId Command ID to optionally double check with the |
|
67 * transaction ID |
|
68 */ |
|
69 virtual void CancelCommandL(const TUint8 aTransId, |
|
70 const TInt aCommandId); |
|
71 |
|
72 private: |
|
73 |
|
74 // From MPluginTimerCallback |
|
75 void GenericTimerFired(const TInt aCommandId, |
|
76 const TUint8 aTransId, |
|
77 TInt aRetVal); |
|
78 |
|
79 // From MHWRMFmtxConnObserver |
|
80 TBool GetStatusL(); |
|
81 void StartObservingL(); |
|
82 void StopObserving(); |
|
83 |
|
84 // From MHWRMFmtxConnObserverCallback |
|
85 void HandleConnectionChange( TFmtxWatcherObserverTypes aType, TBool aConnected ); |
|
86 |
|
87 private: |
|
88 |
|
89 /** |
|
90 * C++ default constructor. |
|
91 * |
|
92 */ |
|
93 CHWRMFmtxWatcherPlugin(); |
|
94 |
|
95 /** |
|
96 * By default Symbian OS constructor is private. |
|
97 */ |
|
98 void ConstructL(); |
|
99 |
|
100 private: |
|
101 |
|
102 /** |
|
103 * Connection observers. |
|
104 */ |
|
105 RPointerArray<MHWRMFmtxConnObserver> iObservers; |
|
106 |
|
107 /** |
|
108 * Timer array for command responses. |
|
109 */ |
|
110 RPointerArray<CHWRMFmtxPluginTimer> iTimers; |
|
111 |
|
112 /** |
|
113 * Connection status. |
|
114 */ |
|
115 TBitFlags iConnected; |
|
116 }; |
|
117 |
|
118 #endif // HWRMFMTXWATCHERPLUGIN_H_ |