|
1 /* |
|
2 * Copyright (c) 2005 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: Defines APIs to communicate with Central Repository |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef FMRADIOENGINECENTRALREPOSITORYHANDLER_H |
|
20 #define FMRADIOENGINECENTRALREPOSITORYHANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "fmradioregion.h" |
|
24 |
|
25 // CONSTANTS |
|
26 const TInt KBufferLength = 20; |
|
27 const TInt KStreamBufferSize = 100; |
|
28 |
|
29 // Forward declare implementation class |
|
30 class TRadioSettings; |
|
31 class CRepository; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * it is a wrapper of Central Repository, responsible for the operations that need to access |
|
37 * the central respositorhy. |
|
38 * |
|
39 * @lib FMRadioEngine.lib |
|
40 * @since Series 60 3.0_version |
|
41 */ |
|
42 class CCentralRepositoryHandler : public CBase |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * Two-phased class constructor. |
|
47 * @param aRadioSettings pointer to the CRadioSettings class |
|
48 */ |
|
49 static CCentralRepositoryHandler* NewL(TRadioSettings& aRadioSettings); |
|
50 /** |
|
51 * Destructor of CCentralRepositoryHandler class. |
|
52 */ |
|
53 virtual ~CCentralRepositoryHandler(); |
|
54 public: |
|
55 /** |
|
56 * Save all engine related persistent info back to Central Repository |
|
57 * @since Series 60 3.0 |
|
58 * @return none |
|
59 */ |
|
60 void SaveEngineSettings(); |
|
61 |
|
62 TInt CountRegions() const; |
|
63 CFMRadioRegion& Region( TInt aIndex ) const; |
|
64 TInt RegionId() const; |
|
65 TUint32 FrequencyStepSize() const; |
|
66 TUint32 MaxFrequency() const; |
|
67 TUint32 MinFrequency() const; |
|
68 TInt DecimalCount() const; |
|
69 |
|
70 void SetRegionIdL( TInt aRegion ); |
|
71 |
|
72 /** |
|
73 * Determines if RT+ interaction tutorial dialog has been shown. |
|
74 * See CFMRadioEngine::MusicStoreNoteDisplayed(). |
|
75 */ |
|
76 TBool MusicStoreNoteDisplayed(); |
|
77 /** |
|
78 * Sets RT+ interaction tutorial dialog as displayed. |
|
79 * See CFMRadioEngine::SetMusicStoreNoteDisplayed(). |
|
80 */ |
|
81 void SetMusicStoreNoteDisplayed(); |
|
82 /** |
|
83 * Gets supported RT+ interactions. See CFMradioEngine::GetRTPlusSupportLevel(). |
|
84 */ |
|
85 TInt GetRTPlusSupportLevel(); |
|
86 |
|
87 /** |
|
88 * Checks if offine profile is current active profile |
|
89 * @return true/false |
|
90 */ |
|
91 TBool IsOfflineProfileActiveL(); |
|
92 /** |
|
93 * Increases startup time by one and returns amount of program startups. |
|
94 * Also updates count to the repository. |
|
95 */ |
|
96 void IncreaseStartupCount() const; |
|
97 /* |
|
98 * Save headset volume level to the repository |
|
99 */ |
|
100 void SaveHeadsetVolumeSetting() const; |
|
101 /* |
|
102 * Save speaker volume level to the repository |
|
103 */ |
|
104 void SaveSpeakerVolumeSetting() const; |
|
105 |
|
106 private: |
|
107 /** |
|
108 * Default class constructor. |
|
109 * @param aRadioSettings - pointer to the CRadioSettings class |
|
110 */ |
|
111 CCentralRepositoryHandler(TRadioSettings& aRadioSettings); |
|
112 /** |
|
113 * Second phase class constructor. |
|
114 */ |
|
115 void ConstructL(); |
|
116 /** |
|
117 * Retrieves persistent settings from Central Repository. |
|
118 */ |
|
119 void RetrieveInitialSettings(); |
|
120 /** |
|
121 * Initializes the regions as defined in the resource file. |
|
122 */ |
|
123 void InitializeRegionsL(); |
|
124 |
|
125 /** |
|
126 * Converts Region ID to index |
|
127 * |
|
128 * @param aRegionId The region ID that is wanted to convert |
|
129 * @return The region index, KErrNotFound if no match found |
|
130 */ |
|
131 TInt RegionIndexForId( TInt aRegionId ) const; |
|
132 |
|
133 /** |
|
134 * Updates the current region index |
|
135 * |
|
136 * @param aRegionId The new region ID |
|
137 */ |
|
138 void UpdateCurrentRegionIdx( TInt aRegionId ); |
|
139 /* |
|
140 * Set emulator networkinfo |
|
141 * |
|
142 */ |
|
143 #ifdef __WINS__ |
|
144 void SetInitialSettings(); |
|
145 #endif //__WINS__ |
|
146 /** |
|
147 * Checks if frequency is in the current region range |
|
148 * |
|
149 * @param aFrequency Frequency to check |
|
150 */ |
|
151 TBool IsFrequencyValid( TUint32 aFrequency ) const; |
|
152 |
|
153 private: // data |
|
154 |
|
155 // Handle to Central Repository server |
|
156 CRepository* iCentralRepository; |
|
157 // Reference to RadioSetting object |
|
158 TRadioSettings* iRadioSettings; |
|
159 /** The current region. */ |
|
160 TInt iCurrentRegionIdx; |
|
161 /** The available regions. */ |
|
162 RPointerArray<CFMRadioRegion> iRegions; |
|
163 |
|
164 |
|
165 |
|
166 }; |
|
167 |
|
168 #endif // FMRADIOENGINECENTRALREPOSITORYHANDLER_H |
|
169 |
|
170 // end of file |