Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #if !defined(__EIKCLB_H__)
27 class CColumnListBoxData;
31 * Draws the contents of list box items.
35 class CColumnListBoxItemDrawer : public CTextListItemDrawer
39 /* C++ default constructor.
44 IMPORT_C CColumnListBoxItemDrawer();
47 * C++ default constructor.
49 * Initialises the list box item drawer with the specified model,
52 * @param aTextListBoxModel The model whose items will be drawn.
53 * This provides the item text that is drawn using
55 * @param aFont The font in which the items will be drawn.
56 * @param aColumnData The column list box data. This comprises:
57 * the column widths, gaps, fonts, aligments and bitmaps.
60 IMPORT_C CColumnListBoxItemDrawer(MTextListBoxModel* aTextListBoxModel,
62 CColumnListBoxData* aColumnData);
67 IMPORT_C ~CColumnListBoxItemDrawer();
70 * Gets a pointer to the column list box data as set during construction.
71 * Does not transfer ownership.
73 * @return The column list box data.
75 IMPORT_C CColumnListBoxData* ColumnData() const;
81 * The structure holding given item properties.
83 * Used for storing information given through @c SetProperties() method.
85 struct SListProperties
87 /** Item identifier. */
88 TInt iItem; // must be first
90 /** Properties of the item. */
91 TListItemProperties iProperties;
95 * Clears all properties from the @c CColumnListBoxItemDrawer.
97 IMPORT_C void ClearAllPropertiesL();
101 * Set the property for an item with @c aItemIndex
103 * @param aItemIndex Item index
104 * @param aProperty The new property setting
105 * The SetProperties is convinience method for normal cases.
106 * NOTE that it does NOT work correctly if you can insert/delete
107 * items from the list -- You need to update all properties if
108 * any changes to the item text array happen! Often it is convinient
109 * to override the Properties() method. Further, use this only
110 * for small lists as it causes O(n) time if you need to set
113 IMPORT_C void SetPropertiesL(TInt aItemIndex,
114 TListItemProperties aProperty);
117 * Get properties for an item.
119 * @param aItemIndex Item's index for identifying.
120 * @return Wanted property set.
122 IMPORT_C virtual TListItemProperties Properties(TInt aItemIndex) const;
124 public: // from CTextListItemDrawer
127 * From @c CTextListItemDrawer.
131 * @param aItemIndex Index of the item to draw.
132 * @param aItemTextRect Area to draw into.
133 * @param aItemIsCurrent @c ETrue if the item is current.
134 * @param aViewIsEmphasized @c ETrue if the view is emphasised.
135 * @param aItemIsSelected @c ETrue if the item is selected.
137 IMPORT_C void DrawItemText(TInt aItemIndex,
138 const TRect& aItemTextRect,
139 TBool aItemIsCurrent,
140 TBool aViewIsEmphasized,
141 TBool aItemIsSelected) const;
142 // the next one is for avkon
147 IMPORT_C void DrawItemMark(TBool aItemIsSelected,
149 const TPoint& aMarkPos) const;
151 public: // from CListItemDrawer
154 * From @c CListItemDrawer.
156 * Gets the minimum cell size.
158 * @return The minimum size for a cell. This is
159 * TSize(0, 0) in @c CListItemDrawer.
161 IMPORT_C TSize MinimumCellSize() const;
164 * From @c CListItemDrawer.
166 * Gets the width of the specified item.
168 * @param aItemIndex The index of the item whose width is to be returned.
169 * @return The width of the item. This is 0 in @c CListItemDrawer
171 IMPORT_C TInt ItemWidthInPixels(TInt aItemIndex) const;
174 * From @c CListItemDrawer.
176 * Sets the item cell size.
178 * The cell size is the on-screen size of the entire item, including its
179 * text and its item mark.
181 * @param aSizeInPixels New size for the item cell.
183 IMPORT_C void SetItemCellSize(const TSize& aSizeInPixels);
186 * Get Item Cell Size.
188 * @return Cell size of an item.
190 TSize LafItemSize() { return iItemCellSize; }
192 private: // from CListItemDrawer
194 IMPORT_C TAny* Reserved_1();
196 private: // defining reserved method.
198 IMPORT_C void CColumnListBoxItemDrawer_Reserved();
203 * Draw the item background.
205 * Internal member, not intended for use.
207 * @param aRect Drawing area.
209 void DrawCurrentItemRect(const TRect& aRect) const;
212 * Array of properties.
214 CArrayFix<SListProperties>* iPropertyArray;
224 * Column list box control.
226 * This is a list box whose lines consist of cells that are grouped vertically
227 * into columns. The columns can be either textual or graphical, and column
228 * widths and fonts can be set explicitly through @c CColumnListBoxData.
230 * Starting from 3.0 listbox uses highlight animations. Starting and stopping
231 * animation is connected to focus events. To support highlight animations
232 * properly you have to make sure that the list has focus when it has 'visual
233 * focus'. Common issues:
234 * - In many cases list is in a container which sits on top of the control
235 * stack. The container receives all focus events and should hand them to the
237 * void CContainer::FocusChanged( TDrawNow aDrawNow )
241 * iListBox->SetFocus( IsFocused(), aDrawNow );
243 * - When switching components programmatically, e.g. from one list to another
244 * in the same view, make sure that you remove focus from the other
246 * - In more complex cases you may have to add a dummy interceptor control to
247 * the top of control stack to hand focus events to list.
248 * - Make sure you handle resource changes correctly. If resource handle chain
249 * is solid it should reach CCoeControl::HandleResourceChange, which informs
251 class CEikColumnListBox : public CEikTextListBox
255 * C++ default constructor.
257 IMPORT_C CEikColumnListBox();
260 * Second-phase construction from a resource.
262 * This function completes the construction of a column list box,
263 * initialising any members from the specified resource reader.
265 * @param aReader A resource file reader
267 IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
270 * By default Symbian 2nd phase constructor is private.
272 * This function completes the construction of a column list box.
274 * @param aParent Parent control for the column list box.
275 * @param aFlags Flags for the column list box.
277 IMPORT_C void ConstructL( const CCoeControl* aParent,TInt aFlags=0);
279 * Not supported in S60.
281 IMPORT_C void EditItemL(TInt aColumn, TInt aMaxLength);
285 * This member is internal and not intended for use.
287 IMPORT_C virtual void CreateItemDrawerL();
290 * Creates a new @c CTextListBoxModel
292 IMPORT_C virtual void CreateModelL();
297 * Gets the list box model.
299 * @return Pointer to the model used by this list box
301 IMPORT_C CTextListBoxModel* Model() const;
304 * Gets the object used by this list box to draw its items.
306 * @return A pointer to the list box drawer.
308 IMPORT_C CColumnListBoxItemDrawer* ItemDrawer() const;
311 * This method needs to be called to enable extended drawing features
312 * such as skinning, pictograph drawing and marquee text in the listbox
315 * Methods @c CEikFormattedCellListBox::ConstructL and
316 * @c CEikFormattedCellListBox::ConstructFromResourceL call this method.
317 * So, you only need to call this if your listbox implementation does not
318 * call either of those.
320 * This method can be safely called more than once.
321 * Item drawer must be created before calling this method, or a
326 IMPORT_C void EnableExtendedDrawingL();
329 * Helper function that setst icon sizes for visible list items
334 * Enables/disables list stretching. When a column list is stretched its
335 * layout is optimized to take advantage of the extra screen space.
336 * This is intented for devices with a large screen. This feature might be
337 * set as default by a product specific flag.
339 * Item drawer must be created before calling this method.
342 * @param aEnabled ETrue to enable list stretching.
344 IMPORT_C void EnableStretching( const TBool aEnabled );
345 public: // from CEikListBox
348 * From @c CEikListBox.
350 * Creates the list box view.
351 * The function is called by @ ConstructL() to create an instance of
352 * the appropriate list box view class for this list box. The returned
353 * instance is owned by this object, and does not have to have its
354 * second-phase constructor run. This function is called by
357 * @return Pointer to a newly constructed list box
358 * view for this object.
360 IMPORT_C CListBoxView* MakeViewClassInstanceL();
363 * From @c CEikListBox
365 * Handles focus changes.
367 * The function emphasises or de-emphasises the view as needed, and
368 * shows or hides the matcher cursor.
370 * @param aDrawNow If @c EDrawNow, a redraw is performed immediately
372 IMPORT_C void FocusChanged(TDrawNow aDrawNow);
374 public: // from CCoeControl
377 * From @c CCoeControl.
380 * @param aColorUseList The colour list
382 IMPORT_C void GetColorUseListL(
383 CArrayFix<TCoeColorUse>& aColorUseList) const;
386 * From @c CCoeControl.
388 * Handles a change to the control's resources.
390 * The types of resources handled are those which are shared across
391 * the environment, e.g. colours or fonts. For colour scheme changes,
392 * @c DrawDeferred() is called in order to redraw the control.
394 * If overriding @c HandleResourceChange(), the implementation must
395 * include a base call to @c CCoeControl's @c HandleResourceChange().
397 * @param aType A message UID value
399 IMPORT_C void HandleResourceChange(TInt aType);
402 * From @c CCoeControl.
404 * Retrieves an object of the same type as that encapsulated in @c aId.
406 * This function is used to allow controls to ask their owners for
407 * access to other objects that they own.
409 * Other than in the case where NULL is returned, the object returned
410 * must be of the same object type - that is, the @c ETypeId member of the
411 * object pointed to by the pointer returned by this function must be
412 * equal to the @c iUid member of @c aUid.
414 * @param aUid An encapsulated object type ID.
415 * @return Pointer to the type UID of the wanted object.
417 IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aUid);
420 * From @c CCoeControl.
422 * Handles pointer events.
424 * This function gets called whenever a pointer event occurs in the
425 * control, i.e. when the pointer is within the control's extent, or when
426 * the control has grabbed the pointer. The control should implement this
427 * function to handle pointer events.
429 * Note: events of type @c EButton1Down are processed before
430 * @c HandlePointerEventL() is called, in order to transfer keyboard
431 * focus to the control in which the @c EButton1Down event occurred.
433 * If overriding @c HandlePointerEventL(), the implementation must
434 * include a base call to @c CCoeControl's @c HandlePointerEventL().
436 * @param aPointerEvent The pointer event
438 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
443 IMPORT_C void* ExtensionInterface( TUid aInterface );
445 IMPORT_C virtual void CEikListBox_Reserved(); // listbox use only
451 * The @c CEikColumnListBoxEditor class implements an item editor for
453 * Not supported in S60
456 class CEikColumnListBoxEditor : public CEikListBoxTextEditor
459 IMPORT_C CEikColumnListBoxEditor(MListBoxModel* aModel);
460 IMPORT_C ~CEikColumnListBoxEditor();
461 IMPORT_C void ConstructL(TInt aColumn); // just set column index
462 public: // from MEikListBoxEditor
463 IMPORT_C TPtrC ItemText();
464 IMPORT_C TBool UpdateModelL();
465 public: // From CCoeControl
466 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
468 IMPORT_C TInt Column() const;
473 IMPORT_C void* ExtensionInterface( TUid aInterface );
475 TInt iColumnIndex; // refers to list box column
478 class CColumnListBoxView : public CListBoxView
480 public: // from CListBoxView
483 * From @c CListBoxView
484 * Draws every visible item into the specified rectangle.
486 * As implemented in @c CListBoxView, this function's argument is
487 * ignored and the internal viewing rectangle is used. See @c SetViewRect().
489 * @param aClipRect = NULL The rectangle to draw into, this is ignored
491 IMPORT_C void Draw(const TRect* aClipRect = NULL) const;
494 * From @c CListBoxView
495 * Recalculates the index of the bottom item in the list from the top item
496 * index and the size of the display.
498 * This function is called by the owning list box control when either the
499 * size of the list box or the number of items in its model changes.
501 IMPORT_C virtual void CalcBottomItemIndex();
503 private: // overridden from CListBoxView
505 IMPORT_C virtual TAny* Reserved_1();
511 #endif // __EIKCLB_H__