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