author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 14:15:47 +0300 | |
changeset 46 | bc5a64e5bc3c |
parent 37 | ba76fc04e6c2 |
child 51 | f39ed5e045e0 |
child 60 | 1eef62f5c541 |
permissions | -rw-r--r-- |
37 | 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: This module contains the implementation of |
|
15 |
* CPEExternalDataHandler class |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
||
20 |
// INCLUDE FILES |
|
21 |
#include "cpeexternaldatahandler.h" |
|
22 |
#include "mpephonemodelinternal.h" |
|
23 |
#include <accessoriescrkeys.h> |
|
24 |
#include <centralrepository.h> |
|
25 |
#include <CoreApplicationUIsSDKCRKeys.h> |
|
26 |
#include <ctsydomainpskeys.h> |
|
27 |
#include <mpedatastore.h> |
|
28 |
#include <pepanic.pan> |
|
29 |
#include <settingsinternalcrkeys.h> |
|
30 |
#include <talogger.h> |
|
31 |
#include <telephonyvariant.hrh> |
|
32 |
#include <telinternalcrkeys.h> |
|
33 |
||
34 |
CPEExternalDataHandler* CPEExternalDataHandler::NewL( MPEPhoneModelInternal& aModel ) |
|
35 |
{ |
|
36 |
CPEExternalDataHandler* self = new ( ELeave ) CPEExternalDataHandler( *aModel.DataStore() ); |
|
37 |
CleanupStack::PushL( self ); |
|
38 |
self->ConstructL( aModel ); |
|
39 |
CleanupStack::Pop( self ); |
|
40 |
return self; |
|
41 |
} |
|
42 |
||
43 |
// ----------------------------------------------------------------------------- |
|
44 |
// CPEExternalDataHandler::CPEExternalDataHandler |
|
45 |
// C++ default constructor can NOT contain any code, that |
|
46 |
// might leave. |
|
47 |
// ----------------------------------------------------------------------------- |
|
48 |
// |
|
49 |
CPEExternalDataHandler::CPEExternalDataHandler( |
|
50 |
MPEDataStore& aDataStore |
|
51 |
) : iDataStore( aDataStore ) |
|
52 |
{ |
|
53 |
} |
|
54 |
||
55 |
// Destructor |
|
56 |
CPEExternalDataHandler::~CPEExternalDataHandler() |
|
57 |
{ |
|
58 |
TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::~CPEExternalDataHandler" ); |
|
59 |
||
60 |
delete iTelephonyVariationRepository; |
|
61 |
delete iTelephonySettingsRepository; |
|
62 |
delete iProfileSettings; |
|
63 |
delete iNetworkRegistrationStatus; |
|
64 |
delete iCallDurationDisplay; |
|
65 |
delete iAudioOutputPreferenceMonitor; |
|
66 |
delete iAccessorySettingsRepository; |
|
67 |
delete iAccessoryModeMonitor; |
|
68 |
delete iCoreApplicationRepository; |
|
69 |
delete iNetworkHandler; |
|
70 |
} |
|
71 |
||
72 |
// ----------------------------------------------------------------------------- |
|
73 |
// CPEExternalDataHandler::BaseConstructL |
|
74 |
// Symbian 2nd phase constructor can leave. |
|
75 |
// ----------------------------------------------------------------------------- |
|
76 |
// |
|
77 |
void CPEExternalDataHandler::ConstructL( |
|
78 |
MPEPhoneModelInternal& aModel ) |
|
79 |
{ |
|
80 |
TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::BaseConstructL" ); |
|
81 |
||
82 |
// Instantiate monitor objects |
|
83 |
iAudioOutputPreferenceMonitor = CPEAudioOutputPreferenceMonitor::NewL( aModel ); |
|
84 |
iCallDurationDisplay = CPECallDurationDisplaySettingMonitor::NewL(); |
|
85 |
iProfileSettings = CPEProfileSettingMonitor::NewL( aModel ); |
|
86 |
||
87 |
iNetworkHandler = new PeNetworkHandler(aModel); |
|
88 |
//TODO |
|
89 |
/* |
|
90 |
iNetworkRegistrationStatus = CPENetworkRegistrationStatusMonitor::NewL( aModel ); |
|
91 |
iAccessoryModeMonitor = CPEAccessoryModeMonitor::NewL(); |
|
92 |
||
93 |
// Instantiate repository objects for later use |
|
94 |
iAccessorySettingsRepository = CRepository::NewL( KCRUidAccessorySettings );*/ |
|
95 |
//iTelephonySettingsRepository = CRepository::NewL( KCRUidTelephonySettings ); |
|
96 |
iTelephonyVariationRepository = CRepository::NewL( KCRUidTelVariation ); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
97 |
iCoreApplicationRepository = CRepository::NewL( KCRUidCoreApplicationUIs ); |
37 | 98 |
|
99 |
TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::BaseConstructL 2" ); |
|
100 |
} |
|
101 |
||
102 |
// ----------------------------------------------------------------------------- |
|
103 |
// CPEExternalDataHandler::Get |
|
104 |
// Gets the current value of the specified setting, if the operation was successful |
|
105 |
// aValue contains the current valid value of the setting |
|
106 |
// ----------------------------------------------------------------------------- |
|
107 |
// |
|
108 |
TInt CPEExternalDataHandler::Get( |
|
109 |
const TPEExternalDataId aSetting, |
|
110 |
TInt& aValue ) const |
|
111 |
{ |
|
112 |
TInt errorCode( KErrNotFound ); |
|
113 |
||
114 |
//TODO |
|
115 |
||
116 |
if ( EPETelephonyVariationFlags == aSetting ) |
|
117 |
{ |
|
118 |
errorCode = iTelephonyVariationRepository->Get( KTelVariationFlags, aValue ); |
|
119 |
TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPETelephonyVariationFlags, error code: %d", errorCode ); |
|
120 |
} |
|
121 |
else if ( EPEAudioOutputPreference == aSetting ) |
|
122 |
{ |
|
123 |
errorCode = iAudioOutputPreferenceMonitor->Get( aValue ); |
|
124 |
TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAudioOutputPreference, error code: %d", errorCode ); |
|
125 |
} |
|
126 |
else if ( EPECallDurationDisplaySetting == aSetting ) |
|
127 |
{ |
|
128 |
errorCode = iCallDurationDisplay->Get( aValue ); |
|
129 |
TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPECallDurationDisplaySetting, error code: %d", errorCode ); |
|
130 |
} |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
131 |
else if ( EPENetworkConnectionAllowedSetting == aSetting ) |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
132 |
{ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
133 |
// Fetches setting that indicates if network connection is allowed, |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
134 |
// i.e. is the phone in off-line mode. |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
135 |
errorCode = iCoreApplicationRepository |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
136 |
->Get( KCoreAppUIsNetworkConnectionAllowed, aValue ); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
137 |
} |
37 | 138 |
else |
139 |
{ |
|
140 |
errorCode = KErrNone; |
|
141 |
aValue = 0; |
|
142 |
} |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
143 |
|
37 | 144 |
// Process Common id |
145 |
return errorCode; |
|
146 |
} |
|
147 |
||
148 |
// ----------------------------------------------------------------------------- |
|
149 |
// CPEExternalDataHandler::Get |
|
150 |
// Gets the current value of the specified setting, if the operation was successful |
|
151 |
// aValue contains the current valid value of the setting |
|
152 |
// ----------------------------------------------------------------------------- |
|
153 |
// |
|
154 |
TInt CPEExternalDataHandler::GetText( |
|
155 |
const TPEExternalDataId /*aSetting*/, |
|
156 |
TDesC& aValue ) const |
|
157 |
{ |
|
158 |
TInt errorCode( KErrNotFound ); |
|
159 |
//TODO |
|
160 |
aValue = KNullDesC; |
|
161 |
errorCode = KErrNone; |
|
162 |
return errorCode; |
|
163 |
} |
|
164 |
||
165 |
// ----------------------------------------------------------------------------- |
|
166 |
// CPEExternalDataHandler::GetAutomaticAnswer |
|
167 |
// Check if automatic answer is defined for connected accessory. |
|
168 |
// ----------------------------------------------------------------------------- |
|
169 |
// |
|
170 |
TInt CPEExternalDataHandler::GetAutomaticAnswer( |
|
171 |
TUint32 /*aSetting*/, |
|
172 |
TInt& aValue ) const |
|
173 |
{ |
|
174 |
TInt errorCode( KErrNotFound ); |
|
175 |
||
176 |
TEFLOGSTRING( KTAINT, "CPEExternalDataHandler::GetAutomaticAnswer" ); |
|
177 |
errorCode = KErrNone; |
|
178 |
aValue = 0; |
|
179 |
return errorCode; |
|
180 |
} |
|
181 |
||
182 |
// ----------------------------------------------------------------------------- |
|
183 |
// CPEExternalDataHandler::Set |
|
184 |
// Sets the value of the specified setting |
|
185 |
// ----------------------------------------------------------------------------- |
|
186 |
// |
|
187 |
TInt CPEExternalDataHandler::Set( |
|
188 |
const TPEExternalDataId aSetting, |
|
189 |
const TInt aValue ) |
|
190 |
{ |
|
191 |
TInt errorCode( KErrNotFound ); |
|
192 |
||
193 |
switch ( aSetting ) |
|
194 |
{ |
|
195 |
case EPEEmergencyCallInfo: |
|
196 |
{ |
|
197 |
errorCode = RProperty::Set( KPSUidCtsyEmergencyCallInfo, |
|
198 |
KCTSYEmergencyCallInfo, aValue ); |
|
199 |
TEFLOGSTRING2( KTAERROR, |
|
200 |
"PE CPEExternalDataHandler::Set KPSUidCtsyEmergencyCallInfo: %d", aValue ); |
|
201 |
break; |
|
202 |
} |
|
203 |
default: |
|
204 |
{ |
|
205 |
TEFLOGSTRING2( KTAERROR, "PE CPEEXTERNALDATAHANDLER::SET UNKNOWN SETTING ID ! %d", aSetting ); |
|
206 |
break; |
|
207 |
} |
|
208 |
} |
|
209 |
return errorCode; |
|
210 |
} |
|
211 |
||
212 |
// End of file |