2 * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
25 #ifndef __TCTTOKENHANDLE_H__
26 #define __TCTTOKENHANDLE_H__
32 * Defines a handle to a subclass of the MCTToken class.
34 * The handle identifies the class, not a particular instance of that class.
35 * It is guaranteed to be unique within the context of a specific device (e.g.
36 * mobile phone, etc.).
38 * The handle is especially useful for communication across process boundaries.
39 * For example: a process (A) can open a token (T), get a handle to it and then
40 * give the handle to another process (B). This process (B) can then try to open
41 * the token (T) using that handle.
49 * Creates an invalid handle for the token.
51 * An invalid handle has a iTokenTypeUid and a iTokenId equal to 0.
53 IMPORT_C TCTTokenHandle();
56 * Creates a handle for the token.
58 * @param aTokenTypeUid The value of the TokenType Uid.
59 * @param aTokenId The identity of the Token.
61 IMPORT_C TCTTokenHandle(TUid aTokenTypeUid, TInt aTokenId);
63 /** The copy constructor.
65 * @param aTokenHandle The Token Handle object to copy
67 IMPORT_C TCTTokenHandle(const TCTTokenHandle& aTokenHandle);
72 * Tests whether this Token Handle object is equal to the specified
73 * Token Handle object.
75 * @param aTokenHandle The Token Handle object to be compared.
76 * @return ETrue, if this Token Handle object is equal to
77 * the specified Token Handle object; EFalse otherwise.
79 IMPORT_C TBool operator ==(const TCTTokenHandle& aTokenHandle) const;
82 * Inequality operator.
84 * Tests whether this Token Handle object is not equal to the specified
85 * Token Handle object.
87 * @param aTokenHandle The Token Handle object to be compared.
88 * @return ETrue, if this Token Handle object is not equal to
89 * the specified Token Handle object; EFalse, otherwise.
91 inline TBool operator !=(const TCTTokenHandle& aTokenHandle) const;
95 * The UID of the TokenType.
97 * This identifies to which TokenType the Token belongs.
102 * The identity of the Token.
104 * This Id is unique within the context of a TokenType.
109 inline TBool TCTTokenHandle::operator !=(const TCTTokenHandle& aTokenHandle) const
111 return !(*this == aTokenHandle);