|
1 /* |
|
2 * Copyright (c) 2002-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 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: |
|
15 * Browser content view container |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __BROWSERCONTENTVIEWCONTAINER_H |
|
22 #define __BROWSERCONTENTVIEWCONTAINER_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <coecntrl.h> |
|
27 #include "Browser.hrh" |
|
28 #include <bldvariant.hrh> |
|
29 |
|
30 #include <e32hashtab.h> |
|
31 |
|
32 |
|
33 // CONSTANTS |
|
34 |
|
35 // DATA TYPES |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 |
|
39 class CBrowserGotoPane; |
|
40 class CBrowserGotoPane; |
|
41 class MApiProvider; |
|
42 class CBrowserContentView; |
|
43 |
|
44 /** |
|
45 * Container for Browser content view. |
|
46 * |
|
47 * @lib Browser.app |
|
48 * @since Series 60 1.2 |
|
49 */ |
|
50 class CBrowserContentViewContainer : public CCoeControl |
|
51 { |
|
52 public: // Constuctors and destructor |
|
53 |
|
54 static CBrowserContentViewContainer* NewL( CBrowserContentView* aView, |
|
55 MApiProvider& aApiProvider ); |
|
56 |
|
57 ~CBrowserContentViewContainer(); |
|
58 |
|
59 public: // New functions |
|
60 |
|
61 /** |
|
62 * Get pointer to Goto pane. |
|
63 * @since Series 60 1.2 |
|
64 * @return Pointer to CBrowserGotoPane |
|
65 */ |
|
66 CBrowserGotoPane* GotoPane() { return iGotoPane; } ; |
|
67 |
|
68 /** |
|
69 * Get pointer to Findkeyword pane. |
|
70 * @since Series 60 3.0 |
|
71 * @return Pointer to CBrowserGotoPane |
|
72 */ |
|
73 CBrowserGotoPane* FindKeywordPane() { return iFindKeywordPane; } ; |
|
74 |
|
75 /* |
|
76 * set the iGotoPane |
|
77 */ |
|
78 void SetGotoPane(CBrowserGotoPane* aGotoPane) { iGotoPane = aGotoPane; }; |
|
79 |
|
80 /* |
|
81 * set the iFindKeywordPane |
|
82 */ |
|
83 void SetFindKeywordPane(CBrowserGotoPane* aFindKeywordPane) { iFindKeywordPane = aFindKeywordPane; }; |
|
84 |
|
85 /** |
|
86 * Shut down Goto URL editor. |
|
87 * @since Series 60 1.2 |
|
88 */ |
|
89 void ShutDownGotoURLEditorL(); |
|
90 |
|
91 /** |
|
92 * Shut down Findkeyword pane. |
|
93 * @since Series 60 3.0 |
|
94 */ |
|
95 void ShutDownFindKeywordEditorL(); |
|
96 |
|
97 |
|
98 private: |
|
99 |
|
100 /** |
|
101 * C++ default constructor. |
|
102 */ |
|
103 CBrowserContentViewContainer( CBrowserContentView* aView, |
|
104 MApiProvider& aApiProvider ); |
|
105 |
|
106 /** |
|
107 * Symbian 2nd phase constructor. |
|
108 */ |
|
109 void ConstructL(); |
|
110 |
|
111 |
|
112 private: // From CCoeControl |
|
113 |
|
114 /* |
|
115 * Handle pointer events |
|
116 */ |
|
117 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
118 |
|
119 /** |
|
120 * Handle key events. |
|
121 */ |
|
122 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
123 |
|
124 /** |
|
125 * Responds to focus changed. |
|
126 */ |
|
127 void FocusChanged(TDrawNow aDrawNow); |
|
128 |
|
129 /** |
|
130 * Responds to size changes. |
|
131 */ |
|
132 void SizeChanged(); |
|
133 |
|
134 /** |
|
135 * Gets the number of controls contained in a compound control. |
|
136 */ |
|
137 TInt CountComponentControls() const; |
|
138 |
|
139 /** |
|
140 * Gets the specified component of a compound control. |
|
141 */ |
|
142 CCoeControl* ComponentControl(TInt aIndex) const; |
|
143 |
|
144 public: // for dynamic layout switch updating from contentview |
|
145 |
|
146 void HandleResourceChange( TInt aType ); |
|
147 |
|
148 private: // New functions |
|
149 |
|
150 #ifdef __SERIES60_HELP |
|
151 |
|
152 /** |
|
153 * Get help context for the control. |
|
154 * @param aContext The context that is filled in. |
|
155 * @return None. |
|
156 */ |
|
157 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
158 |
|
159 #endif // __SERIES60_HELP |
|
160 |
|
161 |
|
162 /** |
|
163 * For Configurable short cut keys: create HashTable to map key to function |
|
164 */ |
|
165 void CreateShortCutFuncsHashTable(); |
|
166 |
|
167 /** |
|
168 * For Configurable short cut keys: insert key/value pair |
|
169 */ |
|
170 void InsertFuncToHashTable(HBufC* aKeyStr, TInt aFunc); |
|
171 |
|
172 /** |
|
173 * For Configurable short cut keys: convert string to TUint |
|
174 */ |
|
175 TUint MyAtoi(TPtrC aData); |
|
176 |
|
177 /** |
|
178 * For Configurable short cut keys: invoke short cut function for key pressed |
|
179 */ |
|
180 TKeyResponse InvokeFunction(TUint aCode); |
|
181 |
|
182 |
|
183 private: |
|
184 CBrowserGotoPane* iFindKeywordPane; |
|
185 CBrowserContentView* iView; |
|
186 MApiProvider& iApiProvider; |
|
187 CBrowserGotoPane* iGotoPane; |
|
188 |
|
189 TBool iSelectionKeyPressed; |
|
190 |
|
191 // True if the key was pressed long, otherwise key was pressed short. |
|
192 TBool iIsKeyLongPressed; |
|
193 // True if the key was pressed, and the key was not consumed by the engine. |
|
194 TBool iIsShortPressAllowed; |
|
195 |
|
196 |
|
197 // For shout cut functions |
|
198 // True if the hash table for short cut functions has been created; False otherwise. |
|
199 TBool iShortCutFuncsReady; |
|
200 |
|
201 // maps iCode to shortcut function |
|
202 typedef RHashMap<TUint, TInt> RShortCutFuncMap; |
|
203 RShortCutFuncMap iShortCutFuncMap; |
|
204 |
|
205 |
|
206 }; |
|
207 |
|
208 #endif |
|
209 |
|
210 // End of File |