connectionutilities/ConnectionDialogs/cconndlg/inc/AuthenticationDialog.h
author Simon Howkins <simonh@symbian.org>
Thu, 18 Nov 2010 15:05:52 +0000
branchRCL_3
changeset 76 40780c2f3a6b
parent 0 5a93021fdf25
permissions -rw-r--r--
Adjusted to avoid exports, etc, from a top-level bld.inf

/*
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Declaration of class CAuthenticationDialog.
*
*/


#ifndef __AUTHENTICATIONDIALOG_H__
#define __AUTHENTICATIONDIALOG_H__


// INCLUDES
#include <e32base.h>
#include <AknQueryDialog.h>

#include "ExpiryTimerCallback.h"

// FORWARD DECLARATION
class CConnDlgAuthenticationPlugin;
class CExpiryTimer;

// CLASS DECLARATION
/**
 * Class implementing Authentication (username and password) dialog
 */
NONSHARABLE_CLASS( CAuthenticationDialog ) : 
                                            public CAknMultiLineDataQueryDialog, public MExpiryTimerCallback
    {
    public:
        /**
        * NewL function
        * @param aPlugin    plugin pointer
        * @param aDb        database pointer
        * @param aUsername  username
        * @param aPassword  password
        * return CAuthenticationDialog*
        */
        static CAuthenticationDialog* NewL( 
                                        CConnDlgAuthenticationPlugin* aPlugin,
                                        TDes& aUsername, 
                                        TDes& aPassword );

    private:
        /**
        * CAuthenticationDialog default constructor
        * @param aPlugin    plugin pointer
        * @param aDb        database pointer
        * @param aUsername  username
        * @param aPassword  password
        */
        CAuthenticationDialog( CConnDlgAuthenticationPlugin* aPlugin );

        /**
        * OkToExitL destructor
        * @param  aButtonId button exit id
        * @return TBool exit or no
        */
        virtual TBool OkToExitL( TInt aButtonId );

        /**
        * ~CAuthenticationDialog destructor
        * @param    -
        */
        ~CAuthenticationDialog();

        /**
        * HandleQueryEditorStateEventL function
        * @param    aQueryControl   Control to be queried
        * @param    aEventType      Type of event (not used)
        * @param    aStatus         Status of the control (empty or not)
        * return    TBool
        */
        TBool HandleQueryEditorStateEventL( CAknQueryControl* aQueryControl, 
                                            TQueryControlEvent aEventType, 
                                            TQueryValidationStatus aStatus );
        
        /**
        * Dialog expiration timeout callback
        */
        void HandleTimedOut();

    private:
        /**
        * PreLayoutDynInitL function
        * @param    -
        */
        virtual void PreLayoutDynInitL();

        /**
        * SetInitialCurrentLine function
        * @param    -
        */
        virtual void SetInitialCurrentLine();


    private:
        // Status of username field (empty or not)
        TBool iFirstEmpty;

        // Status of password field (empty or not)
        TBool iSecondEmpty;

        // Pointer to the plugin
        CConnDlgAuthenticationPlugin* iPlugin;
        
        // Pointer for dialog expiration timer
        CExpiryTimer* iExpiryTimer;
    };


#endif

// End of File