|
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 the License "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: CBrCtlApiTestContainer from BrCtlBCTestContainer.h |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef BRCTLBCTESTCONTAINER_H |
|
19 #define BRCTLBCTESTCONTAINER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <coecntrl.h> |
|
23 #include <BrCtlInterface.h> // interface under test |
|
24 |
|
25 #include "BrCtlApiTestObserver.h" |
|
26 #include "BrCtlApiTestStateChangeObserver.h" |
|
27 #include "BrCtlApiTestDialogsProvider.h" |
|
28 |
|
29 // CONSTATNS |
|
30 const TInt KThisAppUid = 0xA0000181; |
|
31 |
|
32 _LIT( KUrlLoadTestHtml, "c:\\BrCtlTest\\loadtest.html" ); |
|
33 _LIT( KUrlLoadTestHtml2, "file:///c:\\smoketest\\web\\loadtest2.html" ); |
|
34 _LIT( KUrlHistoryHandlerHtml1, "file:///c:\\BrCtlTest\\historytest1.html" ); |
|
35 _LIT( KUrlHistoryHandlerHtml2, "file:///c:\\BrCtlTest\\historytest2.html" ); |
|
36 _LIT( KUrlHistoryHandlerHtml3, "file:///c:\\BrCtlTest\\historytest3.html" ); |
|
37 _LIT( KUrlLoadTestWml1, "file:///c:\\BrCtlTest\\loadtest1.wml" ); |
|
38 _LIT( KUrlLoadTestWml2, "file:///c:\\BrCtlTest\\loadtest2.wml" ); |
|
39 _LIT( KUrlLoadTestWml3, "file:///c:\\BrCtlTest\\loadtest3.wml" ); |
|
40 |
|
41 enum TBrCtlFindResponseExpected |
|
42 { |
|
43 EFindNoMatchesExpected = 0, ///< Reserved for future use |
|
44 EFindMatchExpected, ///< Reserved for future use |
|
45 EFindMoreMatchesExpected ///< Reserved for future use |
|
46 }; |
|
47 |
|
48 |
|
49 |
|
50 // FORWARD DECLARATIONS |
|
51 //class CBrCtlInterface; |
|
52 |
|
53 // CLASS DECLARATION |
|
54 |
|
55 /** |
|
56 * CBrCtlApiTestContainer container control class. |
|
57 * |
|
58 */ |
|
59 class CBrCtlApiTestContainer : public CCoeControl, |
|
60 MCoeControlObserver, |
|
61 MBrCtlDataLoadSupplier, |
|
62 MBrCtlCommandObserver, |
|
63 MWidgetCallback // Added for WidgetExtension Test |
|
64 { |
|
65 public: // Constructors and destructor |
|
66 void ConstructL (const TRect& aRect ); |
|
67 ~CBrCtlApiTestContainer(); |
|
68 |
|
69 private: // Functions from base classes |
|
70 void HandleCommandL( TBrCtlDefs::TBrCtlClientCommands aCommand, const CArrayFix<TPtrC>& aAttributesNames, |
|
71 const CArrayFix<TPtrC>& aAttributeValues ); |
|
72 void SizeChanged(); |
|
73 TInt CountComponentControls() const; |
|
74 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
75 void Draw( const TRect& aRect ) const; |
|
76 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
77 |
|
78 /** |
|
79 * From MBrCtlDataLoadSupplier, Cancel an on-going load |
|
80 */ |
|
81 void CancelLoad(); |
|
82 |
|
83 // Functions from MWidgetCallback class |
|
84 TBool DialogMimeFileSelectLC(HBufC*& aSelectedFileName, |
|
85 const TDesC& aMimeType); |
|
86 |
|
87 /** |
|
88 * Called to show or hide softkeys |
|
89 * @since 3.1 |
|
90 * @param aVisible ETrue to show softkeys, EFalse when full screen is needed |
|
91 */ |
|
92 void SetSoftkeysVisible(TBool aVisible); |
|
93 |
|
94 /** |
|
95 * Called to change the display orientation to landscape |
|
96 * @since 3.1 |
|
97 */ |
|
98 void SetDisplayMode(TBrCtlDefs::TBrCtlOrientation aOrientation); |
|
99 |
|
100 //Reserved for future use |
|
101 TInt Reserved_1(TAny*& a0, TAny* a1, TAny* a2); |
|
102 TInt Reserved_2(TAny*& a0, TAny* a1, TAny* a2); |
|
103 TInt Reserved_3(TAny*& a0, TAny* a1, TAny* a2); |
|
104 TInt Reserved_4(TAny*& a0, TAny* a1, TAny* a2); |
|
105 TInt Reserved_5(TAny*& a0, TAny* a1, TAny* a2); |
|
106 TInt Reserved_6(TAny*& a0, TAny* a1, TAny* a2); |
|
107 TInt Reserved_7(TAny*& a0, TAny* a1, TAny* a2); |
|
108 TInt Reserved_8(TAny*& a0, TAny* a1, TAny* a2); |
|
109 TInt Reserved_9(TAny*& a0, TAny* a1, TAny* a2); |
|
110 TInt Reserved_10(TAny*& a0, TAny* a1, TAny* a2); |
|
111 |
|
112 |
|
113 |
|
114 public: // New functions |
|
115 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
116 TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
117 |
|
118 public: // Functions utility |
|
119 HBufC8* ReadFileLC( const TDesC& aFileName ); |
|
120 void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType ); |
|
121 void RunAllTestsL(); |
|
122 |
|
123 public: // Functions to test CBrCtlInterface |
|
124 void CreateBrowserControlInterfaceL(TInt aBrCtlConfig); //Change done to take a parameter |
|
125 TInt LoadPageL(); |
|
126 TInt HandleCommandL(TInt aCommand ); |
|
127 TInt LoadDataL(); |
|
128 TInt ClearCacheTest(); |
|
129 TBool IsUrlInCacheTest( TDesC16& aUrl ); |
|
130 TInt ClearItemInCacheTest(); |
|
131 TInt PageInfoLC( TBrCtlDefs::TBrCtlPageInfo aType ); |
|
132 TInt CertInfo(); |
|
133 TInt NavigationAvailableTest(); |
|
134 TInt GetBitmapData(); |
|
135 TInt SaveToFileL(); |
|
136 TInt OkToExit(); |
|
137 TInt FindKeyword( TPtrC aHtml , TPtrC aKeyword , TInt aMatch ); |
|
138 TInt FindKeywordAgain( TInt aMatch ); |
|
139 TInt SetFocus(); |
|
140 TInt OfferKeyEvent(); |
|
141 TInt BrCtlMinimumSize(); |
|
142 TInt BrCtlSubscribeToMenuItemsL(); |
|
143 TInt BrCtlContentSize(); |
|
144 TInt BrowserSettingL( TUint& aSetting ); |
|
145 TInt SetBrowserSettingL(); |
|
146 TInt FocusedImageL(); |
|
147 TInt AddCommandObserverL(); |
|
148 TInt RemoveCommandObserver(); |
|
149 TInt ImageCountL(); |
|
150 TInt BrCtlFocusedElementTypeL(); |
|
151 TInt BrCtlSetParam(); |
|
152 TInt LoadSavedPageL(); |
|
153 TInt SetSelfDownloadContentTypes(); |
|
154 TInt ZoomLevels(); |
|
155 TInt AddOptionMenuItems(); |
|
156 TInt BrCtlInitLoadDataL(); |
|
157 TInt HandleDownloadCommand(); |
|
158 TInt VersionInfoL(); |
|
159 TInt WmlOptionMenuItemsL(); |
|
160 TInt BrCtlPostL(); |
|
161 TInt CreateBrCtlInterfaceAndWidgetExtensionL(); // Added for WidgetExtension Test |
|
162 TInt HistoryLoad1L(); |
|
163 TInt HistoryLoad2L(); |
|
164 TInt HistoryLoad3L(); |
|
165 TInt WMLLoad1L(); |
|
166 TInt WMLLoad2L(); |
|
167 TInt WMLLoad3L(); |
|
168 |
|
169 private: //data |
|
170 CBrCtlInterface* iBrCtlInterface; |
|
171 TInt iCommandBase; |
|
172 CBrCtlApiTestObserver* iBrCtlApiTestObserver; |
|
173 CBrCtlApiTestStateChangeObserver* iBrCtlApiTestStateChangeObserver; |
|
174 CBrowserDialogsProviderProxy* iBrCtlDialogs; |
|
175 CEikMenuPane* iMenuPane; |
|
176 TBool iCancelInitDataLoad; |
|
177 |
|
178 // Added for Widget Extension Test |
|
179 MWidgetExtension* iWidgetExtension; |
|
180 }; |
|
181 |
|
182 #endif // BRCTLBCTESTCONTAINER_H |
|
183 |
|
184 // End of File |