|
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 * Shut down Goto URL editor. |
|
77 * @since Series 60 1.2 |
|
78 */ |
|
79 void ShutDownGotoURLEditorL(); |
|
80 |
|
81 /** |
|
82 * Shut down Findkeyword pane. |
|
83 * @since Series 60 3.0 |
|
84 */ |
|
85 void ShutDownFindKeywordEditorL(); |
|
86 |
|
87 |
|
88 private: |
|
89 |
|
90 /** |
|
91 * C++ default constructor. |
|
92 */ |
|
93 CBrowserContentViewContainer( CBrowserContentView* aView, |
|
94 MApiProvider& aApiProvider ); |
|
95 |
|
96 /** |
|
97 * Symbian 2nd phase constructor. |
|
98 */ |
|
99 void ConstructL(); |
|
100 |
|
101 |
|
102 private: // From CCoeControl |
|
103 |
|
104 /* |
|
105 * Handle pointer events |
|
106 */ |
|
107 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
108 |
|
109 /** |
|
110 * Handle key events. |
|
111 */ |
|
112 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
113 |
|
114 /** |
|
115 * Responds to focus changed. |
|
116 */ |
|
117 void FocusChanged(TDrawNow aDrawNow); |
|
118 |
|
119 /** |
|
120 * Responds to size changes. |
|
121 */ |
|
122 void SizeChanged(); |
|
123 |
|
124 /** |
|
125 * Gets the number of controls contained in a compound control. |
|
126 */ |
|
127 TInt CountComponentControls() const; |
|
128 |
|
129 /** |
|
130 * Gets the specified component of a compound control. |
|
131 */ |
|
132 CCoeControl* ComponentControl(TInt aIndex) const; |
|
133 |
|
134 public: // for dynamic layout switch updating from contentview |
|
135 |
|
136 void HandleResourceChange( TInt aType ); |
|
137 |
|
138 private: // New functions |
|
139 |
|
140 #ifdef __SERIES60_HELP |
|
141 |
|
142 /** |
|
143 * Get help context for the control. |
|
144 * @param aContext The context that is filled in. |
|
145 * @return None. |
|
146 */ |
|
147 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
148 |
|
149 #endif // __SERIES60_HELP |
|
150 |
|
151 |
|
152 /** |
|
153 * For Configurable short cut keys: create HashTable to map key to function |
|
154 */ |
|
155 void CreateShortCutFuncsHashTable(); |
|
156 |
|
157 /** |
|
158 * For Configurable short cut keys: insert key/value pair |
|
159 */ |
|
160 void InsertFuncToHashTable(HBufC* aKeyStr, TInt aFunc); |
|
161 |
|
162 /** |
|
163 * For Configurable short cut keys: convert string to TUint |
|
164 */ |
|
165 TUint MyAtoi(TPtrC aData); |
|
166 |
|
167 /** |
|
168 * For Configurable short cut keys: invoke short cut function for key pressed |
|
169 */ |
|
170 TKeyResponse InvokeFunction(TUint aCode); |
|
171 |
|
172 |
|
173 private: |
|
174 CBrowserGotoPane* iFindKeywordPane; |
|
175 CBrowserContentView* iView; |
|
176 MApiProvider& iApiProvider; |
|
177 CBrowserGotoPane* iGotoPane; |
|
178 |
|
179 TBool iSelectionKeyPressed; |
|
180 |
|
181 // True if the key was pressed long, otherwise key was pressed short. |
|
182 TBool iIsKeyLongPressed; |
|
183 // True if the key was pressed, and the key was not consumed by the engine. |
|
184 TBool iIsShortPressAllowed; |
|
185 |
|
186 |
|
187 // For shout cut functions |
|
188 // True if the hash table for short cut functions has been created; False otherwise. |
|
189 TBool iShortCutFuncsReady; |
|
190 |
|
191 // maps iCode to shortcut function |
|
192 typedef RHashMap<TUint, TInt> RShortCutFuncMap; |
|
193 RShortCutFuncMap iShortCutFuncMap; |
|
194 |
|
195 |
|
196 }; |
|
197 |
|
198 #endif |
|
199 |
|
200 // End of File |