36
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 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: Profile PTT settings implementation.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "CProfileVibraSettingsImpl.h"
|
|
19 |
#include "ProfileEngUtils.h"
|
|
20 |
#include "ProfileEnginePrivateCRKeys.h"
|
|
21 |
|
|
22 |
#include <ProfileInternal.hrh>
|
|
23 |
#include <centralrepository.h>
|
|
24 |
|
|
25 |
|
|
26 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
27 |
|
|
28 |
//Default Constructor
|
|
29 |
CProfileVibraSettingsImpl::CProfileVibraSettingsImpl() : iAlertVibra( 0 )
|
|
30 |
{
|
|
31 |
|
|
32 |
}
|
|
33 |
|
|
34 |
// -----------------------------------------------------------------------------
|
|
35 |
// CProfileTonesImpl::ConstructL
|
|
36 |
// Symbian 2nd phase constructor can leave.
|
|
37 |
// -----------------------------------------------------------------------------
|
|
38 |
//
|
|
39 |
void CProfileVibraSettingsImpl::ConstructL()
|
|
40 |
{
|
|
41 |
|
|
42 |
}
|
|
43 |
|
|
44 |
|
|
45 |
// -----------------------------------------------------------------------------
|
|
46 |
// CProfilePresenceImpl::NewL
|
|
47 |
// Two-phased constructor.
|
|
48 |
// -----------------------------------------------------------------------------
|
|
49 |
//
|
|
50 |
CProfileVibraSettingsImpl *CProfileVibraSettingsImpl::NewL()
|
|
51 |
{
|
|
52 |
CProfileVibraSettingsImpl* self = new( ELeave ) CProfileVibraSettingsImpl;
|
|
53 |
|
|
54 |
CleanupStack::PushL( self );
|
|
55 |
self->ConstructL();
|
|
56 |
CleanupStack::Pop();
|
|
57 |
|
|
58 |
return self;
|
|
59 |
}
|
|
60 |
|
|
61 |
// Destructor
|
|
62 |
CProfileVibraSettingsImpl::~CProfileVibraSettingsImpl()
|
|
63 |
{
|
|
64 |
|
|
65 |
}
|
|
66 |
|
|
67 |
// -----------------------------------------------------------------------------
|
|
68 |
// CProfileVibraSettingsImpl::InternalizeL
|
|
69 |
//
|
|
70 |
// (other items were commented in a header).
|
|
71 |
// -----------------------------------------------------------------------------
|
|
72 |
//
|
|
73 |
void CProfileVibraSettingsImpl::InternalizeL( CRepository& aCenRep,
|
|
74 |
TInt aProfileId )
|
|
75 |
{
|
|
76 |
User::LeaveIfError(
|
|
77 |
aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngAlertVibra,
|
|
78 |
aProfileId ), iAlertVibra) );
|
|
79 |
}
|
|
80 |
|
|
81 |
// -----------------------------------------------------------------------------
|
|
82 |
// CProfileVibraSettingsImpl::ExternalizeL
|
|
83 |
//
|
|
84 |
// (other items were commented in a header).
|
|
85 |
// -----------------------------------------------------------------------------
|
|
86 |
//
|
|
87 |
void CProfileVibraSettingsImpl::ExternalizeL( CRepository& aCenRep,
|
|
88 |
TInt aProfileId ) const
|
|
89 |
{
|
|
90 |
User::LeaveIfError(
|
|
91 |
aCenRep.Set( ProfileEngUtils::ResolveKey( KProEngAlertVibra,
|
|
92 |
aProfileId ), iAlertVibra ) );
|
|
93 |
}
|
|
94 |
|
|
95 |
|
|
96 |
// -----------------------------------------------------------------------------
|
|
97 |
// CProfileVibraSettingsImpl::AlertVibra
|
|
98 |
//
|
|
99 |
// (other items were commented in a header).
|
|
100 |
// -----------------------------------------------------------------------------
|
|
101 |
//
|
|
102 |
TInt CProfileVibraSettingsImpl::AlertVibra() const
|
|
103 |
{
|
|
104 |
return iAlertVibra;
|
|
105 |
}
|
|
106 |
|
|
107 |
|
|
108 |
// -----------------------------------------------------------------------------
|
|
109 |
// CProfileVibraSettingsImpl::RingAlertVibra
|
|
110 |
//
|
|
111 |
// (other items were commented in a header).
|
|
112 |
// -----------------------------------------------------------------------------
|
|
113 |
//
|
|
114 |
TBool CProfileVibraSettingsImpl::RingAlertVibra() const
|
|
115 |
{
|
|
116 |
return iAlertVibra & EProfileRingAlertVibra;
|
|
117 |
}
|
|
118 |
|
|
119 |
// -----------------------------------------------------------------------------
|
|
120 |
// CProfileVibraSettingsImpl::MessageAlertVibra
|
|
121 |
//
|
|
122 |
// (other items were commented in a header).
|
|
123 |
// -----------------------------------------------------------------------------
|
|
124 |
//
|
|
125 |
TBool CProfileVibraSettingsImpl::MessageAlertVibra() const
|
|
126 |
{
|
|
127 |
return iAlertVibra & EProfileMessageAlertVibra;
|
|
128 |
}
|
|
129 |
|
|
130 |
// -----------------------------------------------------------------------------
|
|
131 |
// CProfileVibraSettingsImpl::EmailAlertVibra
|
|
132 |
//
|
|
133 |
// (other items were commented in a header).
|
|
134 |
// -----------------------------------------------------------------------------
|
|
135 |
//
|
|
136 |
TBool CProfileVibraSettingsImpl::EmailAlertVibra() const
|
|
137 |
{
|
|
138 |
return iAlertVibra & EProfileEmailAlertVibra;
|
|
139 |
}
|
|
140 |
|
|
141 |
// -----------------------------------------------------------------------------
|
|
142 |
// CProfileVibraSettingsImpl::ReminderAlarmVibra
|
|
143 |
//
|
|
144 |
// (other items were commented in a header).
|
|
145 |
// -----------------------------------------------------------------------------
|
|
146 |
//
|
|
147 |
TBool CProfileVibraSettingsImpl::ReminderAlarmVibra() const
|
|
148 |
{
|
|
149 |
return iAlertVibra & EProfileReminderAlarmVibra;
|
|
150 |
}
|
|
151 |
|
|
152 |
// -----------------------------------------------------------------------------
|
|
153 |
// CProfileVibraSettingsImpl::InformationVibra
|
|
154 |
//
|
|
155 |
// (other items were commented in a header).
|
|
156 |
// -----------------------------------------------------------------------------
|
|
157 |
//
|
|
158 |
TBool CProfileVibraSettingsImpl::InformationVibra() const
|
|
159 |
{
|
|
160 |
return iAlertVibra & EProfileInformationVibra;
|
|
161 |
}
|
|
162 |
|
|
163 |
// -----------------------------------------------------------------------------
|
|
164 |
// CProfileVibraSettingsImpl::SetAlertVibra
|
|
165 |
//
|
|
166 |
// (other items were commented in a header).
|
|
167 |
// -----------------------------------------------------------------------------
|
|
168 |
//
|
|
169 |
void CProfileVibraSettingsImpl::SetAlertVibra(TInt aAlertVibra)
|
|
170 |
{
|
|
171 |
iAlertVibra = aAlertVibra;
|
|
172 |
}
|
|
173 |
|
|
174 |
|
|
175 |
// -----------------------------------------------------------------------------
|
|
176 |
// CProfileVibraSettingsImpl::SetRingAlertVibra
|
|
177 |
//
|
|
178 |
// (other items were commented in a header).
|
|
179 |
// -----------------------------------------------------------------------------
|
|
180 |
//
|
|
181 |
void CProfileVibraSettingsImpl::SetRingAlertVibra(TBool aRingAlertVibra)
|
|
182 |
{
|
|
183 |
if ( aRingAlertVibra )
|
|
184 |
{
|
|
185 |
iAlertVibra |= EProfileRingAlertVibra;
|
|
186 |
}
|
|
187 |
else
|
|
188 |
{
|
|
189 |
iAlertVibra &= ~EProfileRingAlertVibra;
|
|
190 |
}
|
|
191 |
}
|
|
192 |
|
|
193 |
// -----------------------------------------------------------------------------
|
|
194 |
// CProfileVibraSettingsImpl::SetMessageAlertVibra
|
|
195 |
//
|
|
196 |
// (other items were commented in a header).
|
|
197 |
// -----------------------------------------------------------------------------
|
|
198 |
//
|
|
199 |
void CProfileVibraSettingsImpl::SetMessageAlertVibra(TBool aMessageAlertVibra)
|
|
200 |
{
|
|
201 |
if ( aMessageAlertVibra )
|
|
202 |
{
|
|
203 |
iAlertVibra |= EProfileMessageAlertVibra;
|
|
204 |
}
|
|
205 |
else
|
|
206 |
{
|
|
207 |
iAlertVibra &= ~EProfileMessageAlertVibra;
|
|
208 |
}
|
|
209 |
}
|
|
210 |
|
|
211 |
// -----------------------------------------------------------------------------
|
|
212 |
// CProfileVibraSettingsImpl::SetEmailAlertVibra
|
|
213 |
//
|
|
214 |
// (other items were commented in a header).
|
|
215 |
// -----------------------------------------------------------------------------
|
|
216 |
//
|
|
217 |
void CProfileVibraSettingsImpl::SetEmailAlertVibra(TBool aEmailAlertVibra)
|
|
218 |
{
|
|
219 |
if ( aEmailAlertVibra )
|
|
220 |
{
|
|
221 |
iAlertVibra |= EProfileEmailAlertVibra;
|
|
222 |
}
|
|
223 |
else
|
|
224 |
{
|
|
225 |
iAlertVibra &= ~EProfileEmailAlertVibra;
|
|
226 |
}
|
|
227 |
}
|
|
228 |
|
|
229 |
// -----------------------------------------------------------------------------
|
|
230 |
// CProfileVibraSettingsImpl::SetReminderAlarmVibra
|
|
231 |
//
|
|
232 |
// (other items were commented in a header).
|
|
233 |
// -----------------------------------------------------------------------------
|
|
234 |
//
|
|
235 |
void CProfileVibraSettingsImpl::SetReminderAlarmVibra(TBool aReminderAlarmVibra)
|
|
236 |
{
|
|
237 |
if ( aReminderAlarmVibra )
|
|
238 |
{
|
|
239 |
iAlertVibra |= EProfileReminderAlarmVibra;
|
|
240 |
}
|
|
241 |
else
|
|
242 |
{
|
|
243 |
iAlertVibra &= ~EProfileReminderAlarmVibra;
|
|
244 |
}
|
|
245 |
}
|
|
246 |
|
|
247 |
// -----------------------------------------------------------------------------
|
|
248 |
// CProfileVibraSettingsImpl::SetInformationVibra
|
|
249 |
//
|
|
250 |
// (other items were commented in a header).
|
|
251 |
// -----------------------------------------------------------------------------
|
|
252 |
//
|
|
253 |
void CProfileVibraSettingsImpl::SetInformationVibra(TBool aInformationVibra)
|
|
254 |
{
|
|
255 |
if ( aInformationVibra )
|
|
256 |
{
|
|
257 |
iAlertVibra |= EProfileInformationVibra;
|
|
258 |
}
|
|
259 |
else
|
|
260 |
{
|
|
261 |
iAlertVibra &= ~EProfileInformationVibra;
|
|
262 |
}
|
|
263 |
}
|
|
264 |
|
|
265 |
//End of File
|