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: This provides the messaging mw interface for sms |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <centralrepository.h> // CRepository |
|
19 #include <MessagingInternalCRKeys.h> // Keys |
|
20 #include "debugtraces.h" |
|
21 |
|
22 |
|
23 #include "msgsettingsutil.h" |
|
24 |
|
25 // read settings of email from CRE |
|
26 TInt MsgSettingsUtil::ReadEmailOverSmsSettingsL( |
|
27 TDes& aSmsc, |
|
28 TDes& aDestinationAddress) |
|
29 { |
|
30 #ifdef _DEBUG_TRACES_ |
|
31 qDebug() << "MsgSettingsUtil::ReadEmailOverSmsSettingsL"; |
|
32 #endif |
|
33 |
|
34 |
|
35 // Create storage |
|
36 CRepository* storage = CRepository::NewLC( KCRUidSmum ); |
|
37 |
|
38 storage->Get( KSumEmailSC, aSmsc ); |
|
39 storage->Get( KSumEmailGateway, aDestinationAddress ); |
|
40 |
|
41 TBool modifiable = EFalse; |
|
42 storage->Get( KSumEmailModifiable, modifiable ); |
|
43 CleanupStack::PopAndDestroy(); // storage |
|
44 |
|
45 #ifdef _DEBUG_TRACES_ |
|
46 qDebug() << "Exit MsgSettingsUtil::ReadEmailOverSmsSettingsL"; |
|
47 #endif |
|
48 |
|
49 |
|
50 return KErrNone; |
|
51 } |
|
52 |
|
53 |
|
54 //write email settings into CRE file |
|
55 void MsgSettingsUtil::WriteEmailGatewayOverSmsSettingsL( |
|
56 const TDes& aDestinationAddress, |
|
57 const TBool& aModifiable) |
|
58 { |
|
59 #ifdef _DEBUG_TRACES_ |
|
60 qDebug() << "MsgSettingsUtil::WriteEmailGatewayOverSmsSettingsL"; |
|
61 #endif |
|
62 |
|
63 |
|
64 // Create storage |
|
65 CRepository* storage = CRepository::NewLC( KCRUidSmum ); |
|
66 |
|
67 storage->Set( KSumEmailGateway, aDestinationAddress ); |
|
68 storage->Set( KSumEmailModifiable, aModifiable ); |
|
69 |
|
70 CleanupStack::PopAndDestroy(); // storage |
|
71 |
|
72 #ifdef _DEBUG_TRACES_ |
|
73 qDebug() << "Exit MsgSettingsUtil::WriteEmailGatewayOverSmsSettingsL"; |
|
74 #endif |
|
75 |
|
76 return; |
|
77 } |
|
78 |
|
79 //write email settings into CRE file |
|
80 void MsgSettingsUtil::WriteEmailServiceNumberOverSmsSettingsL( |
|
81 const TDes& aSmsc, |
|
82 const TBool& aModifiable) |
|
83 { |
|
84 #ifdef _DEBUG_TRACES_ |
|
85 qDebug() << "MsgSettingsUtil::WriteEmailServiceNumberOverSmsSettingsL"; |
|
86 #endif |
|
87 |
|
88 |
|
89 // Create storage |
|
90 CRepository* storage = CRepository::NewLC( KCRUidSmum ); |
|
91 |
|
92 storage->Set( KSumEmailSC, aSmsc ); |
|
93 storage->Set( KSumEmailModifiable, aModifiable ); |
|
94 |
|
95 CleanupStack::PopAndDestroy(); // storage |
|
96 |
|
97 #ifdef _DEBUG_TRACES_ |
|
98 qDebug() << "Exit MsgSettingsUtil::WriteEmailServiceNumberOverSmsSettingsL"; |
|
99 #endif |
|
100 |
|
101 return; |
|
102 |
|
103 } |
|
104 |
|
105 //eof |
|