Nokia N97 SDK
Example Applications Guide

ListboxNumberContainer.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : ListboxNumberContainer.h
00004 *  Part of     : Listbox example
00005 *  Interface   :
00006 *  Description :
00007 *  Version     :
00008 *
00009 *  Copyright (c) 2007 Nokia Corporation.
00010 *  This material, including documentation and any related
00011 *  computer programs, is protected by copyright controlled by
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 #ifndef __LISTBOXNUMBERCONTAINER_H__
00017 #define __LISTBOXNUMBERCONTAINER_H__
00018 
00019 
00020 #include <eiklbo.h>
00021 
00022 
00023 class CEikColumnListBox;
00024 class CNaviScrollTimer;
00025 
00026 
00027 /**
00028 *  CListboxNumberContainer class
00029 *  This class is a container for CListboxNumberView. It owns and draws a listbox
00030 *  control of type CAknSingleNumberStyleListBox.
00031 */
00032 class CListboxNumberContainer : public CCoeControl
00033     {
00034     public:
00035 
00036         /**
00037         * 2nd phase constructor.
00038         */
00039         void ConstructL( const TRect& aRect );
00040 
00041         /**
00042         * Default constructor.
00043         */
00044         CListboxNumberContainer();
00045 
00046         /**
00047         * Destructor.
00048         */
00049         ~CListboxNumberContainer();
00050 
00051     public: //New functions
00052 
00053         /**
00054         * Getter for listbox item count.
00055         * @return Number of listbox items.
00056         */
00057         TInt ItemCount();
00058 
00059     private: // From CCoeControl
00060 
00061         /**
00062         * Gets the number of controls contained in a compound control.
00063         * @return The number of component controls contained by this control.
00064         */
00065         TInt CountComponentControls() const;
00066 
00067         /**
00068         * Gets an indexed component of a compound control.
00069         * @param aIndex The index of the control.
00070         * @return The component control with an index of aIndex.
00071         */
00072         CCoeControl *ComponentControl(TInt aIndex) const;
00073 
00074         /**
00075         * Responds to changes to the size and position of the contents of this
00076         * control.
00077         */
00078         void SizeChanged();
00079 
00080         /**
00081         * Handles key events.
00082         * @param aKeyEvent The key event.
00083         * @param aType The type of key event: EEventKey, EEventKeyUp or
00084         *              EEventKeyDown
00085         */
00086         TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent,
00087                             TEventCode aType);
00088 
00089     private: // New functions
00090 
00091         /**
00092         * Constructs listbox from resource, creates scroll bar and sets empty
00093         * list background text.
00094         */
00095         void CreateListboxL();
00096 
00097     public: // New functions
00098 
00099         /**
00100         * Adds item to the end of the list.
00101         */
00102         void AddItemL();
00103 
00104         /**
00105         * Removes item from the end of the list.
00106         */
00107         void RemoveItemL();
00108 
00109     private: // Data
00110 
00111         /**
00112         * Pointer to listbox control.
00113         *
00114         * Owned.
00115         */
00116         CEikColumnListBox* iListBox;
00117 
00118         /**
00119         * Timer for scrolling listbox class name on the navigation pane.
00120         *
00121         * Owned
00122         */
00123         CNaviScrollTimer* iTimer;
00124 
00125     };
00126 
00127 #endif //__LISTBOXNUMBERCONTAINER_H__
00128 
00129 // End of File

© Nokia 2009

Back to top