devicediagnostics/diagplugins/diagnetcoverageplugin/inc/diagnetcoverageplugin.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:  Network coverage plug-in.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DIAGNETCOVERAGEPLUGIN_H
       
    20 #define DIAGNETCOVERAGEPLUGIN_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <etel3rdparty.h>            // CTelephony
       
    24 
       
    25 #include <DiagTestPluginBase.h>      // CDiagTestPluginBase
       
    26 #include <DiagResultsDatabaseItem.h> // CDiagResultsDatabaseItem::TResult
       
    27 #include "diagnetcoverageplugin.hrh" // DIAG_NET_COVERAGE_PLUGIN_UID
       
    28 #include <AknWaitDialog.h> 
       
    29 //CONSTANTS
       
    30 
       
    31 const TUid KDiagNetCoveragePluginUid = { DIAG_NET_COVERAGE_PLUGIN_UID };
       
    32 
       
    33 // MACROS
       
    34 
       
    35 // DATA TYPES
       
    36 
       
    37 // FUNCTION PROTOTYPES
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 class CPeriodic;
       
    41 class CDiagResultsDbItemBuilder;
       
    42 
       
    43 
       
    44 // CLASS DEFINITION
       
    45 class CDiagNetCoveragePlugin : public CDiagTestPluginBase,
       
    46                                public MProgressDialogCallback
       
    47     {
       
    48     public: // Constructors and destructor
       
    49         /**
       
    50         * Symbian OS two-phased constructor
       
    51         * @return Net Coverage Plugin
       
    52         */
       
    53         static MDiagPlugin* NewL( TAny* aInitParams );
       
    54 
       
    55         /**
       
    56         * Destructor
       
    57         */
       
    58         virtual ~CDiagNetCoveragePlugin();
       
    59         
       
    60     private: // Constructors
       
    61 
       
    62         /**
       
    63         * C++ default constructor.
       
    64         */
       
    65         CDiagNetCoveragePlugin( CDiagPluginConstructionParam* aInitParams );
       
    66 
       
    67         /**
       
    68         * Symbian OS default constructor.
       
    69         *
       
    70         */
       
    71         void ConstructL();        
       
    72 
       
    73     private: // from CActive
       
    74         /**
       
    75         * Handle active object completion event
       
    76         * @see CActive
       
    77         */
       
    78         void RunL();
       
    79     
       
    80         /**
       
    81         * Handle cancel
       
    82         * @see CActive
       
    83         */
       
    84         void DoCancel();
       
    85 
       
    86     private: // From CDiagTestPluginBase
       
    87         
       
    88         /**
       
    89         * @see CDiagTestPluginBase::Visible()
       
    90         */
       
    91         virtual TBool IsVisible() const;
       
    92 
       
    93         /**
       
    94         * @see CDiagTestPluginBase::RunMode()
       
    95         */
       
    96         virtual TRunMode RunMode() const;
       
    97 
       
    98         /**
       
    99         * @see CDiagTestPluginBase::TotalSteps()
       
   100         */
       
   101         virtual TUint TotalSteps() const;
       
   102 
       
   103         /**
       
   104         * @see CDiagTestPluginBase::GetPluginNameL
       
   105         */
       
   106         virtual HBufC* GetPluginNameL( TNameLayoutType aLayoutType ) const;
       
   107 
       
   108         /**
       
   109         * @see CDiagTestPluginBase::Uid
       
   110         */
       
   111         virtual TUid Uid() const;                   
       
   112 
       
   113         /**
       
   114         * Handle plug-in execution.
       
   115         * @see CDiagTestPluginBase::DoRunTestL
       
   116         */
       
   117         void DoRunTestL();
       
   118 
       
   119         /**
       
   120         * Clean up after test is completed or stopped.
       
   121         * @see CDiagTestPluginBase::DoStopAndCleanupL
       
   122         */
       
   123         virtual void DoStopAndCleanupL();
       
   124         
       
   125         // ADO & Platformization Changes
       
   126         TBool ShowMessageQueryL( TInt aResourceId, TInt &aButtonId  );
       
   127 
       
   128     private:    // private data types
       
   129     
       
   130         // Internal asynchronous state
       
   131         enum TState
       
   132             {
       
   133             EStateUninitialized = 0,
       
   134             EStateOpeningIsc,
       
   135             EStateWaitForSendBandInfoRequest,
       
   136             EStateWaitForReceivebandInfoResponse,
       
   137             EStateWaitForBandType,
       
   138             EStateWaitForSignalStrength,
       
   139             EStateTestCancel,
       
   140             EStateTestCompleted
       
   141             };
       
   142             
       
   143         // Possible network types for signal strength measurement
       
   144         enum TNetworkType
       
   145             {
       
   146             //Type
       
   147             ETypeUnknown = -1,
       
   148             ETypeGSM,
       
   149             ETypeUMTS,
       
   150             ETypeBandCount
       
   151             };
       
   152             
       
   153         // Possible network bands for signal strength measurement            
       
   154         enum TNetworkBand
       
   155             {
       
   156             EBandUnknown = -1,
       
   157             EBand900_850,
       
   158             EBand1800_1900_2100
       
   159             }; 
       
   160             
       
   161         enum TNetworkCoveragePanicCodes
       
   162             {
       
   163             EPanicUnhandledLeave = 0
       
   164             };                                    
       
   165 
       
   166     private:    // internal API
       
   167         /**
       
   168         * Initiate asynchronous request to obtain band type
       
   169         */        
       
   170         void ObtainBandTypeAsyncL();
       
   171         
       
   172         /**
       
   173         * Read and store threshold values
       
   174         */              
       
   175         void ReadThresholdValuesL();  
       
   176                 
       
   177         /**
       
   178         * Get network access from ETel 3rd party API
       
   179         */                              
       
   180         void CheckNetworkAccessL();
       
   181         
       
   182         /**
       
   183         * Get signal strength from ETel 3rd party API
       
   184         */                   
       
   185         void CheckSignalStrengthL();
       
   186         
       
   187         /**
       
   188         * Panic with string indicating net coverage plug-in and <aPanicCode> as
       
   189         * the panic code
       
   190         */                   
       
   191         void Panic(TInt aPanicCode);
       
   192 
       
   193 		/**
       
   194 		/* Wait Note
       
   195 		/*
       
   196 		*/
       
   197 		void ShowProgressNoteL();
       
   198 		
       
   199 		void DialogDismissedL( TInt aButtonId );
       
   200 		
       
   201     private:    // data
       
   202         // Current state of plug-in execution
       
   203         TState                              iState;
       
   204         
       
   205         // Interface to ETel 3rd Party Telephony lib
       
   206         CTelephony*                         iTelephony;        	
       
   207         
       
   208         // Network information from ETel (contains network access type)
       
   209 		CTelephony::TNetworkInfoV1          iNetworkInfoV1;
       
   210 		
       
   211 		// Signal strength information from ETel
       
   212 		CTelephony::TSignalStrengthV1       iSignalStrengthV1;
       
   213 		
       
   214 		// TPckg object for iNetworkInfoV1
       
   215 		CTelephony::TNetworkInfoV1Pckg      iNetworkInfoV1Pckg;		
       
   216 		
       
   217 		// TPckg object for iSignalStrengthV1
       
   218 		CTelephony::TSignalStrengthV1Pckg   iSignalStrengthV1Pckg;		
       
   219 		
       
   220 		// Network type (UMTS vs. GSM)
       
   221 		TNetworkType                        iNetworkType;
       
   222 		
       
   223 		// Network band class
       
   224 		TNetworkBand                        iNetworkBand;
       
   225 		
       
   226 		// Threshold values for network coverage are read from CR key
       
   227 		TReal                               iThresholdValues[2][2];		
       
   228 		
       
   229 		// Counter to keep track of test progress
       
   230 		TInt                                iProgressCounter;
       
   231 		
       
   232 		//Wait Dialog
       
   233 		CAknWaitDialog*      iWaitDialog;
       
   234 		
       
   235 		TBool idialogOn;
       
   236     };
       
   237 
       
   238 #endif //DIAGNETCOVERAGEPLUGIN_H
       
   239 
       
   240 // End of File
       
   241