deviceencryption/DevEncUi/inc/DevEncUiMainViewContainer.h
branchRCL_3
changeset 20 491b3ed49290
parent 19 95243422089a
child 21 65326cf895ed
equal deleted inserted replaced
19:95243422089a 20:491b3ed49290
     1 /*
       
     2 * Copyright (c) 2005 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:  Container for the main view.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __DEVENCUI_MAINVIEW_CONTAINER_H__
       
    19 #define __DEVENCUI_MAINVIEW_CONTAINER_H__
       
    20 
       
    21 //INCLUDES
       
    22 
       
    23 //System Includes
       
    24 #include <coecntrl.h>
       
    25 #include <aknlists.h>
       
    26 #include <aknview.h>
       
    27 #include <DevEncExternalCRKeys.h>
       
    28 
       
    29 //User Includes
       
    30 
       
    31 #include "DevEnc.hrh"
       
    32 #include "DevEncUiContainerEventCallback.h"
       
    33 #include "DevEncUiMemInfoObserver.h"
       
    34 
       
    35 //FORWARD DECLARATIONS
       
    36 class CDevEncUiDocument;
       
    37 class CDevEncUiSettingItemList;
       
    38 class CRepository;
       
    39 class CDevEncUiMemoryEntity;
       
    40 
       
    41 class CDevEncUiMainViewContainer : public CCoeControl,
       
    42                                    public MDevEncUiMemInfoObserver
       
    43     {
       
    44     public:
       
    45     	virtual TInt CountComponentControls() const;
       
    46         /**
       
    47          * @function NewL
       
    48          * @abstract Creates a CDevEncUiMainViewContainer object, which will draw itself to aRect
       
    49          * @param aRect A rectangle that defines the size and location of the displayable area
       
    50          * for the view
       
    51          * @param aDocument the document
       
    52          **/
       
    53         static CDevEncUiMainViewContainer* NewL( const TRect& aRect,
       
    54 												 RArray<CDevEncUiMemoryEntity*>& aMemEntities,
       
    55                                                  MContainerEventCallback& aCallback,
       
    56                                                  CRepository*& aCrSettings,
       
    57                                                  TInt& aMmcStatus );
       
    58     
       
    59         /**
       
    60          * @function NewLC
       
    61          * @abstract Creates a CDevEncUiMainViewContainer object, which will draw itself to aRect
       
    62          * @param aRect A rectangle that defines the size and location of the displayable area
       
    63          * for the view
       
    64          * @param aDocument the document
       
    65          **/
       
    66         static CDevEncUiMainViewContainer* NewLC( const TRect& aRect,
       
    67 												  RArray<CDevEncUiMemoryEntity*>& aMemEntities,
       
    68                                                   MContainerEventCallback& aCallback,
       
    69                                                   CRepository*& aCrSettings,
       
    70                                                   TInt& aMmcStatus );
       
    71         ~CDevEncUiMainViewContainer();
       
    72     
       
    73         /**
       
    74          * From CCoeControl. Called by the framework whenever a key event occurs.
       
    75          * Passes the key event to the settings list if it is not null, otherwise returns
       
    76          * EKeyWasNotConsumed
       
    77          * @param aKeyEvent the Key event which occured, e.g. select key pressed
       
    78          * @param aType the type of Key event which occurred, e.g. key up, key down
       
    79          * @return TKeyResponse EKeyWasNotConsumed if the key was not processed,
       
    80          * EKeyWasConsumed if it was
       
    81          */
       
    82         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    83     
       
    84         /**
       
    85          * @function ConstructL
       
    86          * @abstract Performs the second phase construction, setting the bounding
       
    87          * rectangle to aRect
       
    88          * @param aRect the display area for the view
       
    89          **/
       
    90         void ConstructL(const TRect& aRect);
       
    91     
       
    92         TInt SelectedItem();
       
    93     
       
    94         /**
       
    95          * Shows a popup dialog to let user set the state of the selected item.
       
    96          * @return ETrue if desired state of the selected item was changed
       
    97          */
       
    98         TBool ChangeSelectedItemL();
       
    99     
       
   100         /**
       
   101          * From MDevEncUiMemInfoObserver
       
   102          * */
       
   103         void UpdateInfo( TDevEncUiMemoryType aType,
       
   104                          TUint aState,
       
   105                          TUint aProgress = 0 );
       
   106     
       
   107     protected:
       
   108         virtual CCoeControl* ComponentControl(TInt aIndex) const;
       
   109     	
       
   110         /**
       
   111          * From CCoeControl
       
   112          * */
       
   113         void SizeChanged();
       
   114     	
       
   115         /**
       
   116          * From CCoeControl
       
   117          * */
       
   118         void HandleResourceChange(TInt aType);
       
   119     
       
   120     private:
       
   121         CDevEncUiMainViewContainer( RArray<CDevEncUiMemoryEntity*>& aMemEntities,
       
   122 									MContainerEventCallback& aCallback,
       
   123                                     CRepository*& aCrSettings,
       
   124                                     TInt& aMmcStatus );
       
   125         void DoUpdateInfoL( TDevEncUiMemoryType aType,
       
   126                             TUint aState,
       
   127                             TUint aProgress /*= 0*/ );
       
   128         
       
   129     private:
       
   130         /** Owned */
       
   131         MContainerEventCallback& iCallback;
       
   132 
       
   133         /** Owned */
       
   134         CDevEncUiSettingItemList* iSettingItemList;
       
   135 
       
   136         /** Not owned */
       
   137         RArray<CDevEncUiMemoryEntity*>& iMemEntities;
       
   138         
       
   139         /** Not owned */
       
   140         CRepository*& iCrSettings;
       
   141         
       
   142         /** Not owned */
       
   143         TInt& iMmcStatus;
       
   144 };
       
   145 
       
   146 
       
   147 #endif // __DEVENCUI_MAINVIEW_CONTAINER_H__
       
   148 
       
   149 //End of File