Nokia N97 SDK
Example Applications Guide

ListboxGraphicContainer.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : ListboxGraphicContainer.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 __LISTBOXGRAPHICCONTAINER_H__
00017 #define __LISTBOXGRAPHICCONTAINER_H__
00018 
00019 
00020 #include <eiklbo.h>
00021 #include <akniconutils.h>
00022 
00023 class CEikColumnListBox;
00024 class CIconFileProvider;
00025 class CNaviScrollTimer;
00026 
00027 
00028 /**
00029 *  CListboxGraphicContainer class
00030 *  This class is a container for CListboxGraphicView. It owns and draws a listbox
00031 *  control of type CAknSingleGraphicStyleListBox.
00032 */
00033 class CListboxGraphicContainer : public CCoeControl
00034     {
00035     public:
00036 
00037         /**
00038         * 2nd phase constructor.
00039         */
00040         void ConstructL( const TRect& aRect );
00041 
00042         /**
00043         * Default constructor.
00044         */
00045         CListboxGraphicContainer();
00046 
00047         /**
00048         * Destructor.
00049         */
00050         ~CListboxGraphicContainer();
00051 
00052     public:
00053 
00054         /**
00055         * Adds item to the listbox. Asks the item text from user with
00056         * data query. Item is added to the index which is currently focused.
00057         */
00058         void AddItemL();
00059 
00060         /**
00061         * Removes focused item from the listbox.
00062         */
00063         void RemoveItemL();
00064 
00065         /**
00066         * Getter for listbox item count.
00067         */
00068         TInt ItemCount();
00069 
00070     private: // From CCoeControl
00071 
00072         /**
00073         * Gets the number of controls contained in a compound control.
00074         * @return The number of component controls contained by this control.
00075         */
00076         TInt CountComponentControls() const;
00077 
00078         /**
00079         * Gets an indexed component of a compound control.
00080         * @param aIndex The index of the control.
00081         * @return The component control with an index of aIndex.
00082         */
00083         CCoeControl *ComponentControl(TInt aIndex) const;
00084 
00085         /**
00086         * Responds to changes to the size and position of the contents of this
00087         * control.
00088         */
00089         void SizeChanged();
00090 
00091         /**
00092         * Handles key events.
00093         * @param aKeyEvent The key event.
00094         * @param aType The type of key event: EEventKey, EEventKeyUp or
00095         *              EEventKeyDown
00096         */
00097         TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent,
00098                             TEventCode aType);
00099 
00100     private: // New functions
00101 
00102         /**
00103         * Constructs listbox, creates scroll bar, sets empty
00104         * list background text, and enables marquee.
00105         */
00106         void CreateListboxL();
00107 
00108         /**
00109         * Sets icons for the listbox. Only one icon is used and loaded from
00110         * application private directory using CIconFileProvider and
00111         * AknIconUtils.
00112         */
00113         void SetIconsL();
00114 
00115         /**
00116         * Sets items to the listbox.
00117         */
00118         void SetItemsL();
00119 
00120     private: // Data
00121 
00122         /**
00123         * Pointer to listbox control.
00124         *
00125         * Owned.
00126         */
00127         CEikColumnListBox* iListBox;
00128 
00129         /**
00130         * File server.
00131         */
00132         RFs iFsSession;
00133 
00134         /**
00135         * Icon file provider. With this it is possible to open a icon file
00136         * from application private directory.
00137         *
00138         * Owned.
00139         */
00140         CIconFileProvider* iFileProvider;
00141 
00142         /**
00143         * Timer for scrolling listbox class name on the navigation pane.
00144         *
00145         * Owned
00146         */
00147         CNaviScrollTimer* iTimer;
00148 
00149     };
00150 
00151 #endif //__LISTBOXGRAPHICCONTAINER_H__
00152 
00153 // End of File

© Nokia 2009

Back to top