|
1 /* |
|
2 * Copyright (c) 2004 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDES |
|
20 #include "createsessionEstablishValuesdialog.h" |
|
21 #include <AknPopupFieldText.h> |
|
22 |
|
23 #include "mcetestuiengineconstants.h" |
|
24 |
|
25 // CONSTANTS |
|
26 const TInt KBufLength = 100; |
|
27 |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS ============================== |
|
30 |
|
31 // ---------------------------------------------------------------------------- |
|
32 // CSessionEstablishValuesDialog::CSessionEstablishValuesDialog( CRtpEngine::TSessionType* ) |
|
33 // . |
|
34 // ---------------------------------------------------------------------------- |
|
35 // |
|
36 CSessionEstablishValuesDialog::CSessionEstablishValuesDialog( TSessionEstablishValues* aParams ) : |
|
37 iParams( aParams ) |
|
38 { |
|
39 // No implementation required |
|
40 } |
|
41 |
|
42 // ---------------------------------------------------------------------------- |
|
43 // CSessionEstablishValuesDialog::PreLayoutDynInitL() |
|
44 // . |
|
45 // ---------------------------------------------------------------------------- |
|
46 // |
|
47 void CSessionEstablishValuesDialog::PreLayoutDynInitL() |
|
48 { |
|
49 |
|
50 CEikNumberEditor* timeOut = static_cast<CEikNumberEditor*>( |
|
51 Control( ESessionTimeOut ) ); |
|
52 TInt num = 36000; |
|
53 timeOut->SetNumber(num); |
|
54 |
|
55 CEikNumberEditor* serviceType = static_cast<CEikNumberEditor*>( |
|
56 Control( ESessionServiceType ) ); |
|
57 serviceType->SetNumber(0); |
|
58 |
|
59 TBuf<KBufLength> defaultValue; |
|
60 |
|
61 iParams->headers.Copy(KDefaultAcceptContactValue); |
|
62 CEikEdwin* headers = static_cast<CEikEdwin*>( |
|
63 Control( ESessionHeaders ) ); |
|
64 defaultValue.Copy(iParams->headers); |
|
65 headers->SetTextL(&defaultValue); |
|
66 headers->SetCursorPosL(defaultValue.Length(),EFalse); |
|
67 |
|
68 |
|
69 /* |
|
70 iParams->contentType.Copy(KContentType); |
|
71 CEikEdwin* contentType = static_cast<CEikEdwin*>( |
|
72 Control( EEstablishContentType ) ); |
|
73 defaultValue.Copy(iParams->contentType); |
|
74 contentType->SetTextL(&defaultValue); |
|
75 contentType->SetCursorPosL(defaultValue.Length(),EFalse); |
|
76 |
|
77 iParams->content.Copy(KNone); |
|
78 CEikEdwin* content = static_cast<CEikEdwin*>( |
|
79 Control( EEstablishContent ) ); |
|
80 defaultValue.Copy(iParams->content); |
|
81 content->SetTextL(&defaultValue); |
|
82 content->SetCursorPosL(defaultValue.Length(),EFalse); |
|
83 |
|
84 iParams->contentHeaders.Copy(KNone); |
|
85 CEikEdwin* contentHeaders = static_cast<CEikEdwin*>( |
|
86 Control( EEstablishContentHeaders ) ); |
|
87 defaultValue.Copy(iParams->contentHeaders); |
|
88 contentHeaders->SetTextL(&defaultValue); |
|
89 contentHeaders->SetCursorPosL(defaultValue.Length(),EFalse); |
|
90 */ |
|
91 |
|
92 CAknForm::PreLayoutDynInitL(); |
|
93 } |
|
94 |
|
95 // ---------------------------------------------------------------------------- |
|
96 // CCreateSessionDialog::OkToExitL( TInt ) |
|
97 // . |
|
98 // ---------------------------------------------------------------------------- |
|
99 // |
|
100 |
|
101 TBool CSessionEstablishValuesDialog::OkToExitL( TInt aKey ) |
|
102 { |
|
103 if ( aKey == EEikCmdCanceled ) |
|
104 { |
|
105 // Cancel pressed. Just exit. |
|
106 return ETrue; |
|
107 } |
|
108 CEikNumberEditor* timeOut = static_cast<CEikNumberEditor*>( |
|
109 Control( ESessionTimeOut ) ); |
|
110 iParams->timeOut = timeOut->Number(); |
|
111 |
|
112 CEikNumberEditor* serviceType = static_cast<CEikNumberEditor*>( |
|
113 Control( ESessionServiceType ) ); |
|
114 iParams->iServiceType = serviceType->Number(); |
|
115 |
|
116 TBuf<KBufLength> buffer; |
|
117 |
|
118 CEikEdwin* headers = static_cast<CEikEdwin*>( |
|
119 Control( ESessionHeaders ) ); |
|
120 headers->GetText(buffer); |
|
121 iParams->headers = buffer; |
|
122 |
|
123 |
|
124 |
|
125 /* |
|
126 CEikEdwin* contentType = static_cast<CEikEdwin*>( |
|
127 Control( EEstablishContentType ) ); |
|
128 contentType->GetText(buffer); |
|
129 iParams->contentType = buffer; |
|
130 |
|
131 CEikEdwin* content = static_cast<CEikEdwin*>( |
|
132 Control( EEstablishContent ) ); |
|
133 content->GetText(buffer); |
|
134 iParams->content = buffer; |
|
135 |
|
136 CEikEdwin* contentHeaders = static_cast<CEikEdwin*>( |
|
137 Control( EEstablishContentHeaders ) ); |
|
138 contentHeaders->GetText(buffer); |
|
139 iParams->contentHeaders = buffer; |
|
140 |
|
141 */ |
|
142 |
|
143 return ETrue; |
|
144 } |
|
145 |
|
146 // ---------------------------------------------------------------------------- |
|
147 // CSessionEstablishValuesDialog::~CCreatePoCSessionDialog() |
|
148 // . |
|
149 // ---------------------------------------------------------------------------- |
|
150 // |
|
151 CSessionEstablishValuesDialog::~CSessionEstablishValuesDialog() |
|
152 { |
|
153 return; |
|
154 } |
|
155 // ---------------------------------------------------------------------------- |
|
156 // CSessionResponseValuesDialog::CSessionResponseValuesDialog( CRtpEngine::TSessionType* ) |
|
157 // . |
|
158 // ---------------------------------------------------------------------------- |
|
159 // |
|
160 CSessionResponseValuesDialog::CSessionResponseValuesDialog( TSessionResponseValues* aParams ) : |
|
161 iParams( aParams ) |
|
162 { |
|
163 // No implementation required |
|
164 } |
|
165 |
|
166 // ---------------------------------------------------------------------------- |
|
167 // CSessionResponseValuesDialog::PreLayoutDynInitL() |
|
168 // . |
|
169 // ---------------------------------------------------------------------------- |
|
170 // |
|
171 void CSessionResponseValuesDialog::PreLayoutDynInitL() |
|
172 { |
|
173 |
|
174 CAknForm::PreLayoutDynInitL(); |
|
175 CEikNumberEditor* responsecode = static_cast<CEikNumberEditor*>( |
|
176 Control( ESessionResponseCode ) ); |
|
177 TInt num = 182; |
|
178 responsecode->SetNumber(num); |
|
179 TBuf<KBufLength> defaultValue; |
|
180 |
|
181 iParams->reason.Copy(KDefaultAcceptContactValue); |
|
182 CEikEdwin* responsereason = static_cast<CEikEdwin*>( |
|
183 Control( ESessionResponseReason ) ); |
|
184 defaultValue.Copy(iParams->reason); |
|
185 responsereason->SetTextL(&defaultValue); |
|
186 responsereason->SetCursorPosL(defaultValue.Length(),EFalse); |
|
187 |
|
188 } |
|
189 |
|
190 // ---------------------------------------------------------------------------- |
|
191 // CSessionResponseValuesDialog::OkToExitL( TInt ) |
|
192 // . |
|
193 // ---------------------------------------------------------------------------- |
|
194 // |
|
195 TBool CSessionResponseValuesDialog::OkToExitL( TInt aKey ) |
|
196 { |
|
197 if ( aKey == EEikCmdCanceled ) |
|
198 { |
|
199 // Cancel pressed. Just exit. |
|
200 return ETrue; |
|
201 } |
|
202 CEikNumberEditor* responsecode = static_cast<CEikNumberEditor*>( |
|
203 Control( ESessionResponseCode ) ); |
|
204 iParams->code = responsecode->Number(); |
|
205 |
|
206 TBuf<KBufLength> buffer; |
|
207 |
|
208 CEikEdwin* responsereason = static_cast<CEikEdwin*>( |
|
209 Control( ESessionResponseReason ) ); |
|
210 responsereason->GetText(buffer); |
|
211 iParams->reason = buffer; |
|
212 |
|
213 return ETrue; |
|
214 } |
|
215 |
|
216 // ---------------------------------------------------------------------------- |
|
217 // CSessionResponseValuesDialog::~CSessionResponseValuesDialog() |
|
218 // . |
|
219 // ---------------------------------------------------------------------------- |
|
220 // |
|
221 CSessionResponseValuesDialog::~CSessionResponseValuesDialog() |
|
222 { |
|
223 return; |
|
224 } |
|
225 |
|
226 // End of File |