|
1 /* |
|
2 * Copyright (c) 2006 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: test case |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <eikdialg.h> |
|
20 #include <eikenv.h> |
|
21 #include <e32std.h> |
|
22 #include <coedef.h> |
|
23 #include <eikmfne.h> |
|
24 #include <Aknedsts.h> |
|
25 #include <aknipfed.h> |
|
26 #include <aknnumed.h> |
|
27 #include <aknnumedwin.h> |
|
28 #include <eikccpu.h> |
|
29 #include <eikedwin.h> |
|
30 #include <eikfpne.h> |
|
31 #include <eikrted.h> |
|
32 #include <aknnumseced.h> |
|
33 #include <eikseced.h> |
|
34 #include <eikdgfty.h> |
|
35 |
|
36 #include "bctestcase.h" |
|
37 |
|
38 |
|
39 class CTestNumericEdwin : public CAknNumericEdwin |
|
40 { |
|
41 public: |
|
42 void TestFunction(); |
|
43 }; |
|
44 |
|
45 class CBCTestEditorContainer; |
|
46 class CCoeControl; |
|
47 class TAknEditorCaseState; |
|
48 class CAknEdwinState; |
|
49 class CAknIpFieldEditor; |
|
50 class CAknIntegerEdwin; |
|
51 class CAknCcpuSupport; |
|
52 class CEikMenuPane; |
|
53 class CEikEdwin; |
|
54 class CEikFixedPointEditor; |
|
55 class CEikFloatingPointEditor; |
|
56 class CEikRichTextEditor; |
|
57 class CBCTestSecretEditor; |
|
58 |
|
59 /** |
|
60 * test case for various list classes |
|
61 */ |
|
62 class CBCTestEditorCase: public CBCTestCase |
|
63 { |
|
64 public: // constructor and destructor |
|
65 |
|
66 /** |
|
67 * Symbian 2nd static constructor |
|
68 */ |
|
69 static CBCTestEditorCase* NewL( CBCTestEditorContainer* aContainer ); |
|
70 |
|
71 /** |
|
72 * Destructor |
|
73 */ |
|
74 virtual ~CBCTestEditorCase(); |
|
75 |
|
76 public: // from CBCTestCase |
|
77 |
|
78 /** |
|
79 * Execute corresponding test functions for UI command |
|
80 * @param aCmd, UI command |
|
81 */ |
|
82 void RunL( TInt aCmd ); |
|
83 |
|
84 protected: // new functions |
|
85 |
|
86 /** |
|
87 * Build autotest script |
|
88 */ |
|
89 void BuildScriptL(); |
|
90 |
|
91 /** |
|
92 * Create control or allocate resource for test |
|
93 * @param aCmd UI command, maybe you need to do some work |
|
94 * for different outline |
|
95 */ |
|
96 void PrepareCaseL( TInt aCmd ); |
|
97 |
|
98 /** |
|
99 * Release resource used in test |
|
100 */ |
|
101 void ReleaseCaseL(); |
|
102 |
|
103 /** |
|
104 * Test functions |
|
105 */ |
|
106 void TestEdwinStateL(); |
|
107 void TestIpFieldEditorL(); |
|
108 void TestNumericEdwinL(); |
|
109 void TestCcpuSupportL(); |
|
110 void TestEikEdwinL(); |
|
111 void TestEikFixedPointEditorL(); |
|
112 void TestEikFloatingPointEditorL(); |
|
113 void TestEikRichTextEditorL(); |
|
114 void TestEikMfneSubClassL(); |
|
115 void TestEikTimeEditorL(); |
|
116 void TestEikSecretEditorL(); |
|
117 void TestEikMfneFieldL(); |
|
118 void TestEikGlobalEditorL(); |
|
119 void TestEikLafMainL(); |
|
120 void TestEikMfneL(); |
|
121 void TestSecEditorL(); |
|
122 |
|
123 private: // constructor |
|
124 |
|
125 /** |
|
126 * C++ default constructor |
|
127 */ |
|
128 CBCTestEditorCase( CBCTestEditorContainer* aContainer ); |
|
129 |
|
130 /** |
|
131 * Symbian 2nd constructor |
|
132 */ |
|
133 void ConstructL(); |
|
134 |
|
135 private: // data |
|
136 |
|
137 /** |
|
138 * Pointer to a control, maybe you need one in your test |
|
139 * own |
|
140 */ |
|
141 CCoeControl* iControl; |
|
142 CAknEdwinState* iAknEdwinState; |
|
143 CAknIpFieldEditor* iAknIpFieldEditor; |
|
144 CTestNumericEdwin* iAknNumericEdwin; |
|
145 CAknIntegerEdwin* iAknIntegerEdwin; |
|
146 CAknCcpuSupport* iAknCcpuSupport; |
|
147 CEikMenuPane * iPane; |
|
148 CEikEdwin* iEikEdwin; |
|
149 CEikFixedPointEditor* iEikFixedPointEditor; |
|
150 CEikFloatingPointEditor* iEikFloatingPointEditor; |
|
151 CEikRichTextEditor* iEikRichTextEditor; |
|
152 CEikDurationEditor* iEikDurationEditor; |
|
153 CEikNumberEditor* iEikNumberEditor; |
|
154 CEikRangeEditor* iEikRangeEditor; |
|
155 CEikTimeOffsetEditor* iEikTimeOffsetEditor; |
|
156 CEikTimeAndDateEditor* iEikTimeAndDateEditor; |
|
157 CEikTimeEditor* iEikTimeEditor; |
|
158 CEikDateEditor* iEikDateEditor; |
|
159 CBCTestSecretEditor* iEikSecretEditor; |
|
160 CEikGlobalTextEditor* iEikGlobalTextEditor; |
|
161 CEikMfne* iEikMfne; |
|
162 |
|
163 |
|
164 //MCoeFepAwareTextEditor |
|
165 CEikonEnv* iEikEnv; |
|
166 /** |
|
167 * Pointer to container. |
|
168 * not own |
|
169 */ |
|
170 CBCTestEditorContainer* iContainer; |
|
171 friend class MCoeFepAwareTextEditor_Extension1; |
|
172 |
|
173 }; |
|
174 |
|
175 class CBCTestSecretEditor: public CEikSecretEditor |
|
176 { |
|
177 friend class CBCTestEditorCase; |
|
178 |
|
179 public: |
|
180 |
|
181 void StartFepInlineEditL(TBool& aSetToTrue, const TCursorSelection& aCursorSelection, |
|
182 const TDesC& aInitialInlineText, |
|
183 TInt aPositionOfInsertionPointInInlineText, |
|
184 TBool aCursorVisibility, |
|
185 const MFormCustomDraw* aCustomDraw, |
|
186 MFepInlineTextFormatRetriever& aInlineTextFormatRetriever, |
|
187 MFepPointerEventHandlerDuringInlineEdit& aPointerEventHandlerDuringInlineEdit); |
|
188 MCoeFepLayDocExtension* GetFepLayDocExtension(TBool& aSetToTrue); |
|
189 void SetCursorType(TBool& aSetToTrue, const TTextCursor& aTextCursor); |
|
190 |
|
191 }; |
|
192 |
|
193 class CMClassTmp : public CBase,public MEikRichTextEditorParserObserver |
|
194 { |
|
195 void HandleCursorOverParserL( const TDesC& ); |
|
196 }; |
|
197 |
|
198 class CMObserverClassTmp : public CBase, public MAknEdStateObserver |
|
199 { |
|
200 void HandleAknEdwinStateEventL( CAknEdwinState* aAknEdwinState, |
|
201 EAknEdwinStateEvent aEventType ); |
|
202 }; |
|
203 |
|
204 class CSubEikEdwin : public CEikEdwin |
|
205 { |
|
206 public: |
|
207 void TestFunctionL(); |
|
208 }; |
|
209 |
|
210 class CSubEikRichTextEditor : public CEikRichTextEditor |
|
211 { |
|
212 public: |
|
213 void TestWriteInternalStateL( RWriteStream& aWriteStream ); |
|
214 }; |
|
215 |
|
216 class CSubEikMfne : public CEikMfne |
|
217 { |
|
218 public: |
|
219 void TestFunction(); |
|
220 }; |
|
221 |
|
222 class MEikFindAndReplaceDlgObserver; |
|
223 class CGraphicsDevice; |
|
224 |
|
225 class CTmpCDlgDialogFactory : public CBase, public MEikCDlgDialogFactory |
|
226 { |
|
227 public: |
|
228 static CTmpCDlgDialogFactory* NewL(); |
|
229 private: |
|
230 CTmpCDlgDialogFactory(); |
|
231 TBool RunCharMapDlgLD(CCoeControl* aControl); |
|
232 TBool RunFontDlgLD( TCharFormat& aFormat, |
|
233 TCharFormatMask& aAttribChangedMask, |
|
234 TCharFormatMask& aUndeterminedMask, |
|
235 TDesC& aTextSelection, |
|
236 TInt aFonts, |
|
237 CGraphicsDevice* aGraphicsDevice, |
|
238 TInt aFontControlFalgs, |
|
239 const TRgb aBackGroundColor); |
|
240 |
|
241 TBool RunInsertObjectDlgLD( CEikEmbeddableAppList* aList, |
|
242 TInt& aChoice); |
|
243 |
|
244 TBool RunObjectInfoDlgLD(const TDesC& aCaption); |
|
245 TBool RunFormatObjectDlgLD( CApaDoor& aDoor, |
|
246 CApaDocument& aDoc, |
|
247 const TSize& aDefaultIconSize); |
|
248 |
|
249 void RunEdwinFindAndReplaceDlgLD(MEikFindAndReplaceDlgObserver& aObserver, |
|
250 SEdwinFindModel& aModel, TBool aFindOnly, TRect aEdwinRect); |
|
251 |
|
252 TBool RunEdwinFindDlgLD( SEdwinFindModel* aModel, |
|
253 CDesCArray* aFindList); |
|
254 |
|
255 TBool RunEdwinReplaceDlgLD( SEdwinFindModel* aModel, |
|
256 CDesCArray* aFindList, |
|
257 CDesCArray* aReplaceList); |
|
258 |
|
259 TBool RunEdwinReplaceOptionDlgLD( CEikGlobalTextEditor* aEdwin, |
|
260 SEdwinFindModel* aModel); |
|
261 |
|
262 TBool RunAlignDlgLD( |
|
263 CParaFormat* aFormat, |
|
264 TParaFormatMask& aAttribChangedMask, |
|
265 TParaFormatMask& aUndeterminedMask); |
|
266 |
|
267 TBool RunBorderDlgLD( |
|
268 CParaFormat* aFormat, |
|
269 TParaFormatMask& aAttribChangedMask, |
|
270 TParaFormatMask& aUndeterminedMask); |
|
271 |
|
272 TBool RunSpaceDlgLD( |
|
273 CParaFormat* aFormat, |
|
274 TParaFormatMask& aAttribChangedMask, |
|
275 TParaFormatMask& aUndeterminedMask); |
|
276 |
|
277 TBool RunTabsDlgLD( CParaFormat* aFormat, |
|
278 TParaFormatMask& aAttribChangedMask, |
|
279 TParaFormatMask& aUndeterminedMask, |
|
280 const TInt aPageWidth); |
|
281 |
|
282 TBool RunIndentDlgLD( CParaFormat* aFormat, |
|
283 TParaFormatMask& aAttribChangedMask, |
|
284 TParaFormatMask& aUndeterminedMask, |
|
285 const TInt aPageWidth); |
|
286 }; |
|
287 |
|
288 class CPrintSetup; |
|
289 class CTmpPrintDialogFactory : public CBase, public MEikPrintDialogFactory |
|
290 { |
|
291 public: |
|
292 TBool RunPaginateDlgLD( CEikGlobalTextEditor* aEditor, |
|
293 CPrintSetup* aPrintSetup, |
|
294 CArrayFix<TInt>* aCharsPerPage); |
|
295 |
|
296 CPrintSetup* NewDefaultPrintSetupL(); |
|
297 |
|
298 }; |