Nokia N97 SDK
Example Applications Guide

CCEMusicContainer.h

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

© Nokia 2009

Back to top