sl@0: /* sl@0: * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef __TSECDLG_H__ sl@0: #define __TSECDLG_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: const TUint KTSecDlgNotiferUid = 0x10204789; sl@0: sl@0: #ifdef _T_SECDLG_TEXTSHELL sl@0: sl@0: #include sl@0: sl@0: /** Method at ordinal 1 to get a list of notifiers from this dll. */ sl@0: IMPORT_C CArrayPtr* NotifierArray(); sl@0: sl@0: #else sl@0: sl@0: #include sl@0: #include sl@0: #define MNotifierBase2 MEikSrvNotifierBase2 sl@0: sl@0: IMPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount); sl@0: CArrayPtr* NotifierArray(); sl@0: sl@0: #endif sl@0: sl@0: class CInputSpec : public CBase sl@0: { sl@0: public: sl@0: CInputSpec(TSecurityDialogOperation aOp, HBufC* aLabelSpec, HBufC* aResponse1, HBufC* aResponse2); sl@0: ~CInputSpec(); sl@0: TSecurityDialogNotification Operation() const { return iOp; } sl@0: const TDesC& LabelSpec() const { return *iLabelSpec; } sl@0: const TDesC& Response1() const { return *iResponse1; } sl@0: const TDesC& Response2() const { return *iResponse2; } sl@0: private: sl@0: TSecurityDialogNotification iOp; sl@0: HBufC* iLabelSpec; sl@0: HBufC* iResponse1; sl@0: HBufC* iResponse2; sl@0: }; sl@0: sl@0: /** sl@0: * This is a dummy implementation of the security dialog notifier. This version sl@0: * responds to dialogs with data read from t_secdlg_in.dat present on system drive. sl@0: * This contains the expected sequence of dialogs, and the desired responses. It keeps a sl@0: * count of how many dialogs it has answered in t_secdlg_out.dat present on system drive. sl@0: */ sl@0: class CTestSecDlgNotifier : public CBase, public MNotifierBase2 sl@0: { sl@0: public: sl@0: static CTestSecDlgNotifier* NewL(); sl@0: CTestSecDlgNotifier(); sl@0: sl@0: private: sl@0: void ConstructL(); sl@0: sl@0: /** sl@0: * Get the index of the next response by reading how many dialogs we have sl@0: * already answered. sl@0: */ sl@0: TInt GetInputIndexL(); sl@0: sl@0: /** sl@0: * Write the number of dalogs answered to the output file. sl@0: */ sl@0: void WriteDialogCountL(TInt aCount); sl@0: sl@0: /** sl@0: * Read an input specification. sl@0: */ sl@0: CInputSpec* ReadInputSpecL(TInt aIndex); sl@0: sl@0: void DoEnterPINL(const CInputSpec& aSpec, const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); sl@0: void DoChangePINL(const CInputSpec& aSpec, const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); sl@0: void DoStartL( const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage ); sl@0: void DoServerAuthenticationFailureL(const CInputSpec& aSpec, const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage ); sl@0: void DoSecureConnectionL(const CInputSpec& aSpec, const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage ); sl@0: sl@0: private: sl@0: void Release(); sl@0: TNotifierInfo RegisterL(); sl@0: TNotifierInfo Info() const; sl@0: sl@0: virtual void StartL( const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage ); sl@0: virtual TPtrC8 StartL( const TDesC8& aBuffer ); sl@0: sl@0: void Cancel(); sl@0: TPtrC8 UpdateL( const TDesC8& aBuffer ); sl@0: sl@0: private: sl@0: RFs iFs; sl@0: TNotifierInfo iInfo; sl@0: }; sl@0: sl@0: #endif