Nokia N97 SDK
Example Applications Guide

CCEGroupContainer.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : CCEGroupContainer.h
00004 *  Part of     : Content Listing Framework Sample Application
00005 *  Interface   :
00006 *  Description :
00007 *  Version     :
00008 *
00009 *  Copyright (c) 2006 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 
00017 #ifndef __CCEGROUPCONTAINER_H__
00018 #define __CCEGROUPCONTAINER_H__
00019 
00020 //  INCLUDES
00021 #include <coecntrl.h>
00022 
00023 // FORWARD DECLARATIONS
00024 class CAknView;
00025 class CEikColumnListBox;
00026 class CEikLabel;
00027 
00028 // CLASS DECLARATION
00029 
00030 /**
00031 *  Container for group view.
00032 */
00033 class CCEGroupContainer 
00034     : public CCoeControl
00035     {
00036     public:  // Constructors and destructor
00037 
00038         /**
00039         * C++ default constructor.
00040                 * @param aParent Parent view of the container
00041         */
00042         CCEGroupContainer( CAknView* aParent );
00043 
00044         /**
00045         * Symbian 2nd phase constructor.
00046         */
00047         void ConstructL();
00048 
00049         /**
00050         * Destructor.
00051         */
00052         virtual ~CCEGroupContainer();
00053 
00054     public:     // New functions
00055 
00056         /**
00057         * Append new item to the list box of group listing.
00058         * @param aItem List box item to add
00059         */
00060                 void AppendListBoxItemL( const TDesC& aItem );
00061 
00062         /**
00063         * Get index of the item that is currently selected in the list box.
00064         * @return Index of selected item
00065         */
00066                 TInt CurrentItemIndex();
00067 
00068         /**
00069         * Clear the list box of group listing.
00070         */
00071                 void ResetListBoxL();
00072 
00073         /**
00074         * Selects specified item of the list box.
00075         * @param aIndex Index of the item to select
00076         */
00077                 void SetCurrentItemIndex( TInt aIndex );
00078 
00079     protected:     // Functions from base classes
00080 
00081         /**
00082         * From CCoeControl. Draw the screen.
00083         */
00084         void Draw( const TRect& aRect ) const;
00085         
00086         /**
00087         * From CCoeControl. Get count of component controls in the container.
00088         */
00089         TInt CountComponentControls() const;
00090 
00091         /**
00092         * From CCoeControl. Get component control by its index.
00093         */
00094         CCoeControl* ComponentControl( TInt aIndex ) const;
00095 
00096         /**
00097         * From CCoeControl. Handle change of the screen resolution.
00098         */
00099         void HandleResourceChange( TInt aType );
00100 
00101         /**
00102         * From CCoeControl. Handle user's key events.
00103         */
00104         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
00105                                            TEventCode aType );
00106 
00107         /**
00108         * From CCoeControl. Responds to size changes to sets the size and 
00109         * position of the contents of this control.
00110         */
00111         void SizeChanged();
00112 
00113     private:    // Data
00114         
00115         // Parent view of the container (not owned)
00116         CAknView* iParent;
00117         
00118         // List box for grouping listing (owned)
00119         CEikColumnListBox* iListBox;
00120         
00121         // Text array for list box of the group listing (owned)
00122         CDesCArray* iItemList;
00123 
00124         // Label for info text (owned)
00125         CEikLabel* iInfoLabel;
00126   
00127     };
00128 
00129 #endif // __CCEGROUPCONTAINER_H__
00130 
00131 // End of File

© Nokia 2009

Back to top