javaextensions/satsa/apdu/src.s60/cstschannelmanager.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 30 Apr 2010 10:40:48 +0300
branchRCL_3
changeset 20 f9bb0fca356a
parent 19 04becd199f91
permissions -rw-r--r--
adding j9 directory to week17 release

/*
* Copyright (c) 2008 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:
 *
*/


#ifndef CSTSCHANNELMANAGER_H
#define CSTSCHANNELMANAGER_H

//  INCLUDES
#include <e32base.h>

namespace java
{
namespace satsa
{

// FORWARD DECLARATIONS
class CSTSApduExchanger;
class CSTSConnection;
class CSTSManageChannel;
class CSTSManageChannelResp;

// CLASS DECLARATION

/**
 *  Handels the channel related operations of connection.
 *  Used for opening and closing logical channels.
 *
 *  @since 3.0
 */
NONSHARABLE_CLASS(CSTSChannelManager): public CBase
{
public: // Constructors and destructor

    /**
     * Two-phased constructor.
     */
    static CSTSChannelManager* NewL(CSTSApduExchanger* aApduExchanger);

    /**
     * Destructor.
     */
    virtual ~CSTSChannelManager();

public: // New functions

    /**
     * Requests free channel from the card.
     * @since 3.0
     * @return Opened channel or -1 if no free channel available or
     * other error code
     */
    TInt RequestChannel();

    /**
     * Closes the gived channel.
     * @since 3.0
     * @param aChannel Channel which will be closed
     * @return Error code
     */
    TInt CloseChannel(TInt aChannel);

private:

    /**
     * C++ default constructor.
     */
    CSTSChannelManager(CSTSApduExchanger* aApduExchanger);

    /**
     * By default Symbian 2nd phase constructor is private.
     */
    void ConstructL();

private: // Data
    //for sending apdus
    CSTSApduExchanger* iApduExchanger; //not owned

    //manage channel apdu, owned
    CSTSManageChannel* iCmdApdu;

    CSTSManageChannelResp* iRespApdu; //owned
};

} // namespace satsa
} // namespace java
#endif // CSTSCHANNELMANAGER_H
// End of File