mpxplugins/viewplugins/views/mainview/inc/mpxmainviewcontainer.h
changeset 0 ff3acec5bc43
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2006 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:  MPX main view's container implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CMPXMAINVIEWCONTAINER_H
       
    21 #define C_CMPXMAINVIEWCONTAINER_H
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include <coecntrl.h>
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CMPXMainViewImp;
       
    30 class CEikTextListBox;
       
    31 class CMPXLbxExtendedFeatures;
       
    32 class CAknIconArray;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  *  Container class for main view.
       
    38  *
       
    39  *  @lib mpxmainview.lib
       
    40  *  @since S60 v3.0
       
    41  */
       
    42 NONSHARABLE_CLASS( CMPXMainViewContainer ) : public CCoeControl
       
    43     {
       
    44 public:
       
    45 
       
    46     /**
       
    47      * C++ default constructor.
       
    48      *
       
    49      * @param aView              Parent view.
       
    50      */
       
    51     CMPXMainViewContainer(
       
    52             CMPXMainViewImp* aView );
       
    53 
       
    54     /**
       
    55      * Symbian 2nd phase constructor.
       
    56      * 
       
    57      * @param aRect Frame rectangle for container.
       
    58      */
       
    59     void ConstructL( const TRect& aRect );
       
    60 
       
    61     /**
       
    62      * Destructor.
       
    63      */
       
    64     virtual ~CMPXMainViewContainer();
       
    65 
       
    66     /**
       
    67      * Set layout for all elements and set sizes for icons.
       
    68      *
       
    69      * @since S60 3.0
       
    70      */
       
    71     void UpdateLayout();    
       
    72 
       
    73     /**    
       
    74      *  Returns a pointer to the listbox
       
    75      */
       
    76     CEikTextListBox* ListBox();    
       
    77         
       
    78 private:
       
    79     /**
       
    80      * Create list box 
       
    81      *
       
    82      */
       
    83     void CreateListBoxL();
       
    84     
       
    85     /**
       
    86      * Load an icon and append it to an icon array.
       
    87      * @param aArray    pointer to the icon array
       
    88      * @param aID       skin id of the icon
       
    89      * @param aColorId  Item ID of the color table.
       
    90      * @param aColorIndex Index in the color table.
       
    91      * @param aMbmFile  path to the mbm/mif file containing the icon
       
    92      * @param aBitmapId mbm id of the bitmap
       
    93      * @param aMaskId   mbm id of the mask
       
    94      */
       
    95     void AppendIconToArrayL(
       
    96         CAknIconArray* aArray,
       
    97         const TAknsItemID& aID,
       
    98         const TAknsItemID& aColorId,
       
    99         TInt aColorIndex,
       
   100         const TDesC& aMbmFile,
       
   101         TInt aBitmapId,
       
   102         TInt aMaskId );
       
   103 
       
   104 // from base class CoeControl
       
   105 
       
   106     /**
       
   107      * From CCoeControl.
       
   108      * Responds to changes to the size and position of the contents of this 
       
   109      * control.
       
   110      */
       
   111     void SizeChanged();
       
   112 
       
   113     /**
       
   114      * From CCoeControl.
       
   115      * Gets the number of controls contained in a compound control.
       
   116      *
       
   117      * @return The number of component controls contained by this control.
       
   118      */
       
   119     TInt CountComponentControls() const;
       
   120 
       
   121     /**
       
   122      * From CCoeControl.
       
   123      * Gets an indexed component of a compound control.
       
   124      *
       
   125      * @param aIndex The index of the control.
       
   126      * @return The component control with an index of aIndex.
       
   127      */
       
   128     CCoeControl* ComponentControl( TInt aIndex ) const;    
       
   129 
       
   130     /**
       
   131      * From CoeControl.
       
   132      * Handles key events.
       
   133      *
       
   134      * @param aKeyEvent The key event.
       
   135      * @param aType The type of key event.
       
   136      */
       
   137     TKeyResponse OfferKeyEventL(
       
   138         const TKeyEvent& aKeyEvent,
       
   139         TEventCode aType );
       
   140 
       
   141     /**
       
   142      * From CoeControl.
       
   143      * Handles a change to the control's resources.
       
   144      *
       
   145      * @param aType A message UID value.
       
   146      */
       
   147     void HandleResourceChange( TInt aType );
       
   148 
       
   149     /**
       
   150      * From CoeControl.
       
   151      * Gets the control's help context.
       
   152      *
       
   153      * @param aContext The control's help context.
       
   154      */
       
   155     void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   156 
       
   157  private:   // data
       
   158 
       
   159     CMPXMainViewImp*            iView;          // not owned
       
   160     CEikTextListBox*            iListBox;       // owned
       
   161     };
       
   162 
       
   163 #endif  // C_CMPXMAINVIEWCONTAINER_H
       
   164 
       
   165 // End of File