devicediagnostics/devdiagapp/inc/devdiagsuitecontainer.h
changeset 18 7d11f9a6646f
parent 4 75a71fdb4c92
child 21 c707676bf59f
equal deleted inserted replaced
4:75a71fdb4c92 18:7d11f9a6646f
     1 /*
       
     2 * Copyright (c) 2007 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:  Main container that displayes test suites.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CDEVDIAGSUITECONTAINER_H
       
    21 #define CDEVDIAGSUITECONTAINER_H
       
    22 
       
    23 // SYSTEM INCLUDES
       
    24 #include <eiklbo.h>
       
    25 #include <coecntrl.h> 
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CDevDiagSuiteView;
       
    29 class CDevDiagEngine;
       
    30 class MDiagPlugin;
       
    31 class CAknSingleLargeStyleListBox;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 * CDevDiagSuiteContainer dialog class
       
    37 * 
       
    38 */
       
    39 class CDevDiagSuiteContainer : public CCoeControl,
       
    40                              	 public MCoeControlObserver,
       
    41                                  public MEikListBoxObserver                                                  
       
    42     {    
       
    43   
       
    44     public: // Constructors and destructor
       
    45 
       
    46         /**
       
    47         * Two-phased constructor.
       
    48         *
       
    49         * @param aView Main view.
       
    50         * @param aEngine Model.
       
    51         * @param aRect Area to draw on.
       
    52         */
       
    53         static CDevDiagSuiteContainer* NewL( CDevDiagSuiteView* aView,
       
    54                                                CDevDiagEngine& aEngine,
       
    55                                                const TRect& aRect );
       
    56 
       
    57 		/**
       
    58         * Destructor.
       
    59         */
       
    60         ~CDevDiagSuiteContainer();	
       
    61 	
       
    62     public: // Functions from base classes
       
    63 
       
    64 		/**
       
    65         * From MProgressDialogCallback. Gets called when the
       
    66         * dialog is dismissed/closed.
       
    67         * @param aButtonId Softkey Button Id
       
    68         */
       
    69         void DialogDismissedL( const TInt aButtonId );
       
    70 
       
    71         /**
       
    72         * From CoeControl Responds to size changes. 
       
    73         * Sets the size and position of the contents of this control.
       
    74         * @since Series 60 3.1
       
    75         * @param None.
       
    76         * @return None.
       
    77         */
       
    78         void SizeChanged();
       
    79 
       
    80         /**
       
    81         * From CoeControl Handles the situations where
       
    82         * a resource (e.g. skin or layout) is changed.
       
    83         * @since Series 60 3.1
       
    84         * @param aType Type of resource change.
       
    85         * @return None.
       
    86         */
       
    87         void HandleResourceChange( TInt aType );
       
    88 
       
    89         /**
       
    90         * From CoeControl Gets the number of controls contained 
       
    91         * in a compound control.        
       
    92         * @since Series 60 3.1
       
    93         * @param None.
       
    94         * @return The number of component controls contained by this control.
       
    95         */
       
    96         TInt CountComponentControls() const;
       
    97 
       
    98         /**
       
    99         * From CoeControl Gets the specified component of a compound control.
       
   100         * @since Series 60 3.1
       
   101         * @param aIndex The index of the control to get.
       
   102         * @return Reference to the component control.
       
   103         */
       
   104         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   105 
       
   106         /**
       
   107         * From CoeControl Draws the control.
       
   108         * @since Series 60 3.1
       
   109         * @param aRect The region of the control to be redrawn.
       
   110         * @return None.
       
   111         */
       
   112         void Draw( const TRect& aRect ) const;
       
   113 
       
   114         /**
       
   115         * From CoeControl Handles key events.
       
   116         * @since Series 60 3.1
       
   117         * @param aKeyEvent The key event that occurred.
       
   118         * @param aType The event type.
       
   119         * @return Response to the key event.
       
   120         */
       
   121         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );       
       
   122 
       
   123 		/**
       
   124         * Handle ListBox EventL
       
   125         * @param CEikListBox* aListBox Pointer to used listbox
       
   126 		* @param TListBoxEvent aEventType Event type
       
   127         * @return -
       
   128         */
       
   129 		void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
   130 		
       
   131         /**
       
   132         * From MCoeControlObserver Handles an event from an observed control.
       
   133         * @since Series 60 3.1
       
   134         * @param aControl The control that sent the event.
       
   135         * @param aEventType The event type.
       
   136         * @return None.
       
   137         */
       
   138         void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );        
       
   139 
       
   140         /**
       
   141         * From CoeControl Gets the control's help context.
       
   142         * @since Series 60 3.1
       
   143         * @param aContext The control's help context
       
   144         * @return None.
       
   145         */
       
   146         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   147                 
       
   148         /**
       
   149         * Display children of the parent.
       
   150         *
       
   151         * @param aParentUid Suite UID.
       
   152         **/
       
   153         void DisplayChildrenL( TUid aParentUid );
       
   154         
       
   155         /**
       
   156         * Append plug-in into the listbox
       
   157         * 
       
   158         * @param aPlugin Plug-in to be added.
       
   159         *
       
   160         **/
       
   161         void DisplayPluginL( MDiagPlugin* aPlugin );
       
   162                 
       
   163         /**
       
   164         * Return the plug-in that is selected 
       
   165         * Return always a test suite.
       
   166         *
       
   167         * @param aPlugin The selected plug-in.
       
   168         **/
       
   169         void SelectedPlugin( MDiagPlugin*& aPlugin ) const;
       
   170 
       
   171     protected:
       
   172 
       
   173         /**
       
   174 		* Change of focus
       
   175         * @param -
       
   176 		* @return -
       
   177         */
       
   178         void FocusChanged(TDrawNow aDrawNow);
       
   179 	
       
   180         /**
       
   181         * Appends icons to the contained listbox.
       
   182         * @since Series 60 3.1
       
   183         * @param None.
       
   184         * @return None.
       
   185         */
       
   186         void AddIconsL();
       
   187 
       
   188     private:
       
   189 
       
   190         /**
       
   191         * C++ default constructor.
       
   192         *
       
   193         * @param aView Main view.
       
   194         * @param aEngine Model.
       
   195         */
       
   196         CDevDiagSuiteContainer( CDevDiagSuiteView* aView, CDevDiagEngine& aEngine );
       
   197 
       
   198         /**
       
   199         * By default Symbian 2nd phase constructor is private.
       
   200         */
       
   201         void ConstructL( const TRect& aRect );
       
   202                  
       
   203 	public:  // data
       
   204 	
       
   205 	    //Listbox. Own.
       
   206 		CAknSingleLargeStyleListBox*   iListBox;
       
   207 	
       
   208 	    //Main view. 
       
   209         CDevDiagSuiteView*       iView;
       
   210         
       
   211         //Model.
       
   212         CDevDiagEngine&           iEngine;
       
   213                 
       
   214         //Currently displayed plug-ins
       
   215         //Plug-ins are owned by the engine.
       
   216         //Do not call ResetAndDestroy.
       
   217         RPointerArray<MDiagPlugin> iChildren;
       
   218 			
       
   219     };
       
   220 
       
   221 #endif  // CDEVDIAGSUITECONTAINER_H
       
   222 
       
   223 // End of File