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.
27 #ifndef __TCTTOKENHANDLE_H__
28 #define __TCTTOKENHANDLE_H__
34 * Defines a handle to a subclass of the MCTToken class.
36 * The handle identifies the class, not a particular instance of that class.
37 * It is guaranteed to be unique within the context of a specific device (e.g.
38 * mobile phone, etc.).
40 * The handle is especially useful for communication across process boundaries.
41 * For example: a process (A) can open a token (T), get a handle to it and then
42 * give the handle to another process (B). This process (B) can then try to open
43 * the token (T) using that handle.
51 * Creates an invalid handle for the token.
53 * An invalid handle has a iTokenTypeUid and a iTokenId equal to 0.
55 IMPORT_C TCTTokenHandle();
58 * Creates a handle for the token.
60 * @param aTokenTypeUid The value of the TokenType Uid.
61 * @param aTokenId The identity of the Token.
63 IMPORT_C TCTTokenHandle(TUid aTokenTypeUid, TInt aTokenId);
65 /** The copy constructor.
67 * @param aTokenHandle The Token Handle object to copy
69 IMPORT_C TCTTokenHandle(const TCTTokenHandle& aTokenHandle);
74 * Tests whether this Token Handle object is equal to the specified
75 * Token Handle object.
77 * @param aTokenHandle The Token Handle object to be compared.
78 * @return ETrue, if this Token Handle object is equal to
79 * the specified Token Handle object; EFalse otherwise.
81 IMPORT_C TBool operator ==(const TCTTokenHandle& aTokenHandle) const;
84 * Inequality operator.
86 * Tests whether this Token Handle object is not equal to the specified
87 * Token Handle object.
89 * @param aTokenHandle The Token Handle object to be compared.
90 * @return ETrue, if this Token Handle object is not equal to
91 * the specified Token Handle object; EFalse, otherwise.
93 inline TBool operator !=(const TCTTokenHandle& aTokenHandle) const;
97 * The UID of the TokenType.
99 * This identifies to which TokenType the Token belongs.
104 * The identity of the Token.
106 * This Id is unique within the context of a TokenType.
111 inline TBool TCTTokenHandle::operator !=(const TCTTokenHandle& aTokenHandle) const
113 return !(*this == aTokenHandle);