65
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2007 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 |
* Declaration of class CBrowserBookmarksContainer.
|
|
16 |
*
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef BROWSER_BOOKMARKS_CONTAINER_H
|
|
22 |
#define BROWSER_BOOKMARKS_CONTAINER_H
|
|
23 |
|
|
24 |
// INCLUDE FILES
|
|
25 |
|
|
26 |
#include "BrowserFavouritesContainer.h"
|
|
27 |
#include <bldvariant.hrh>
|
|
28 |
|
|
29 |
// FORWARD DECLARATION
|
|
30 |
|
|
31 |
class CBrowserBookmarksGotoPane;
|
|
32 |
|
|
33 |
// CLASS DECLARATION
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Top-level control, which contains all component controls in the bookmarks view.
|
|
37 |
*/
|
|
38 |
class CBrowserBookmarksContainer : public CBrowserFavouritesContainer
|
|
39 |
{
|
|
40 |
public : // construction, destruction
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Two-phased constructor. Leaves on failure.
|
|
44 |
* @param aRect Rectangle of the control (available client rect).
|
|
45 |
* @param aView The view to which this container belongs.
|
|
46 |
* @return The constructed container.
|
|
47 |
*/
|
|
48 |
static CBrowserBookmarksContainer* NewL(
|
|
49 |
const TRect& aRect,
|
|
50 |
CBrowserFavouritesView& aView);
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Destructor.
|
|
54 |
*/
|
|
55 |
virtual ~CBrowserBookmarksContainer();
|
|
56 |
|
|
57 |
public: // new methods
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Activate Goto Mode
|
|
61 |
*/
|
|
62 |
|
|
63 |
void SetGotoActiveL();
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Activate Search Pane
|
|
67 |
*/
|
|
68 |
void SetSearchActiveL();
|
|
69 |
/**
|
|
70 |
* Deactivate Goto Pane
|
|
71 |
*/
|
|
72 |
|
|
73 |
void SetGotoInactiveL();
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Deactivate Search Pane
|
|
77 |
*/
|
|
78 |
void SetSearchInactiveL();
|
|
79 |
public: // access to components
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Get the Goto Pane.
|
|
83 |
* @return The Goto Pane.
|
|
84 |
*/
|
|
85 |
inline CBrowserBookmarksGotoPane* GotoPane() const;
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Get the Search Pane.
|
|
89 |
* @return The Search Pane.
|
|
90 |
*/
|
|
91 |
inline CBrowserBookmarksGotoPane* SearchPane() const;
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Check if we are in Goto Mode
|
|
95 |
* @return ETrue if we are in Goto Mode; EFalse otherwise.
|
|
96 |
*/
|
|
97 |
inline TBool GotoPaneActive() const;
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Check if we are in Search Mode
|
|
101 |
* @return ETrue if we are in Search Mode; EFalse otherwise.
|
|
102 |
*/
|
|
103 |
inline TBool SearchPaneActive() const;
|
|
104 |
|
|
105 |
public: // from CBrowserFavouritesContainer
|
|
106 |
|
|
107 |
/**
|
|
108 |
* Count component controls.
|
|
109 |
* @return Number of component controls.
|
|
110 |
*/
|
|
111 |
virtual TInt CountComponentControls() const;
|
|
112 |
|
|
113 |
/**
|
|
114 |
* Get a component control by index.
|
|
115 |
* @param aIndex Index of component control to be returned.
|
|
116 |
* @return Component control or NULL.
|
|
117 |
*/
|
|
118 |
virtual CCoeControl* ComponentControl( TInt aIndex ) const;
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Handle size change, lay out and draw components.
|
|
122 |
*/
|
|
123 |
virtual void SizeChanged();
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Handle key event.
|
|
127 |
* @param aKeyEvent The key event.
|
|
128 |
* @param aType Key event type.
|
|
129 |
* @return Response (was the key event consumed?).
|
|
130 |
*/
|
|
131 |
virtual TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Handle cursor change.
|
|
135 |
* @param aListBox Listbox in which the cursor has changed.
|
|
136 |
*/
|
|
137 |
void HandleCursorChangedL( CEikListBox* aListBox );
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Check if some editing is in progress.
|
|
141 |
*/
|
|
142 |
TBool IsEditing();
|
|
143 |
|
|
144 |
/**
|
|
145 |
* Check if some editing is in progress for Search Pane.
|
|
146 |
*/
|
|
147 |
TBool IsEditingSearch();
|
|
148 |
|
|
149 |
/**
|
|
150 |
* Get tab index belonging to this view.
|
|
151 |
* @return The tab index.
|
|
152 |
*/
|
|
153 |
TInt TabIndex();
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Get resource id for text to be displayed in the empty listbox.
|
|
157 |
* @return Listbox empty text resource id.
|
|
158 |
*/
|
|
159 |
TInt ListboxEmptyTextResourceId();
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Get resource id for text to be displayed in the title.
|
|
163 |
* @return Listbox empty text resource id.
|
|
164 |
*/
|
|
165 |
TInt TitleResourceId();
|
|
166 |
|
|
167 |
/**
|
|
168 |
* Handles focus changing
|
|
169 |
* @param aDrawNow
|
|
170 |
*/
|
|
171 |
void FocusChanged( TDrawNow aDrawNow );
|
|
172 |
|
|
173 |
|
|
174 |
/**
|
|
175 |
* HandlePointerEventL
|
|
176 |
* From CCoeControl
|
|
177 |
*
|
|
178 |
*/
|
|
179 |
void HandlePointerEventL(const TPointerEvent& /*aPointerEvent*/);
|
|
180 |
|
|
181 |
/**
|
|
182 |
* HandleResourceChange
|
|
183 |
* From CCoeControl
|
|
184 |
*/
|
|
185 |
void HandleResourceChange(TInt aType);
|
|
186 |
|
|
187 |
protected: // Construct / destruct
|
|
188 |
|
|
189 |
/**
|
|
190 |
* Constructor.
|
|
191 |
*/
|
|
192 |
CBrowserBookmarksContainer();
|
|
193 |
|
|
194 |
/**
|
|
195 |
* Called by ConstructL. Leaves on failure.
|
|
196 |
* Derived classes can override this to add more controls.
|
|
197 |
* @param aRect Rectangle of the control (available client rect).
|
|
198 |
* @param aView The view to which this container belongs.
|
|
199 |
* @return The constructed container.
|
|
200 |
*/
|
|
201 |
virtual void ConstructComponentControlsL(
|
|
202 |
const TRect& aRect,
|
|
203 |
CBrowserFavouritesView& aView );
|
|
204 |
|
|
205 |
/**
|
|
206 |
* Called by ConstructComponentControlsL.
|
|
207 |
* Leaves on failure.
|
|
208 |
*/
|
|
209 |
virtual void ConstructSearchPaneL();
|
|
210 |
|
|
211 |
protected: // from CBrowserFavouritesContainer
|
|
212 |
|
|
213 |
/**
|
|
214 |
* Create icon handler for the listbox.
|
|
215 |
* @return Icon handler for the listbox.
|
|
216 |
*/
|
|
217 |
MBrowserFavouritesListboxIconHandler* CreateListboxIconHandlerL();
|
|
218 |
#ifdef __SERIES60_HELP
|
|
219 |
private:
|
|
220 |
/**
|
|
221 |
* Get help context for the control.
|
|
222 |
* @param aContext The context that is filled in.
|
|
223 |
* @return None.
|
|
224 |
*/
|
|
225 |
void GetHelpContext( TCoeHelpContext& aContext ) const;
|
|
226 |
|
|
227 |
#endif //__SERIES60_HELP
|
|
228 |
|
|
229 |
private: // data
|
|
230 |
|
|
231 |
/**
|
|
232 |
* Goto Pane.
|
|
233 |
*/
|
|
234 |
CBrowserBookmarksGotoPane* iGotoPane;
|
|
235 |
|
|
236 |
/**
|
|
237 |
* Owned.
|
|
238 |
* Search Pane.
|
|
239 |
*/
|
|
240 |
CBrowserBookmarksGotoPane* iSearchPane;
|
|
241 |
|
|
242 |
/**
|
|
243 |
* ETrue if Goto pane is active, EFalse by default
|
|
244 |
*/
|
|
245 |
TBool iGotoPaneActive;
|
|
246 |
|
|
247 |
/**
|
|
248 |
* ETrue if Search pane is active, EFalse by default
|
|
249 |
*/
|
|
250 |
TBool iSearchPaneActive;
|
|
251 |
|
|
252 |
TBool iSelectionKeyDownPressed;
|
|
253 |
TBool iSelectionKeyLongPress;
|
|
254 |
|
|
255 |
/**
|
|
256 |
* Default text in search editor
|
|
257 |
*/
|
|
258 |
HBufC* iDefaultSearchText;
|
|
259 |
|
|
260 |
/**
|
|
261 |
* Saves Search Provider Icon Id,
|
|
262 |
* used for tracking changes to Icon.
|
|
263 |
*/
|
|
264 |
TInt iSearchIconId;
|
|
265 |
|
|
266 |
/**
|
|
267 |
* Saves Search Icon File Path
|
|
268 |
* used for tracking changes to Icon.
|
|
269 |
*/
|
|
270 |
TFileName iSearchIconFilePath;
|
|
271 |
};
|
|
272 |
|
|
273 |
#include "BrowserBookmarksContainer.inl"
|
|
274 |
|
|
275 |
#endif
|
|
276 |
|
|
277 |
// End of file |