|
1 /* |
|
2 * Copyright (c) 2006-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 HWRMFMTXIMPL_H |
|
21 #define HWRMFMTXIMPL_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <hwrm/hwrmfmtx.h> |
|
25 #include "HWRMClient.h" |
|
26 #include "hwrmuipluginservice.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CHWRMFmTxStatusObserver; |
|
30 class CHWRMFmTxFrequencyObserver; |
|
31 class CHwrmUiPluginHandler; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Class for the FM Tx client-side session. |
|
37 * |
|
38 */ |
|
39 NONSHARABLE_CLASS(CHWRMFmTxImpl) : public CHWRMFmTx, |
|
40 public MHwrmForegroundObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 // Implementations are always constructed by CHWRMFmTx::NewL or NewLC. |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 virtual ~CHWRMFmTxImpl(); |
|
50 |
|
51 public: // New functions |
|
52 |
|
53 public: // Functions from base classes |
|
54 |
|
55 // From CHWRMFmTx |
|
56 |
|
57 void ReserveL(TBool aForceNoCCoeEnv); |
|
58 void Release(); |
|
59 |
|
60 TFmTxState Status() const; |
|
61 |
|
62 void EnableL(TInt aFrequency=0); |
|
63 void DisableL(); |
|
64 |
|
65 TInt Frequency() const; |
|
66 void GetFrequencyRangeL(TFmTxFrequencyRange& aFrequencyRange) const; |
|
67 void SetFrequencyL(TInt aFrequency); |
|
68 |
|
69 void GetNextClearFrequencyL(TInt& aClearFrequency); |
|
70 void GetNextClearFrequencyL(TClearFrequencyArray& aClearFrequencyArray, TUint& aCount); |
|
71 void GetNextClearFrequency(TRequestStatus& aStatus, TInt& aClearFrequency); |
|
72 void GetNextClearFrequencyL(TRequestStatus& aStatus, TClearFrequencyArray& aClearFrequencyArray, TUint& aCount); |
|
73 void CancelGetNextClearFrequency(); |
|
74 |
|
75 void SetNextClearFrequencyL(TInt& aClearFrequency); |
|
76 void SetNextClearFrequency(TRequestStatus& aStatus, TInt& aClearFrequency); |
|
77 void CancelSetNextClearFrequency(); |
|
78 |
|
79 TBool IsAutoFrequencyEnabled(); |
|
80 void EnableAutoFrequencyL(); |
|
81 void DisableAutoFrequencyL(); |
|
82 |
|
83 void GetRdsData(TFmTxRdsData& aData); |
|
84 void SetRdsPtyL(TRdsProgrammeType aPty); |
|
85 void SetRdsPtynL(TRdsProgrammeTypeName& aPtyn); |
|
86 void SetRdsMsL(TBool aMusic); |
|
87 void SetRdsLanguageIdL(TRdsLanguageIdType aLanguageId); |
|
88 |
|
89 void SetRadiotextL(TDes& aText); |
|
90 void SetRadiotextPlusL(TDes& aText, TRtPlusContentType aContentType); |
|
91 void SetRadiotextPlusL(TDes& aText, TRtPlusTag aTag); |
|
92 void SetRadiotextPlusL(TDes& aText, TRtPlusTag aTag1, TRtPlusTag aTag2); |
|
93 |
|
94 void ClearRdsData(); |
|
95 void ClearRadiotextData(); |
|
96 |
|
97 // From MHWRMForegroundObserver |
|
98 void HandleGainingForeground(); |
|
99 void HandleLosingForeground(); |
|
100 |
|
101 private: |
|
102 |
|
103 /** |
|
104 * C++ default constructor. |
|
105 */ |
|
106 CHWRMFmTxImpl(); |
|
107 |
|
108 /** |
|
109 * By default Symbian 2nd phase constructor is private. |
|
110 */ |
|
111 void ConstructL(MHWRMFmTxObserver* aCallback); |
|
112 |
|
113 /** |
|
114 * Closes the session. |
|
115 */ |
|
116 void Close(); |
|
117 |
|
118 /** |
|
119 * Range check on aFrequency parameter |
|
120 */ |
|
121 TBool FrequencyRangeCheck(TInt aFrequency); |
|
122 |
|
123 /** |
|
124 * Do actual reservation. For parameters, see ReserveL |
|
125 */ |
|
126 void DoReserveL(TBool aForceNoCCoeEnv); |
|
127 |
|
128 /** |
|
129 * Do actual release |
|
130 */ |
|
131 TInt DoRelease(); |
|
132 |
|
133 /** |
|
134 * Round up the frequency to the nearest valid frequency |
|
135 * based on the frequency range and the step size |
|
136 */ |
|
137 TInt RoundFreqToNearestStep(TInt aFrequency); |
|
138 |
|
139 public: // Data |
|
140 |
|
141 protected: // Data |
|
142 |
|
143 private: // Data |
|
144 |
|
145 RHWRMClient iClient; // HWRM server client |
|
146 MHWRMFmTxObserver* iCallback; // Client listening events. Not owned |
|
147 CHWRMFmTxStatusObserver* iStatusObserver; // FM Tx status observer pointer. Owned. |
|
148 CHWRMFmTxFrequencyObserver* iFrequencyObserver; // FM Tx frequency observer pointer. Owned. |
|
149 CHwrmUiPluginHandler* iUiPluginHandler; |
|
150 |
|
151 TPtr8 iClearFrequencyPckg; |
|
152 TPtr8 iClearFrequencyCountPckg; |
|
153 |
|
154 public: // Friend classes |
|
155 |
|
156 friend class CHWRMFmTx; |
|
157 }; |
|
158 |
|
159 #endif // HWRMFMTXIMPL_H |
|
160 |
|
161 // End of File |