devicediagnostics/devdiagapp/inc/devdiagsuiteview.h
changeset 0 3ce708148e4d
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     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:  Application view class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DEVDIAGSUITEVIEW_H
       
    20 #define DEVDIAGSUITEVIEW_H
       
    21 
       
    22 #include "devdiagengineobserver.h"
       
    23 
       
    24 #include <aknview.h> 
       
    25 #include <vwsdef.h> //TVwsViewId
       
    26 
       
    27 class CAknViewAppUi;
       
    28 class CDevDiagSuiteContainer;
       
    29 class CDevDiagEngine;
       
    30 class CDevDiagPluginView;
       
    31 class CAknWaitDialog;
       
    32 class CDevDiagExecResults;
       
    33 
       
    34 /**
       
    35 * An instance of the Application View object for the DevDiagApp 
       
    36 * application
       
    37 * @since 5.0
       
    38 **/
       
    39 class CDevDiagSuiteView : public CAknView,
       
    40 			              public MDevDiagEngineObserver			   
       
    41 	
       
    42     {
       
    43 public:
       
    44 
       
    45     /**
       
    46     * NewL
       
    47     *  
       
    48     * Create a CDevDiagSuiteView object.
       
    49     * @param aEngine Diagnostics engine.
       
    50     *  
       
    51     * @result a pointer to the created instance of CDevDiagSuiteView
       
    52     **/
       
    53     static CDevDiagSuiteView* NewL( CDevDiagEngine& aEngine );
       
    54 
       
    55     /**
       
    56     * NewLC
       
    57     * 
       
    58     * Create a CDevDiagSuiteView object.
       
    59     * @param aEngine Diagnostics engine.
       
    60     *
       
    61     * @result a pointer to the created instance of CDevDiagSuiteView
       
    62     **/
       
    63     static CDevDiagSuiteView* NewLC( CDevDiagEngine& aEngine );
       
    64 
       
    65 
       
    66     /**
       
    67     * Destructor.
       
    68     *
       
    69     * Destroy the object and release all memory objects
       
    70     **/
       
    71     ~CDevDiagSuiteView();
       
    72 
       
    73     
       
    74 public: //From CAknView
       
    75 
       
    76     /**
       
    77     * From CAknView Handles user commands.
       
    78     * @since Series 60 3.1
       
    79     * @param aCommand The command identifier.
       
    80     * @return None.
       
    81     */
       
    82     void HandleCommandL( TInt aCommand );
       
    83     
       
    84     /**
       
    85     * From CAknView.
       
    86     * Returns views id.
       
    87     **/
       
    88     TUid Id() const;
       
    89 
       
    90 
       
    91 protected:
       
    92     /**
       
    93     * From CAknView Activates view.
       
    94     * @since Series 60 3.1
       
    95     * @param aPrevViewId Id of previous view.
       
    96     * @param aCustomMessageId Custom message id.
       
    97     * @param aCustomMessage Custom message.
       
    98     * @return None.
       
    99     */
       
   100     virtual void DoActivateL ( const TVwsViewId &aPrevViewId, 
       
   101                                TUid aCustomMessageId, 
       
   102                                const TDesC8 &aCustomMessage );
       
   103     /**
       
   104     * From CAknView Deactivates view.        
       
   105     * @since Series 60 3.1
       
   106     * @param None.
       
   107     * @return None.
       
   108     */
       
   109     virtual void DoDeactivate();     
       
   110         
       
   111 public: // engine observer
       
   112 
       
   113     /**
       
   114     * From MDevDiagEngineObserver.
       
   115     **/
       
   116     virtual void HandleEngineCommandL( TAppEngineCommand aCommand,
       
   117                                        TInt aError,
       
   118                                        TAny* aCustom );    
       
   119   
       
   120 
       
   121 private:
       
   122 
       
   123     /**
       
   124     * Change the title of the application.
       
   125     * @param aResourceId Title text ID.
       
   126     **/
       
   127     void ChangeTitleL(TInt aResourceId);        
       
   128     
       
   129     /**
       
   130     * Perform the second phase construction of a CDevDiagSuiteView object    
       
   131     **/
       
   132     void ConstructL( );
       
   133 
       
   134     /**
       
   135     * Perform the first phase of two phase construction 
       
   136     *
       
   137     * @param aEngine Application model class.
       
   138     **/
       
   139     CDevDiagSuiteView( CDevDiagEngine& aEngine );
       
   140     
       
   141     /**
       
   142     * Update command buttons.
       
   143     * @param aResourceId Id to a new command button resource.
       
   144     **/
       
   145     void UpdateCbaL(TInt aResourceId);
       
   146     
       
   147     /**
       
   148     * Display a message query dialog.
       
   149     *
       
   150     * @param aResourceId Message query resource ID.
       
   151     **/
       
   152     TBool MessageQueryDialogLaunchL( TInt aResourceId );
       
   153     
       
   154     /**
       
   155     * Display confirmation dialog.
       
   156     *
       
   157     * @param aPassed ETrue if tests were passed, EFalse otherwise.
       
   158     **/ 
       
   159     void DisplayConfirmationDialogL( TBool aPassed );
       
   160     
       
   161     /**
       
   162     * Returns ETrue if uid is one of the suite UIDs.
       
   163     * The suites are hardware,coverage,service, and connectivity.
       
   164     *
       
   165     * @param aUid Unique identifier.
       
   166     * @return ETrue if uid is one of the suite UIDs, EFalse otherwise.
       
   167     **/
       
   168     TBool SuiteUid( TUid aUid );
       
   169     
       
   170     /**
       
   171     * Search for a test record that crashed when the device diagnostics application
       
   172     * was running. If a crashed test record is found, figure out what test crashed and 
       
   173     * suggest that the test could be executed again.
       
   174     **/
       
   175     void CheckCrashedTestL();
       
   176     
       
   177       /**
       
   178     * Display confirmation dialog after successful group execution.
       
   179     * succesful execution means that all tests have the following result:
       
   180     * - passed
       
   181     * - cancelled
       
   182     * - skipped    
       
   183     **/ 
       
   184     void DisplayConfirmationDialogL();
       
   185     
       
   186     /**
       
   187     * Displays message query dialog. The dialog lists all tests cases that failed.
       
   188     **/
       
   189     void DisplayMessageQueryDialogFailedResultsL();
       
   190     
       
   191 private: // waiting dialogs
       
   192     
       
   193     /**
       
   194      * Display a non-dismissable generic dialog to inform the user that the
       
   195      * application is "preparing."          
       
   196      */
       
   197     void DisplayWaitDialogPreparingL();
       
   198     
       
   199     /**
       
   200      * Dismisses the wait dialog        
       
   201      */
       
   202     void DismissWaitDialogPreparingL();        
       
   203     
       
   204     /**
       
   205     * Create result texts for failed test cases.
       
   206     *
       
   207     * @param aExecResults Execution results.
       
   208     * @return New heap descriptor. Caller owns the descriptor.
       
   209     **/ 
       
   210     HBufC* CreateResultsTextsForFailedTestsLC( const CDevDiagExecResults& aExecResults );
       
   211     
       
   212 private:   
       
   213 
       
   214     //Main container that displayes suites. Own.
       
   215     CDevDiagSuiteContainer* iContainer;   
       
   216     
       
   217     //Plug-in view that displayes plug-ins. Own.    
       
   218     CDevDiagPluginView* iPluginView;
       
   219     
       
   220     //Model.
       
   221     CDevDiagEngine& iEngine;
       
   222     
       
   223     //Parent suite ID. This is HW,connectivity, service or coverage suite ID.
       
   224     TUid iParentPlugin;
       
   225         
       
   226     // Wait dialog for plugin loading. Own.
       
   227     CAknWaitDialog* iWaitDialog;          
       
   228     
       
   229     // Previous View ID.
       
   230     TVwsViewId iPrevViewId;
       
   231     };
       
   232 
       
   233 
       
   234 #endif // DEVDIAGSUITEVIEW_H