devicediagnostics/diagplugins/diagexternalmediacardplugin/inc/diagexternalmediacardplugin.h
changeset 0 3ce708148e4d
child 54 9360ca28b668
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:  External Media Card Plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DIAGEXTERNALMEDIACARDPLUGIN_H
       
    20 #define DIAGEXTERNALMEDIACARDPLUGIN_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <DiagTestPluginBase.h>         // CDiagTestPluginBase
       
    24 #include <DiagResultsDatabaseItem.h>    // DiagResultsDatabaseItem::TResult
       
    25 #include <f32file.h>                    // RFs, RFile
       
    26 #include <AknWaitDialog.h> 
       
    27 //CONSTANTS
       
    28 const TUid KDiagExternalMediaCardPluginUid = { 0x2000E58B };
       
    29 _LIT( KDiagExternalMediaCardPluginResourceFileName, "z:DevDiagExternalMediaCardPluginRsc.rsc" );
       
    30 const TInt KDiagExternalMediaCardBufferSize = 256;
       
    31 
       
    32 // MACROS
       
    33 
       
    34 // DATA TYPES
       
    35 
       
    36 // FUNCTION PROTOTYPES
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 class CDiagResultsDbItemBuilder;
       
    40 
       
    41 // CLASS DEFINITION
       
    42 class CDiagExternalMediaCardPlugin : public CDiagTestPluginBase,
       
    43 									 public MProgressDialogCallback
       
    44     {
       
    45     public: // Constructors and destructor
       
    46 		
       
    47         enum TStates
       
    48             {
       
    49             EIdle,
       
    50             EWriting,
       
    51             EReading
       
    52             };
       
    53 		
       
    54         /**
       
    55         * Symbian OS two-phased constructor
       
    56         * @return Timer Test Plugin
       
    57         */
       
    58         static MDiagPlugin* NewL( TAny* aInitParams );
       
    59 
       
    60         /**
       
    61         * Destructor
       
    62         */
       
    63         virtual ~CDiagExternalMediaCardPlugin();
       
    64 
       
    65     public: // From CDiagTestPluginBase
       
    66 
       
    67         /**
       
    68         * @see CDiagTestPluginBase::IsVisible()
       
    69         */
       
    70         virtual TBool IsVisible() const;
       
    71         
       
    72         /**
       
    73         * @see CDiagTestPluginBase::IsSupported()
       
    74         */
       
    75         virtual TBool IsSupported() const;
       
    76 
       
    77         /**
       
    78         * @see CDiagTestPluginBase::RunMode()
       
    79         */
       
    80         virtual TRunMode RunMode() const;
       
    81 
       
    82         /**
       
    83         * @see CDiagTestPluginBase::TotalSteps()
       
    84         */
       
    85         virtual TUint TotalSteps() const;
       
    86 
       
    87         /**
       
    88         * @see CDiagTestPluginBase::GetPluginNameL
       
    89         */
       
    90         virtual HBufC* GetPluginNameL( TNameLayoutType aLayoutType ) const;
       
    91 
       
    92         /**
       
    93         * @see CDiagTestPluginBase::Uid
       
    94         */
       
    95         virtual TUid Uid() const;
       
    96  
       
    97         
       
    98     private: // from CDiagTestPluginBase
       
    99     
       
   100         /**
       
   101         * Handle plug-in execution.
       
   102         * @see CDiagTestPluginBaseExtended::DoRunTestL
       
   103         */
       
   104         virtual void DoRunTestL();
       
   105 
       
   106         /**
       
   107         * Stop and clean up
       
   108         * @see CDiagTestPluginBaseExtended::DoStopAndCleanupL
       
   109         */
       
   110         virtual void DoStopAndCleanupL();
       
   111                         
       
   112     private:    // from CActive
       
   113     
       
   114         /**
       
   115         * Handle active object completion event
       
   116         */
       
   117         virtual void RunL();
       
   118     
       
   119         /**
       
   120         * Handle cancel
       
   121         */
       
   122         virtual void DoCancel();
       
   123     
       
   124     private: // from MProgressDialogCallback
       
   125         
       
   126     /**
       
   127     * Called when the progress dialog is dismissed.
       
   128     *
       
   129     * @param aButtonId - indicate which button made dialog to dismiss
       
   130     */
       
   131     virtual void DialogDismissedL( TInt aButtonId );
       
   132     
       
   133 	void ShowProgressNoteL();
       
   134 
       
   135     private:    // private functions
       
   136         
       
   137         /**
       
   138         * C++ default constructor.
       
   139         */
       
   140         CDiagExternalMediaCardPlugin( CDiagPluginConstructionParam* aInitParams );
       
   141 
       
   142         /**
       
   143         * Symbian OS default constructor.
       
   144         *
       
   145         */
       
   146         void ConstructL();
       
   147         
       
   148         /*
       
   149         * Set the states
       
   150         */
       
   151         void SetState( TStates aState );
       
   152         
       
   153         // ADO & Platformization Changes
       
   154         TBool ShowMessageQueryL( TInt aResourceId, TInt &aButtonId  );
       
   155         
       
   156         void ReportResultToPluginL(CDiagResultsDatabaseItem::TResult aResult);
       
   157         
       
   158         TBool ShowTitleMessageL();
       
   159 
       
   160     private:    // data
       
   161         TInt                                        iCounter;
       
   162         TStates                                     iState;  //rw states
       
   163         RFs                                         iFs;
       
   164         RFile                                       iFile;
       
   165         RFile                                       iFile2;
       
   166         TBuf8<KDiagExternalMediaCardBufferSize>     iBufw;
       
   167         TBuf8<KDiagExternalMediaCardBufferSize>     iBufr;
       
   168         TFileName                                   iFileName;
       
   169         TBool									    idialogOn;
       
   170 	    TBool										idialogDismissed;
       
   171 	    CAknWaitDialog*      						iWaitDialog;
       
   172 
       
   173     };
       
   174 
       
   175 #endif //DIAGEXTERNALMEDIACARDPLUGIN_H
       
   176 
       
   177 // End of File