bluetoothengine/btnotif/tsrc/BtNotifApiTest/inc/BtNotifApiTest.h
branchRCL_3
changeset 56 9386f31cc85b
parent 0 f63038272f30
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
       
     1 /*
       
     2 * Copyright (c) 2002 - 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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef BTNOTIFAPITEST_H
       
    22 #define BTNOTIFAPITEST_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <StifLogger.h>
       
    26 #include <TestScripterInternal.h>
       
    27 #include <StifTestModule.h>
       
    28 #include <TestclassAssert.h>
       
    29 #include <btextnotifierspartner.h>
       
    30 
       
    31 #include "btnotif.h"
       
    32 #include "btmanclient.h"
       
    33 #include "btnotifierapi.h"
       
    34 #include "btextnotifiers.h"
       
    35 #include "coreapplicationuisdomainpskeys.h"
       
    36 
       
    37 #include "BtEngDevManObserver.h"
       
    38 #include "BtSettingsObserver.h"
       
    39 
       
    40 
       
    41 // CONSTANTS
       
    42 //const ?type ?constant_var = ?constant;
       
    43 
       
    44 // MACROS
       
    45 //#define ?macro ?macro_def
       
    46 #define TEST_CLASS_VERSION_MAJOR 0
       
    47 #define TEST_CLASS_VERSION_MINOR 0
       
    48 #define TEST_CLASS_VERSION_BUILD 0
       
    49 
       
    50 // Logging path
       
    51 //_LIT( KBtNotifApiTestLogPath, "\\logs\\testframework\\bt\\" );
       
    52 _LIT( KBtNotifApiTestLogPath, "e:\\testing\\stiflogs\\" );
       
    53 // Log file
       
    54 _LIT( KBtNotifApiTestLogFile, "BtNotifApiTest.txt" ); 
       
    55 _LIT( KBtNotifApiTestLogFileWithTitle, "BtNotifApiTest_[%S].txt" );
       
    56 
       
    57 // FUNCTION PROTOTYPES
       
    58 //?type ?function_name(?arg_list);
       
    59 
       
    60 // FORWARD DECLARATIONS
       
    61 //class ?FORWARD_CLASSNAME;
       
    62 class CBtNotifApiTest;
       
    63 
       
    64 // DATA TYPES
       
    65 //enum ?declaration
       
    66 //typedef ?declaration
       
    67 //extern ?data_type;
       
    68 
       
    69 enum TTestOption
       
    70     {
       
    71     EQueryDiscarded = 0,
       
    72     EQueryAccepted,
       
    73     ECheckPasskey,
       
    74     EQueryCanceled
       
    75     };
       
    76 
       
    77 // CLASS DECLARATION
       
    78 
       
    79 /**
       
    80 *  CBtNotifApiTest test class for STIF Test Framework TestScripter.
       
    81 *  ?other_description_lines
       
    82 *
       
    83 *  @lib ?library
       
    84 *  @since ?Series60_version
       
    85 */
       
    86 NONSHARABLE_CLASS(CBtNotifApiTest) : public CScriptBase
       
    87     {
       
    88     public:  // Constructors and destructor
       
    89 
       
    90         /**
       
    91         * Two-phased constructor.
       
    92         */
       
    93         static CBtNotifApiTest* NewL( CTestModuleIf& aTestModuleIf );
       
    94 
       
    95         /**
       
    96         * Destructor.
       
    97         */
       
    98         virtual ~CBtNotifApiTest();
       
    99 
       
   100     public: // New functions
       
   101 
       
   102         /**
       
   103         * ?member_description.
       
   104         * @since ?Series60_version
       
   105         * @param ?arg1 ?description
       
   106         * @return ?description
       
   107         */
       
   108         //?type ?member_function( ?type ?arg1 );
       
   109 
       
   110     public: // Functions from base classes
       
   111 
       
   112         /**
       
   113         * From CScriptBase Runs a script line.
       
   114         * @since ?Series60_version
       
   115         * @param aItem Script line containing method name and parameters
       
   116         * @return Symbian OS error code
       
   117         */
       
   118         virtual TInt RunMethodL( CStifItemParser& aItem );
       
   119 
       
   120     protected:  // New functions
       
   121 
       
   122         /**
       
   123         * ?member_description.
       
   124         * @since ?Series60_version
       
   125         * @param ?arg1 ?description
       
   126         * @return ?description
       
   127         */
       
   128         //?type ?member_function( ?type ?arg1 );
       
   129 
       
   130     protected:  // Functions from base classes
       
   131 
       
   132         /**
       
   133         * From ?base_class ?member_description
       
   134         */
       
   135         //?type ?member_function();
       
   136 
       
   137     private:
       
   138 
       
   139         /**
       
   140         * C++ default constructor.
       
   141         */
       
   142         CBtNotifApiTest( CTestModuleIf& aTestModuleIf );
       
   143 
       
   144         /**
       
   145         * By default Symbian 2nd phase constructor is private.
       
   146         */
       
   147         void ConstructL();
       
   148 
       
   149         // Prohibit copy constructor if not deriving from CBase.
       
   150         // ?classname( const ?classname& );
       
   151         // Prohibit assigment operator if not deriving from CBase.
       
   152         // ?classname& operator=( const ?classname& );
       
   153 
       
   154         /**
       
   155         * Frees all resources allocated from test methods.
       
   156         * @since ?Series60_version
       
   157         */
       
   158         void Delete();
       
   159 
       
   160         /**
       
   161         * Test methods are listed below. 
       
   162         */
       
   163 
       
   164         /**
       
   165         * Example test method.
       
   166         * @since ?Series60_version
       
   167         * @param aItem Script line containing parameters.
       
   168         * @return Symbian OS error code.
       
   169         */
       
   170         virtual TInt PairedDeviceSettingNotifierTest( CStifItemParser& aItem );
       
   171         virtual TInt FinishPairedDeviceSettingQuery( CStifItemParser& aItem );
       
   172         
       
   173         virtual TInt PbapAuthNotifierTest( CStifItemParser& aItem );
       
   174         virtual TInt FinishPbapAuthQuery( CStifItemParser& aItem );
       
   175         
       
   176         virtual TInt PasskeyDisplayNotifierTest( CStifItemParser& aItem );
       
   177         virtual TInt FinishPasskeyDisplayQuery( CStifItemParser& aItem );
       
   178         
       
   179         virtual TInt NumericComparisonQueryNotifierTest( CStifItemParser& aItem );
       
   180         virtual TInt FinishNumericComparisonQuery( CStifItemParser& aItem );
       
   181         
       
   182         virtual TInt AuthQueryNotifierTest( CStifItemParser& aItem );
       
   183         virtual TInt FinishAuthQuery( CStifItemParser& aItem );
       
   184         
       
   185         virtual TInt PinPasskeyQueryNotifierTest( CStifItemParser& aItem );
       
   186         virtual TInt FinishPinPasskeyQuery( CStifItemParser& aItem );
       
   187         
       
   188         virtual TInt InquiryNotifierTest( CStifItemParser& aItem );
       
   189         virtual TInt FinishInquiry( CStifItemParser& aItem );
       
   190         
       
   191         virtual TInt ObexPasskeyQueryNotifierTest( CStifItemParser& aItem );
       
   192         virtual TInt FinishObexPasskeyQuery( CStifItemParser& aItem );
       
   193         
       
   194         virtual TInt PowerModeQueryNotifierTest( CStifItemParser& aItem );
       
   195         virtual TInt FinishPowerModeQuery( CStifItemParser& aItem );
       
   196         
       
   197         virtual TInt GenericInfoNotifierTest( CStifItemParser& aItem );
       
   198         
       
   199         virtual TInt GenericQueryNotifierTest( CStifItemParser& aItem );
       
   200         virtual TInt FinishGenericQuery( CStifItemParser& aItem );
       
   201         
       
   202         /**
       
   203          * Method used to log version of test class
       
   204          */
       
   205         void SendTestClassVersion();
       
   206         
       
   207         TInt GetGenericInfoNoteType( TPtrC aTypeString, TBTGenericInfoNoteType& aGenericInfoNoteType );        
       
   208         TInt GetGenericQueryNoteType( TPtrC aTypeString, TBTGenericQueryNoteType& aGenericQueryNoteType );
       
   209         
       
   210         TInt GetTestOption( TPtrC optionString, TTestOption& aOption );
       
   211         TInt TurnLightsOn( CStifItemParser& aItem );
       
   212 
       
   213         //ADD NEW METHOD DEC HERE
       
   214         //[TestMethods] - Do not remove
       
   215 
       
   216     public:     // Data
       
   217         // ?one_line_short_description_of_data
       
   218         //?data_declaration;
       
   219 
       
   220     protected:  // Data
       
   221         // ?one_line_short_description_of_data
       
   222         //?data_declaration;
       
   223 
       
   224     private:    // Data
       
   225         
       
   226         RNotifier* iNotifier;
       
   227               
       
   228         TPbapAuthNotifierResponsePckg iPbapAuthNotifierResponsePckg;
       
   229         TBTDeviceResponseParamsPckg iBtDeviceResponseParamsPckg;
       
   230         TPckgBuf<TInt> iNumericComparisonQueryReply;
       
   231         TBTPinCode iEnteredPinPasskey;
       
   232         TBTPinCode iPinPasskey;
       
   233         TObexPasskeyBuf iObexPasskeyBuf;
       
   234         TObexPasskeyBuf iEnteredPasskeyBuf;
       
   235         TPckgBuf<TBool> iAuthQueryReply;
       
   236         TPckgBuf<TBool> iPowerModeQueryReply;
       
   237         TPckgBuf<TBool> iGenericQueryReply;
       
   238         
       
   239         
       
   240         TRequestStatus iReqStatus;
       
   241         TBuf<KMaxBCBluetoothNameLen> iLocalDeviceName;
       
   242         
       
   243         CBtSettingsObserver* iBtSettings;
       
   244         CBtEngDevManObserver* iBtEngDevManObserver;
       
   245         CBTDeviceArray* iBtDeviceArray;
       
   246         CBTDevice* iTestDevice;
       
   247         
       
   248 
       
   249     public:     // Friend classes
       
   250         //?friend_class_declaration;
       
   251     protected:  // Friend classes
       
   252         //?friend_class_declaration;
       
   253     private:    // Friend classes
       
   254         //?friend_class_declaration;
       
   255 
       
   256     };
       
   257 
       
   258 #endif      // BTNOTIFAPITEST_H
       
   259 
       
   260 // End of File