sl@0: /* sl@0: * Copyright (c) 2001-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: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __TCTTOKENHANDLE_H__ sl@0: #define __TCTTOKENHANDLE_H__ sl@0: sl@0: #include sl@0: sl@0: sl@0: /** sl@0: * Defines a handle to a subclass of the MCTToken class. sl@0: * sl@0: * The handle identifies the class, not a particular instance of that class. sl@0: * It is guaranteed to be unique within the context of a specific device (e.g. sl@0: * mobile phone, etc.). sl@0: * sl@0: * The handle is especially useful for communication across process boundaries. sl@0: * For example: a process (A) can open a token (T), get a handle to it and then sl@0: * give the handle to another process (B). This process (B) can then try to open sl@0: * the token (T) using that handle. sl@0: * sl@0: * @since v7.0 sl@0: */ sl@0: class TCTTokenHandle sl@0: { sl@0: public: sl@0: /** sl@0: * Creates an invalid handle for the token. sl@0: * sl@0: * An invalid handle has a iTokenTypeUid and a iTokenId equal to 0. sl@0: */ sl@0: IMPORT_C TCTTokenHandle(); sl@0: sl@0: /** sl@0: * Creates a handle for the token. sl@0: * sl@0: * @param aTokenTypeUid The value of the TokenType Uid. sl@0: * @param aTokenId The identity of the Token. sl@0: */ sl@0: IMPORT_C TCTTokenHandle(TUid aTokenTypeUid, TInt aTokenId); sl@0: sl@0: /** The copy constructor. sl@0: * sl@0: * @param aTokenHandle The Token Handle object to copy sl@0: */ sl@0: IMPORT_C TCTTokenHandle(const TCTTokenHandle& aTokenHandle); sl@0: sl@0: /** sl@0: * Equality operator. sl@0: * sl@0: * Tests whether this Token Handle object is equal to the specified sl@0: * Token Handle object. sl@0: * sl@0: * @param aTokenHandle The Token Handle object to be compared. sl@0: * @return ETrue, if this Token Handle object is equal to sl@0: * the specified Token Handle object; EFalse otherwise. sl@0: */ sl@0: IMPORT_C TBool operator ==(const TCTTokenHandle& aTokenHandle) const; sl@0: sl@0: /** sl@0: * Inequality operator. sl@0: * sl@0: * Tests whether this Token Handle object is not equal to the specified sl@0: * Token Handle object. sl@0: * sl@0: * @param aTokenHandle The Token Handle object to be compared. sl@0: * @return ETrue, if this Token Handle object is not equal to sl@0: * the specified Token Handle object; EFalse, otherwise. sl@0: */ sl@0: inline TBool operator !=(const TCTTokenHandle& aTokenHandle) const; sl@0: sl@0: public: sl@0: /** sl@0: * The UID of the TokenType. sl@0: * sl@0: * This identifies to which TokenType the Token belongs. sl@0: */ sl@0: TUid iTokenTypeUid; sl@0: sl@0: /** sl@0: * The identity of the Token. sl@0: * sl@0: * This Id is unique within the context of a TokenType. sl@0: */ sl@0: TInt iTokenId; sl@0: }; sl@0: sl@0: inline TBool TCTTokenHandle::operator !=(const TCTTokenHandle& aTokenHandle) const sl@0: { sl@0: return !(*this == aTokenHandle); sl@0: } sl@0: sl@0: #endif