remotemgmt_plat/diagnostics_plugin_api/inc/diagtestplugin.h
branchRCL_3
changeset 25 b183ec05bd8c
parent 24 13d7c31c74e0
child 26 19bba8228ff0
equal deleted inserted replaced
24:13d7c31c74e0 25:b183ec05bd8c
     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:  Test Plugin Abstract Interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DIAGTESTPLUGIN_H
       
    20 #define DIAGTESTPLUGIN_H
       
    21 
       
    22 // INCLUDES
       
    23 #include    <DiagPlugin.h>              // MDiagPlugin
       
    24 
       
    25 
       
    26 // FORWARD DECLARATION
       
    27 class CDiagPluginExecPlan;
       
    28 class MDiagTestObserver;
       
    29 class MDiagEngineCommon;
       
    30 class CDiagPluginPool;
       
    31 class TDiagTestExecParam;
       
    32 class CDiagResultsDatabaseItem;
       
    33 class MDiagResultDetail;
       
    34 
       
    35 /**
       
    36 * Diagnostics test plug-in abstract interface.
       
    37 *
       
    38 * @since S60 v5.0
       
    39 **/
       
    40 class MDiagTestPlugin: public MDiagPlugin
       
    41     {
       
    42 public: 
       
    43 
       
    44     /**
       
    45     * Run mode defines what kind of behaviour is expected from this plug-in.
       
    46     **/
       
    47     enum TRunMode
       
    48         {
       
    49         EInteractiveView,       // plugin with a view
       
    50         EInteractiveDialog,     // interactive, but with dialogs
       
    51         EAutomatic              // automatic tests
       
    52         };
       
    53 
       
    54     /**
       
    55     * Reason for execution stop.
       
    56     **/
       
    57     enum TStopReason
       
    58         {
       
    59         ESkip,
       
    60         ECancelAll,
       
    61         EWatchdog
       
    62         };
       
    63 
       
    64     /**
       
    65     * Execute a diagnostics test. This is an asynchronous method. The plug-in
       
    66     * must call MDiagTestObserver:TestExecutionCompletedL when test has finished.
       
    67     *
       
    68     * @param aExecParams   Parameters for running the test.
       
    69     * @param aSkipDependencyCheck - If ETrue, plug-in should execute even if 
       
    70     *   dependencies are not executed.
       
    71     * @param aDependencyExecution - If ETrue, this is being executed to 
       
    72     *   satisfy dependency.
       
    73     * @param aCustomParams Custom parameters for plug-ins. 
       
    74     *   These should be used if TDiagTestExecParam is not enough. 
       
    75     *   It can used to pass arbitrary data from application to the plug-ins.
       
    76     *   Owership is not transferred and plug-in must not delete
       
    77     *   this parameter. Ownership is not transferred since
       
    78     *   client does not always know the type of pointer.
       
    79     **/
       
    80     virtual void RunTestL( TDiagTestExecParam* aExecParam,
       
    81                            TBool aSkipDependencyCheck,
       
    82                            TBool aDependencyExecution,
       
    83                            TAny* aCustomParams ) = 0;
       
    84 
       
    85     /**
       
    86     * Describes the run mode of the test plug-in.
       
    87     *
       
    88     * @return Run mode.
       
    89     * @see TDiagRunMode.
       
    90     **/
       
    91     virtual TRunMode RunMode() const = 0;
       
    92 
       
    93     /**
       
    94     * Cancels testing. Cancellation is expected to be synchronous.
       
    95     * Test plug-in must return the result immediately, and it must not call
       
    96     * TestExecutionCompletedL(). Ownership of the CDiagResultsDatabaseItem is 
       
    97     * transferred to the caller.
       
    98     *
       
    99     * @param aReason - Reason why ExecutionStopL() is being called.
       
   100     * @return Returns result object.  Test must not call TestExecutionCompletedL.
       
   101     **/
       
   102     virtual CDiagResultsDatabaseItem* ExecutionStopL( TStopReason aReason ) = 0;
       
   103 
       
   104     /**
       
   105     * Suspend test.  If test cannot be suspended, it will leave with
       
   106     * KErrNotSupported.
       
   107     **/
       
   108     virtual void SuspendL() = 0;
       
   109 
       
   110     /**
       
   111     * Resume test. If test cannot be resumed, it will leave with 
       
   112     * KErrNotSupported.
       
   113     **/
       
   114     virtual void ResumeL() = 0;
       
   115 
       
   116     /**
       
   117     * Get the number of steps that is needed to execute tests. 
       
   118     * This can be used to calculate progress information. 
       
   119     *
       
   120     * @return The number of steps.
       
   121     **/
       
   122     virtual TUint TotalSteps() const = 0;
       
   123 
       
   124     /**
       
   125     * Create detailed information object from test result.
       
   126     * Ownership is transferred to caller.
       
   127     *
       
   128     * @param aTestResult - Base test result.
       
   129     * @return Instance of MDiagResultDetail* that can provide detailed 
       
   130     *   information about the last test.
       
   131     **/
       
   132     virtual MDiagResultDetail* CreateDetailL( 
       
   133                         const CDiagResultsDatabaseItem& aResult ) const = 0;
       
   134     };
       
   135 
       
   136 #endif // DIAGTESTPLUGIN_H
       
   137 
       
   138 // End of File
       
   139