omadm/omadmappui/inc/NSmlDMFotaContainer.h
changeset 0 3ce708148e4d
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Declaration of fota view control container
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CNSMLDMFOTACONTAINER_H
       
    21 #define CNSMLDMFOTACONTAINER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <aknview.h>    // AVKON components
       
    25 #include <aknlists.h>
       
    26 //#include <FotaEngine.h>
       
    27 
       
    28 // CLASS DECLARATION
       
    29 class CNSmlDMFotaModel;
       
    30 
       
    31 /**
       
    32 *  Control container for NSmlDMSyncApp fota view.
       
    33 *
       
    34 *  @lib NSmlDMSyncApp
       
    35 *  @since Series 60 3.1
       
    36 */
       
    37 class CNSmlDMFotaContainer : public CCoeControl, 
       
    38                              public MCoeControlObserver, 
       
    39                              public MEikListBoxObserver
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42     
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         */
       
    46         static CNSmlDMFotaContainer* NewL( CAknView* aView,
       
    47                                            const TRect& aRect,
       
    48                                            CNSmlDMFotaModel* aFotaModel );
       
    49         
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         virtual ~CNSmlDMFotaContainer();
       
    54 
       
    55     public: // New functions
       
    56         
       
    57         /**
       
    58         * ?member_description.
       
    59         * @since Series ?XX ?SeriesXX_version
       
    60         * @param ?arg1 ?description
       
    61         * @return ?description
       
    62         */
       
    63         //?type ?member_function( ?type ?arg1 );
       
    64 
       
    65     public: // Functions from base classes
       
    66 
       
    67         /**
       
    68         * Refreshes the listbox contents.
       
    69         * @since Series 60 3.2
       
    70         * @param None.
       
    71         * @return None.
       
    72         */
       
    73         
       
    74         void RefreshL(TBool aPostponeDisplay);
       
    75         
       
    76         
       
    77     public: // Functions from base classes
       
    78 
       
    79         /**
       
    80         * From CoeControl Responds to size changes. 
       
    81         * Sets the size and position of the contents of this control.
       
    82         * @since Series 60 3.1
       
    83         * @param None.
       
    84         * @return None.
       
    85         */
       
    86         void SizeChanged();
       
    87 
       
    88         /**
       
    89         * From CoeControl Handles the situations where
       
    90         * a resource (e.g. skin or layout) is changed.
       
    91         * @since Series 60 3.1
       
    92         * @param aType Type of resource change.
       
    93         * @return None.
       
    94         */
       
    95         void HandleResourceChange( TInt aType );
       
    96 
       
    97         /**
       
    98         * From CoeControl Gets the number of controls contained 
       
    99         * in a compound control.        
       
   100         * @since Series 60 3.1
       
   101         * @param None.
       
   102         * @return The number of component controls contained by this control.
       
   103         */
       
   104         TInt CountComponentControls() const;
       
   105 
       
   106         /**
       
   107         * From CoeControl Gets the specified component of a compound control.
       
   108         * @since Series 60 3.1
       
   109         * @param aIndex The index of the control to get.
       
   110         * @return Reference to the component control.
       
   111         */
       
   112         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   113 
       
   114         /**
       
   115         * From CoeControl Draws the control.
       
   116         * @since Series 60 3.1
       
   117         * @param aRect The region of the control to be redrawn.
       
   118         * @return None.
       
   119         */
       
   120         void Draw( const TRect& aRect ) const;
       
   121 
       
   122         /**
       
   123         * From CoeControl Handles key events.
       
   124         * @since Series 60 3.1
       
   125         * @param aKeyEvent The key event that occurred.
       
   126         * @param aType The event type.
       
   127         * @return Response to the key event.
       
   128         */
       
   129         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   130 
       
   131         /**
       
   132         * From MEikListBoxObserver Handles list box events.
       
   133         * @since Series 60 3.1
       
   134         * @param aListBox The originating list box.
       
   135         * @param aEventType The event type.
       
   136         * @return None.
       
   137         */
       
   138         void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
   139 
       
   140         /**
       
   141         * From MCoeControlObserver Handles an event from an observed control.
       
   142         * @since Series 60 3.1
       
   143         * @param aControl The control that sent the event.
       
   144         * @param aEventType The event type.
       
   145         * @return None.
       
   146         */
       
   147         void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
       
   148 
       
   149         /**
       
   150         * From CoeControl Gets the control's help context.
       
   151         * @since Series 60 3.1
       
   152         * @param aContext The control's help context
       
   153         * @return None.
       
   154         */
       
   155         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   156 
       
   157     private:  // New functions
       
   158         
       
   159         /**
       
   160         * Retrieves the required information for the main listbox
       
   161         * and formats the item array.
       
   162         * @since Series 60 3.1
       
   163         * @param aItemsArray Descriptor array that is populated and formatted.
       
   164         * @param aPostponeDisplay on ETrue displays the first item
       
   165         * @return None.
       
   166         */
       
   167         void FormatListboxL( CDesCArray* aItemsArray, TBool aPostponeDisplay );
       
   168 
       
   169         /**
       
   170         * Shows a menu corresponding to the given menu bar
       
   171         * resource identifier.
       
   172         * @since Series 60 3.1
       
   173         * @param aResource Resource identifier of the menu to be shown.
       
   174         * @return None.
       
   175         */
       
   176         void ShowContextMenuL( TInt aResource );
       
   177         
       
   178     private:
       
   179 
       
   180         /**
       
   181         * C++ default constructor.
       
   182         */
       
   183         CNSmlDMFotaContainer( CAknView* aView,
       
   184                               CNSmlDMFotaModel* aFotaModel );
       
   185 
       
   186         /**
       
   187         * By default Symbian 2nd phase constructor is private.
       
   188         */
       
   189         void ConstructL( const TRect& aRect );
       
   190         
       
   191     private:    // Data
       
   192         // Fota view listbox
       
   193         CAknDoubleStyleListBox* iFotaListBox;
       
   194 
       
   195         // Pointer to the view instance
       
   196         CAknView*               iView;
       
   197 
       
   198         // Pointer to the fota model instance
       
   199         CNSmlDMFotaModel*       iFotaModel;
       
   200     };
       
   201 
       
   202 #endif      // CNSMLDMFOTACONTAINER_H  
       
   203             
       
   204 // End of File