|
1 /* |
|
2 * Copyright (c) 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 // System includes |
|
19 |
|
20 // User includes |
|
21 #include "radiostation_p.h" |
|
22 |
|
23 /*! |
|
24 * |
|
25 */ |
|
26 RadioStationPrivate::RadioStationPrivate( int presetIndex, uint frequency ) |
|
27 { |
|
28 init( presetIndex, frequency ); |
|
29 } |
|
30 |
|
31 /*! |
|
32 * |
|
33 */ |
|
34 RadioStationPrivate::RadioStationPrivate( RadioStation::PresetFlag flag ) |
|
35 { |
|
36 init( flag ); |
|
37 } |
|
38 |
|
39 /*! |
|
40 * |
|
41 */ |
|
42 RadioStationPrivate::~RadioStationPrivate() |
|
43 { |
|
44 } |
|
45 |
|
46 /*! |
|
47 * |
|
48 */ |
|
49 void RadioStationPrivate::init( int presetIndex, uint frequency ) |
|
50 { |
|
51 ref = 1; |
|
52 mFrequency = frequency; |
|
53 mPresetIndex = presetIndex; |
|
54 mRenamedByUser = false; |
|
55 mGenre = -1; |
|
56 mPiCode = -1; |
|
57 mType = 0; |
|
58 mPsType = RadioStation::Unknown; |
|
59 mChangeFlags = RadioStation::NoChange; |
|
60 mCallSignCheckDone = false; |
|
61 } |
|
62 |
|
63 /*! |
|
64 * \reimp |
|
65 */ |
|
66 int RadioStationPrivate::presetIndex() const |
|
67 { |
|
68 return mPresetIndex; |
|
69 } |
|
70 |
|
71 /*! |
|
72 * \reimp |
|
73 */ |
|
74 void RadioStationPrivate::setPresetIndex( int presetIndex ) |
|
75 { |
|
76 mPresetIndex = presetIndex; |
|
77 } |
|
78 |
|
79 /*! |
|
80 * \reimp |
|
81 */ |
|
82 uint RadioStationPrivate::frequency() const |
|
83 { |
|
84 return mFrequency; |
|
85 } |
|
86 |
|
87 /*! |
|
88 * \reimp |
|
89 */ |
|
90 void RadioStationPrivate::setFrequency( uint frequency ) |
|
91 { |
|
92 mFrequency = frequency; |
|
93 } |
|
94 |
|
95 /*! |
|
96 * \reimp |
|
97 */ |
|
98 QString RadioStationPrivate::name() const |
|
99 { |
|
100 return mName; |
|
101 } |
|
102 |
|
103 /*! |
|
104 * \reimp |
|
105 */ |
|
106 void RadioStationPrivate::setName( QString name ) |
|
107 { |
|
108 mName = name; |
|
109 } |
|
110 |
|
111 /*! |
|
112 * \reimp |
|
113 */ |
|
114 bool RadioStationPrivate::isRenamedByUser() const |
|
115 { |
|
116 return mRenamedByUser; |
|
117 } |
|
118 |
|
119 /*! |
|
120 * \reimp |
|
121 */ |
|
122 void RadioStationPrivate::setRenamedByUser( bool renamed ) |
|
123 { |
|
124 mRenamedByUser = renamed; |
|
125 } |
|
126 |
|
127 /*! |
|
128 * \reimp |
|
129 */ |
|
130 int RadioStationPrivate::genre() const |
|
131 { |
|
132 return mGenre; |
|
133 } |
|
134 |
|
135 /*! |
|
136 * \reimp |
|
137 */ |
|
138 void RadioStationPrivate::setGenre( int genre ) |
|
139 { |
|
140 mGenre = genre; |
|
141 } |
|
142 |
|
143 /*! |
|
144 * \reimp |
|
145 */ |
|
146 QString RadioStationPrivate::url() const |
|
147 { |
|
148 return mUrl; |
|
149 } |
|
150 |
|
151 /*! |
|
152 * \reimp |
|
153 */ |
|
154 void RadioStationPrivate::setUrl( QString url ) |
|
155 { |
|
156 mUrl = url; |
|
157 } |
|
158 |
|
159 /*! |
|
160 * \reimp |
|
161 */ |
|
162 int RadioStationPrivate::piCode() const |
|
163 { |
|
164 return mPiCode; |
|
165 } |
|
166 |
|
167 /*! |
|
168 * \reimp |
|
169 */ |
|
170 void RadioStationPrivate::setPiCode( int piCode ) |
|
171 { |
|
172 mPiCode = piCode; |
|
173 } |
|
174 |
|
175 /*! |
|
176 * \reimp |
|
177 */ |
|
178 bool RadioStationPrivate::isFavorite() const |
|
179 { |
|
180 return mType.testFlag( RadioStation::Favorite ); |
|
181 } |
|
182 |
|
183 /*! |
|
184 * \reimp |
|
185 */ |
|
186 void RadioStationPrivate::setFavorite( bool favorite ) |
|
187 { |
|
188 if ( favorite ) { |
|
189 mType |= RadioStation::Favorite; |
|
190 } else { |
|
191 mType &= ~RadioStation::Favorite; |
|
192 } |
|
193 } |
|
194 |
|
195 /*! |
|
196 * \reimp |
|
197 */ |
|
198 bool RadioStationPrivate::isLocalStation() const |
|
199 { |
|
200 return mType.testFlag( RadioStation::LocalStation ); |
|
201 } |
|
202 |
|
203 /*! |
|
204 * \reimp |
|
205 */ |
|
206 void RadioStationPrivate::setLocalStation( bool localStation ) |
|
207 { |
|
208 if ( localStation ) { |
|
209 mType |= RadioStation::LocalStation; |
|
210 } else { |
|
211 mType &= ~RadioStation::LocalStation; |
|
212 } |
|
213 } |