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