iaupdate/IAD/ui/inc/iaupdatemaincontainer.h
changeset 29 26b6f0522fd8
parent 25 98b66e4fb0be
child 30 398876c4ffa7
child 33 8110bf1194d1
equal deleted inserted replaced
25:98b66e4fb0be 29:26b6f0522fd8
     1 /*
       
     2 * Copyright (c) 2007-2008 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 the header file of the CIAUpdateMainContainer class 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IAUPDATEMAINCONTAINER_H
       
    21 #define IAUPDATEMAINCONTAINER_H
       
    22 
       
    23 //INCLUDES
       
    24 #include <coecntrl.h> // CCoeControl
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CAknDoubleGraphicStyleListBox;
       
    28 class MIAUpdateContainerObserver;
       
    29 
       
    30 class MIAUpdateNode;
       
    31 class MIAUpdateAnyNode;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35 * This class represents the container of main view of IAUpdate
       
    36 *
       
    37 */
       
    38 class CIAUpdateMainContainer :  
       
    39     public CCoeControl,    
       
    40     public MEikListBoxObserver
       
    41     {
       
    42 public:
       
    43      
       
    44     /**
       
    45     * Symbian two phased constructor.
       
    46     * @param aRect the rectangle this view will be drawn to
       
    47     * @return Instance of the created server object.
       
    48     */
       
    49     static CIAUpdateMainContainer* NewL( const TRect& aRect, 
       
    50                                          MIAUpdateContainerObserver& aObserver );
       
    51     
       
    52     /**
       
    53     * Symbian two phased constructor. Created object is pushed to clenaup stack
       
    54     * @param aRect the rectangle this view will be drawn to
       
    55     * @return Instance of the created server object.
       
    56     */
       
    57     static CIAUpdateMainContainer* NewLC( const TRect& aRect, 
       
    58                                           MIAUpdateContainerObserver& aObserver );
       
    59     /**
       
    60     * Destructor
       
    61     */
       
    62     ~CIAUpdateMainContainer();
       
    63     
       
    64     /**
       
    65     * Handles Mark/Unmark
       
    66     * @param aCommand Mark or unmark commannd
       
    67     */
       
    68     void HandleMarkCommandL( TInt aCommand );
       
    69     
       
    70     /**
       
    71     * Resfresh the list
       
    72     * @param aNodes List of nodes
       
    73     * @param aError Error code
       
    74     */
       
    75     void RefreshL( const RPointerArray<MIAUpdateAnyNode>& aNodes,
       
    76                    TInt aError );       
       
    77     
       
    78     /**
       
    79     * Returns node that's highlighted in a list
       
    80     * @param aNodes List of nodes
       
    81     * @return Current (highlighted) node
       
    82     */    
       
    83     MIAUpdateAnyNode* GetCurrentNode( const RPointerArray<MIAUpdateAnyNode>& aNodes );
       
    84     
       
    85     /**
       
    86     * Set selected items to list  
       
    87     * @param aIndices List of indices
       
    88     */    
       
    89     void SetSelectedIndicesL( const RArray<TInt>& aIndices );
       
    90     
       
    91     
       
    92     /**
       
    93      * Clean all the selection
       
    94      */ 
       
    95     void CleanAllSelection();
       
    96 
       
    97     /**
       
    98     * Set selected items to list  
       
    99     * @param aListBox   List box
       
   100     * @param aEventType Event type
       
   101     */  
       
   102     void HandleListBoxEventL(
       
   103                   CEikListBox*  aListBox,
       
   104                   TListBoxEvent aEventType );
       
   105     
       
   106 private:  // from CCoeControl
       
   107 
       
   108     /**
       
   109     * Handle key events by forwarding them to the list box.
       
   110     * @param aKeyEvent The key event.
       
   111     * @param aType The event type.
       
   112     * @result Indicates whether or not the key event was consumed by this control. 
       
   113     */
       
   114    TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   115 
       
   116     /**
       
   117     * Called when size is changed by framework.
       
   118     * Set current size to listbox
       
   119     */
       
   120     void SizeChanged();
       
   121 
       
   122     /**
       
   123     * Count of components.
       
   124     * @return Count of child components
       
   125     */
       
   126     TInt CountComponentControls() const;
       
   127 
       
   128     /**
       
   129     * Component control
       
   130     * @param aIndex  Index numer of child component.
       
   131     * @return Pointer to a component
       
   132     */
       
   133     CCoeControl* ComponentControl( TInt aIndex ) const;
       
   134       
       
   135     /**
       
   136     * Get the help context for this control.
       
   137     *
       
   138     * @param aContext Help context
       
   139     */
       
   140     void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   141         
       
   142     /**
       
   143     * Handles a resource relative event
       
   144     *
       
   145     * @param aType Event type
       
   146     */
       
   147     void HandleResourceChange( TInt aType );
       
   148     
       
   149     
       
   150     
       
   151 private:
       
   152     
       
   153     /** 
       
   154     * Constuctor 
       
   155     * @param aRect Rectangular this view will be drawn to
       
   156     */
       
   157     void ConstructL (const TRect& aRect );
       
   158     
       
   159     /** 
       
   160     * C++ constuctor 
       
   161     * @param aObserver Observer of the container
       
   162     */
       
   163     CIAUpdateMainContainer( MIAUpdateContainerObserver& aObserver );
       
   164             
       
   165     /** 
       
   166     * Update Middle soft key label text (Mark/Unmark) 
       
   167     */
       
   168     void UpdateMSKTextL();
       
   169     
       
   170     void CreateIconL( CFbsBitmap*& aBitmap,
       
   171                       CFbsBitmap*& aMask,
       
   172                       const TDesC& aFileName,
       
   173                       TInt aBitmapId,
       
   174                       TInt aMaskId );
       
   175         
       
   176 
       
   177 private: // Data
       
   178 
       
   179     MIAUpdateContainerObserver& iObserver;
       
   180     CDesCArray* iItemTextArray;
       
   181     CAknDoubleGraphicStyleListBox* iListBox; 
       
   182     };
       
   183 
       
   184 #endif // IAUPDATEMAINCONTAINER_H
       
   185 
       
   186 // End of File