messagingappbase/mce/inc/MceMainViewListContainer.h
branchRCL_3
changeset 60 7fdbb852d323
equal deleted inserted replaced
57:ebe688cedc25 60:7fdbb852d323
       
     1 /*
       
     2 * Copyright (c) 2002 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:  
       
    15 *     Container for main view.
       
    16 *     Derived from CMceListContainer.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef MCEMAINVIEWLISTCONTAINER_H
       
    23 #define MCEMAINVIEWLISTCONTAINER_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <coecntrl.h> // CCoeControl
       
    27 #include <msvapi.h>
       
    28 
       
    29 #include "mcetemplate.h"
       
    30 #include "MceUtils.h"
       
    31 #include "MceListItem.h"
       
    32 
       
    33 #include <bldvariant.hrh>
       
    34 
       
    35 class CAknDoubleLargeStyleListBox;
       
    36 class CMceMainViewListItemArray;
       
    37 class CMceBitmapResolver;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  Container for main view.
       
    43 */
       
    44 class  CMceMainViewListContainer :
       
    45     public CCoeControl
       
    46 //    public CMceListContainer
       
    47     {
       
    48     public:  // Constructors and destructor
       
    49 
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         */
       
    53         static CMceMainViewListContainer* NewL(
       
    54             const TRect& aRect,
       
    55             TMsvId aFolderId,
       
    56             TMceListType aListType = EMceListTypeMainView );
       
    57 
       
    58         /**
       
    59         * Destructor.
       
    60         */
       
    61         virtual ~CMceMainViewListContainer();
       
    62 		
       
    63         /**
       
    64          * Creates list items.
       
    65          */
       
    66         void CreateListItemsL(
       
    67                 CMsvSessionPtr aSession,
       
    68                 CMceBitmapResolver& aBitmapResolver );
       
    69 
       
    70         /**
       
    71         * From CoeControl
       
    72         */
       
    73         void GetHelpContext(TCoeHelpContext& aContext) const;
       
    74         
       
    75         /**
       
    76         * Returns pointer to listbox.
       
    77         */
       
    78         inline CAknDoubleLargeStyleListBox* ListBox() const;
       
    79 
       
    80         /**
       
    81         * Returns item array
       
    82         * @return Pointer to list item array
       
    83         */
       
    84         inline CMceMainViewListItemArray*  ListItems() const;
       
    85         
       
    86         /**
       
    87         * Returns list index of the current item
       
    88         * @return Index of the current item
       
    89         */
       
    90         TInt    CurrentItemIndex() const;
       
    91         
       
    92         /**
       
    93         * Tries to find item from the currently opened list and retuns
       
    94         * list index if found. KErrNotFound if not found.
       
    95         * @param aId: item id to be searched
       
    96         * @return List index of the item.
       
    97         */
       
    98         TInt ItemIndex( TMsvId aId ) const;
       
    99         
       
   100         /**
       
   101         * Sets MSK label according to a focused item
       
   102         * Since 3.2
       
   103         */
       
   104         void SetMskL();
       
   105         
       
   106         /**
       
   107         * Returns message id of the current (=selected) item
       
   108         * @return message id
       
   109         */
       
   110         TMsvId  CurrentItemId() const;
       
   111         
       
   112         /**
       
   113         * Returns mce's info of the current message
       
   114         * @return info
       
   115         */
       
   116         TMceListItem CurrentItemListItem() const;
       
   117         
       
   118         /**
       
   119         * From CCoeControl
       
   120         */
       
   121         TInt CountComponentControls() const;
       
   122 
       
   123         /**
       
   124         * From CCoeControl
       
   125         */
       
   126         CCoeControl* ComponentControl(TInt aIndex) const;
       
   127 
       
   128         /**
       
   129         * From CCoeControl
       
   130         */
       
   131         void SizeChanged();
       
   132 
       
   133         /**
       
   134         * From CCoeControl
       
   135         */
       
   136         virtual TKeyResponse OfferKeyEventL(
       
   137             const TKeyEvent& aKeyEvent,
       
   138             TEventCode aType );
       
   139 
       
   140     protected:
       
   141         // From CCoeControl
       
   142         void FocusChanged(TDrawNow aDrawNow);
       
   143 
       
   144     private:
       
   145         /**
       
   146         * Constructor.
       
   147         */
       
   148         CMceMainViewListContainer();
       
   149         
       
   150         /**
       
   151         * Symbian OS constructor.
       
   152         */
       
   153         void ConstructL(
       
   154                 const TRect& aRect );
       
   155             
       
   156     private: // Data
       
   157         CAknDoubleLargeStyleListBox* iListBox;
       
   158         CMceMainViewListItemArray*  iListItems;
       
   159         TInt                        iCurrMskResource;
       
   160     };
       
   161 
       
   162 #include "MceMainViewListContainer.inl"
       
   163 
       
   164 #endif
       
   165 
       
   166 // End of file