devicediagnostics/diagplugins/DiagInternalMemoryPlugin/inc/diaginternalmemoryplugin.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:  Internal Memory Plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DIAGINTERNALMEMORYPLUGIN_H
       
    20 #define DIAGINTERNALMEMORYPLUGIN_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 KDiagInternalMemoryPluginUid = { 0x2000E589 };
       
    29 _LIT( KDiagInternalMemoryPluginResourceFileName, "z:DevDiagInternalMemoryPluginRsc.rsc" );
       
    30 const TInt KDiagInternalMemoryBufferSize = 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 CDiagInternalMemoryPlugin : 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 ~CDiagInternalMemoryPlugin();
       
    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         TBool ShowMessageQueryL(TInt aResourceId,TInt &aButtonId);
       
    99  
       
   100         
       
   101     private: // from CDiagTestPluginBase
       
   102     
       
   103         /**
       
   104         * Handle plug-in execution.
       
   105         * @see CDiagTestPluginBase::DoRunTestL
       
   106         */
       
   107         virtual void DoRunTestL();
       
   108 
       
   109         /**
       
   110         * Stop and clean up
       
   111         * @see CDiagTestPluginBase::DoStopAndCleanupL
       
   112         */
       
   113         virtual void DoStopAndCleanupL();
       
   114                         
       
   115     private:    // from CActive
       
   116     
       
   117         /**
       
   118         * Handle active object completion event
       
   119         */
       
   120         virtual void RunL();
       
   121     
       
   122         /**
       
   123         * Handle cancel
       
   124         */
       
   125         virtual void DoCancel();
       
   126     
       
   127     private: // from MProgressDialogCallback
       
   128         
       
   129 	    /**
       
   130 	    * Called when the progress dialog is dismissed.
       
   131 	    *
       
   132 	    * @param aButtonId - indicate which button made dialog to dismiss
       
   133 	    */
       
   134 	    virtual void DialogDismissedL( TInt aButtonId );
       
   135 	    
       
   136 		void ShowProgressNoteL();
       
   137 	
       
   138     private:    // private functions
       
   139         
       
   140         /**
       
   141         * C++ default constructor.
       
   142         */
       
   143         CDiagInternalMemoryPlugin( CDiagPluginConstructionParam* aInitParams  );
       
   144 
       
   145         /**
       
   146         * Symbian OS default constructor.
       
   147         *
       
   148         */
       
   149         void ConstructL();
       
   150         
       
   151         /*
       
   152         * Close file sessions
       
   153         */
       
   154         void Reset();
       
   155 
       
   156         /*
       
   157         * Set the states
       
   158         */
       
   159         void SetState( TStates aState );
       
   160 
       
   161         void ReportResultToPluginL(CDiagResultsDatabaseItem::TResult aResult);
       
   162 
       
   163     private:    // data
       
   164      
       
   165         TInt                        iCounter;
       
   166         TStates                     iState;  //rw states
       
   167         RFs                         iFs;
       
   168         RFile                       iFile;
       
   169         RFile                       iFile2;
       
   170         TBuf8<KDiagInternalMemoryBufferSize >                  iBufw;
       
   171         TBuf8<KDiagInternalMemoryBufferSize >                  iBufr;
       
   172         TFileName                   iFileName;
       
   173         TBool									    idialogOn;
       
   174 	    TBool										idialogDismissed;
       
   175 	    CAknWaitDialog*      						iWaitDialog;        
       
   176 
       
   177     };
       
   178 
       
   179 #endif //DIAGINTERNALMEMORYPLUGIN_H
       
   180 
       
   181 // End of File