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