williamr@2: /* williamr@2: * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: /** williamr@2: @file williamr@4: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: #ifndef __MCTTOKENTYPE_H__ williamr@2: #define __MCTTOKENTYPE_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: class CCTTokenTypeInfo; williamr@2: class MCTToken; williamr@2: class TCTTokenHandle; williamr@2: williamr@2: williamr@2: /** williamr@2: * A token type. williamr@2: * williamr@2: * This abstract class is instantiated using the ECom Plug-in Architecture williamr@2: * for a particular token type. It allows a list of available tokens of that williamr@2: * type to be obtained, and particular tokens to be opened. williamr@2: * williamr@2: * All implementation classes are in fact a subclass of CCTTokenType; refer to williamr@2: * its documentation for implementation details. Client access is entirely through williamr@2: * this M class. williamr@2: * williamr@2: * The difference betweeen a token type and a token is best explained with an williamr@2: * example. Suppose a device has two identical WIM slots, the code to handle WIMs williamr@2: * is one token type, which will have two tokens for the two WIMs. williamr@2: * williamr@2: * @since v7.0 williamr@2: */ williamr@2: class MCTTokenType williamr@2: { williamr@2: public: williamr@2: // Static constructor functions that use ECom to load the actual implementation. williamr@2: /** williamr@2: * Creates a MCTTokenType given it's CCTTokenTypeInfo williamr@2: * williamr@2: * The definition of this inline function is in CCTTokenType.h. If you call williamr@2: * this function, you need to link against ctfinder.dll as well as williamr@2: * ctframework.dll williamr@2: * williamr@2: * @param aInfo Information about the token type. williamr@2: * @param aFs An open file server session. williamr@2: * @return The new token type object. williamr@2: */ williamr@2: inline static MCTTokenType* NewL(const CCTTokenTypeInfo& aInfo, RFs aFs); williamr@2: williamr@2: /** williamr@2: * Creates a MCTTokenType given the UID of the token type. williamr@2: * williamr@2: * The definition of this inline function is in CCTTokenType.h. If you call williamr@2: * this function, you need to link against ctfinder.dll as well as williamr@2: * ctframework.dll williamr@2: * williamr@2: * @param aUID The UID of the token type. williamr@2: * @param aFs An open file server session. williamr@2: * @return A new token type object. williamr@2: */ williamr@2: inline static MCTTokenType* NewL(TUid aUID, RFs aFs); williamr@2: williamr@2: /** williamr@2: * Lists all the tokens of this type. williamr@2: * williamr@2: * This is an asynchronous request. williamr@2: * williamr@2: * Tokens are defined by name, so instead of returning a CCTTokenTypeInfo object, williamr@2: * this function just gives a list of pointers to HBufC objects. williamr@2: * williamr@2: * @param aTokens On return, a list of all the tokens. williamr@2: * @param aStatus The request status object; contains the result of the List() williamr@2: * request when complete. Set to KErrCancel if an outstanding request is cancelled. williamr@2: */ williamr@2: virtual void List(RCPointerArray& aTokens, williamr@2: TRequestStatus& aStatus) = 0; williamr@2: williamr@2: /** williamr@2: * Cancels an asynchronous List() operation. williamr@2: * williamr@2: * The operation completes with KErrCancel. williamr@2: */ williamr@2: virtual void CancelList() = 0; williamr@2: williamr@2: /** williamr@2: * Opens the specified token. williamr@2: * williamr@2: * @param aTokenInfo Information about the required token. williamr@2: * @param aToken On return, the token to be opened. williamr@2: * @param aStatus The request status object; contains the result of the OpenToken() williamr@2: * request when complete. Set to KErrCancel if an outstanding request is cancelled. williamr@2: */ williamr@2: virtual void OpenToken(const TDesC& aTokenInfo, MCTToken*& aToken, williamr@2: TRequestStatus& aStatus) = 0; williamr@2: williamr@2: /** williamr@2: * Opens the specified token. williamr@2: * williamr@2: * @param aHandle The handle of the token. williamr@2: * @param aToken On return, the token to be opened. williamr@2: * @param aStatus The request status object; contains the result of the OpenToken() williamr@2: * request when complete. Set to KErrCancel if an outstanding request is cancelled. williamr@2: */ williamr@2: virtual void OpenToken(TCTTokenHandle aHandle, MCTToken*& aToken, williamr@2: TRequestStatus& aStatus) = 0; williamr@2: williamr@2: /** williamr@2: * Cancels an asynchronous OpenToken() operation. williamr@2: * williamr@2: * The operation completes with KErrCancel. williamr@2: */ williamr@2: virtual void CancelOpenToken() = 0; williamr@2: williamr@2: /** williamr@2: * Releases the token type object. williamr@2: * williamr@2: * To be called when you have finished with the object. williamr@2: * williamr@2: * The API does not allow the destructor to be directly called as this object williamr@2: * could remain in existence for longer to hold onto the ECom handle on the DLL; williamr@2: * for instance, it may not be deleted until all tokens and interfaces have also williamr@2: * been released. williamr@2: */ williamr@2: virtual void Release() = 0; williamr@2: williamr@2: /** williamr@2: * Gets the UID of the token type. williamr@2: * williamr@2: * This function is implemented by CCTTokenType, so token type implementers need williamr@2: * not implement it. williamr@2: * williamr@2: * @return The UID of the token type. williamr@2: */ williamr@2: virtual TUid Type() const = 0; williamr@2: williamr@2: /** williamr@2: * Gets the label of the token type. williamr@2: * williamr@2: * This function is implemented by CCTTokenType, so token type implementers need williamr@2: * not implement it. williamr@2: * williamr@2: * @return The label to the token type. williamr@2: */ williamr@2: virtual const TDesC& Label() const = 0; williamr@2: }; williamr@2: williamr@2: #endif //__MCTTOKENTYPE_H__