stifui/stifui/inc/MainMenuContainer.h
changeset 0 d6fe6244b863
equal deleted inserted replaced
-1:000000000000 0:d6fe6244b863
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description: This file contains CMainMenuContainer class definition.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CMAINMENUCONTAINER_H
       
    19 #define CMAINMENUCONTAINER_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <coecntrl.h>
       
    23 #include <eiklbo.h>
       
    24 
       
    25    
       
    26 // FORWARD DECLARATIONS
       
    27 class CEikTextListBox;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  CMainMenuContainer  container control class.
       
    33 *  
       
    34 */
       
    35 class CMainMenuContainer : public CCoeControl, public MEikListBoxObserver /* MCoeControlObserver */
       
    36     {
       
    37     public: // Constructors and destructor
       
    38         
       
    39         /**
       
    40         * Symbian OS default constructor.
       
    41         * @param aRect Frame rectangle for container.
       
    42         */
       
    43         void ConstructL(const TRect& aRect);
       
    44 
       
    45         /**
       
    46         * Destructor.
       
    47         */
       
    48         ~CMainMenuContainer();
       
    49 
       
    50     public: // New functions
       
    51     
       
    52         /**
       
    53         * Get currently selected items index.
       
    54         * @return Current item index.
       
    55         */		
       
    56 		TInt GetActiveLine();   
       
    57 		
       
    58 		/**
       
    59 		 * Makes the iListBox store its focus position to CAppUiAppUi object
       
    60 		 */
       
    61 		void SaveActiveLine();
       
    62 
       
    63     public: // Functions from base classes
       
    64    
       
    65         /**
       
    66         * Method HandleSelectedListItemL handles valix index.
       
    67         * @param aIndex Current item index.
       
    68         */
       
    69         void HandleSelectedListItemL( TInt aIndex );    
       
    70 
       
    71     private: // Functions from base classes
       
    72 
       
    73         /**
       
    74         * From CoeControl,SizeChanged.
       
    75         * Called by framework when the view size is changed.
       
    76         */
       
    77         void SizeChanged();
       
    78 
       
    79         /**
       
    80         * From CoeControl,CountComponentControls.
       
    81         * @return Number of controls indside this container.
       
    82         */
       
    83         TInt CountComponentControls() const;
       
    84 
       
    85         /**
       
    86         * From CCoeControl,ComponentControl.
       
    87         * Gets the specified component of a compound control.
       
    88         * @param aIndex The index of the control to get.
       
    89         * @return The component control with an index of aIndex.
       
    90         */
       
    91         CCoeControl* ComponentControl(TInt aIndex) const;
       
    92 
       
    93         /**
       
    94         * From CCoeControl,Draw.
       
    95         * Draw a control, called by window server.
       
    96         * @param aRect The region of the control to be redrawn. Co-ordinates 
       
    97         *              are relative to the control's origin (top left corner).
       
    98         */
       
    99         void Draw(const TRect& aRect) const;
       
   100 
       
   101         /**
       
   102         * Handles list box events.
       
   103         * @param aListBox The originating list box. 
       
   104         * @param aEventType A code for the event. Further information may be
       
   105         *                   obtained by accessing the list box itself.
       
   106         */
       
   107 		void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
       
   108 
       
   109         /**
       
   110         * From CCoeControl,OfferKeyEventL
       
   111         * Handles key events.
       
   112         * @param aKeyEvent The key event.
       
   113         * @param aType The type of key event.
       
   114         * @return Indicates whether or not the key event was used 
       
   115         *         by this control.
       
   116         */
       
   117 		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
   118 		
       
   119         
       
   120     private: //data
       
   121         
       
   122 		CEikTextListBox*    iListBox;
       
   123     };
       
   124 
       
   125 #endif
       
   126 
       
   127 // End of File