|
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: |
|
15 * Help classes to handle Service Centres and settings. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDES |
|
22 #include <eikclb.h> // CEikColumnListBox |
|
23 #include <AknPhoneNumberGrouping.h> // CAknPhoneNumberGrouping |
|
24 #include <StringLoader.h> // StringLoader |
|
25 #include <SMUM.rsg> // resource ids |
|
26 #include "smsetdlgcdma.h" // dialogs |
|
27 #include "SmumSettingsDialogCDMA.h" |
|
28 |
|
29 // LOCAL CONSTANTS AND MACROS |
|
30 const TInt KSmumNumberOfSeparatingColumnCharacters = 2; |
|
31 const TInt KSmumNumberOfEndColumnCharacters = 1; |
|
32 const TInt KMaxLengthOfNameAndNumberString = 100; |
|
33 const TUint KSpaceChar = ' '; |
|
34 _LIT(KSmumSpaceString, " "); |
|
35 |
|
36 // MEMBER FUNCTIONS |
|
37 |
|
38 |
|
39 /** |
|
40 * CSmumSettingsArray - class |
|
41 */ |
|
42 |
|
43 // --------------------------------------------------------- |
|
44 // CSmumSettingsArray::NewL |
|
45 // |
|
46 // --------------------------------------------------------- |
|
47 CSmumSettingsArray* CSmumSettingsArray::NewL( TInt aResourceId ) |
|
48 { |
|
49 CSmumSettingsArray* self = new ( ELeave ) CSmumSettingsArray(); |
|
50 CleanupStack::PushL( self ); |
|
51 self->ConstructL( aResourceId ); |
|
52 CleanupStack::Pop(); // self |
|
53 return self; |
|
54 } |
|
55 |
|
56 // --------------------------------------------------------- |
|
57 // CSmumSettingsArray::ConstructL |
|
58 // |
|
59 // --------------------------------------------------------- |
|
60 void CSmumSettingsArray::ConstructL( TInt aResourceId ) |
|
61 { |
|
62 iTypeOfSettingsId = aResourceId; |
|
63 CMuiuSettingsArray::ConstructL( aResourceId ); |
|
64 } |
|
65 |
|
66 // --------------------------------------------------------- |
|
67 // CSmumSettingsArray::CSmumSettingsArray |
|
68 // |
|
69 // --------------------------------------------------------- |
|
70 CSmumSettingsArray::CSmumSettingsArray() : |
|
71 iCallBackNumberString( NULL ) |
|
72 { |
|
73 } |
|
74 |
|
75 // --------------------------------------------------------- |
|
76 // CSmumSettingsArray::~CSmumSettingsArray |
|
77 // |
|
78 // --------------------------------------------------------- |
|
79 CSmumSettingsArray::~CSmumSettingsArray() |
|
80 { |
|
81 delete iCallBackNumberString; |
|
82 } |
|
83 |
|
84 // --------------------------------------------------------- |
|
85 // CSmumSettingsArray::MdcaPoint |
|
86 // |
|
87 // --------------------------------------------------------- |
|
88 TPtrC CSmumSettingsArray::MdcaPoint( TInt aIndex ) const |
|
89 { |
|
90 TPtr tempText = iTempText->Des(); |
|
91 TInt typeOfSettings = 0; |
|
92 if (R_SMS_SENDING_OPTIONS_ITEMS_CDMA == iTypeOfSettingsId || R_SMS_SENDING_OPTIONS_ITEMS_CDMA_NO_DELIVERY == iTypeOfSettingsId) |
|
93 { |
|
94 typeOfSettings = ESmumSendOptCallbackNumberLBICDMA; |
|
95 } |
|
96 else if (R_SMS_MAIN_SETTINGS_ITEMS_CDMA == iTypeOfSettingsId || R_SMS_MAIN_SETTINGS_ITEMS_CDMA_NO_DELIVERY == iTypeOfSettingsId) |
|
97 { |
|
98 typeOfSettings = ESmumCallbackNumberLBICDMA; |
|
99 } |
|
100 if ( typeOfSettings == aIndex ) |
|
101 { |
|
102 tempText.Zero(); |
|
103 tempText.Append( KSmumSpaceString ); |
|
104 tempText.Append( KColumnListSeparator ); |
|
105 tempText.Append( At( aIndex ).iLabelText ); |
|
106 tempText.Append( KColumnListSeparator ); |
|
107 tempText.Append( KColumnListSeparator ); |
|
108 if (iCallBackNumberString) |
|
109 { |
|
110 HBufC* callbackNumber = CAknPhoneNumberGrouping::CreateGroupedPhoneNumberL( *iCallBackNumberString ); |
|
111 CleanupStack::PushL( callbackNumber ); |
|
112 |
|
113 tempText.Append( *callbackNumber ); |
|
114 |
|
115 CleanupStack::PopAndDestroy( callbackNumber ); |
|
116 } |
|
117 return tempText; |
|
118 } |
|
119 else |
|
120 { |
|
121 return CMuiuSettingsArray::MdcaPoint( aIndex ); |
|
122 } |
|
123 } |
|
124 |
|
125 // --------------------------------------------------------- |
|
126 // CSmumSettingsArray::SetCallBackNumberL |
|
127 // |
|
128 // --------------------------------------------------------- |
|
129 void CSmumSettingsArray::SetCallBackNumberL( const TDesC& aCallBackNumber) |
|
130 { |
|
131 if (iCallBackNumberString) |
|
132 { |
|
133 delete iCallBackNumberString; |
|
134 iCallBackNumberString = NULL; |
|
135 } |
|
136 |
|
137 iCallBackNumberString = HBufC::NewL( aCallBackNumber.Length()); |
|
138 iCallBackNumberString->Des().Copy( aCallBackNumber); |
|
139 } |
|
140 |
|
141 // --------------------------------------------------------- |
|
142 // CSmumSettingsArray::CallBackNumber |
|
143 // |
|
144 // --------------------------------------------------------- |
|
145 TPtrC CSmumSettingsArray::CallBackNumber() const |
|
146 { |
|
147 if (iCallBackNumberString) |
|
148 { |
|
149 return iCallBackNumberString->Des(); |
|
150 } |
|
151 return TPtrC (KNullDesC); |
|
152 } |
|
153 |
|
154 // End of File |