author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
parent 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
/* |
williamr@2 | 2 |
* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 3 |
* All rights reserved. |
williamr@2 | 4 |
* This component and the accompanying materials are made available |
williamr@2 | 5 |
* under the terms of the License "Eclipse Public License v1.0" |
williamr@2 | 6 |
* which accompanies this distribution, and is available |
williamr@2 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 8 |
* |
williamr@2 | 9 |
* Initial Contributors: |
williamr@2 | 10 |
* Nokia Corporation - initial contribution. |
williamr@2 | 11 |
* |
williamr@2 | 12 |
* Contributors: |
williamr@2 | 13 |
* |
williamr@2 | 14 |
* Description: |
williamr@2 | 15 |
* |
williamr@2 | 16 |
*/ |
williamr@2 | 17 |
|
williamr@2 | 18 |
|
williamr@2 | 19 |
/** |
williamr@2 | 20 |
@file |
williamr@2 | 21 |
@publishedAll |
williamr@2 | 22 |
@released |
williamr@2 | 23 |
*/ |
williamr@2 | 24 |
|
williamr@2 | 25 |
#ifndef __TCTTOKENHANDLE_H__ |
williamr@2 | 26 |
#define __TCTTOKENHANDLE_H__ |
williamr@2 | 27 |
|
williamr@2 | 28 |
#include <e32std.h> |
williamr@2 | 29 |
|
williamr@2 | 30 |
|
williamr@2 | 31 |
/** |
williamr@2 | 32 |
* Defines a handle to a subclass of the MCTToken class. |
williamr@2 | 33 |
* |
williamr@2 | 34 |
* The handle identifies the class, not a particular instance of that class. |
williamr@2 | 35 |
* It is guaranteed to be unique within the context of a specific device (e.g. |
williamr@2 | 36 |
* mobile phone, etc.). |
williamr@2 | 37 |
* |
williamr@2 | 38 |
* The handle is especially useful for communication across process boundaries. |
williamr@2 | 39 |
* For example: a process (A) can open a token (T), get a handle to it and then |
williamr@2 | 40 |
* give the handle to another process (B). This process (B) can then try to open |
williamr@2 | 41 |
* the token (T) using that handle. |
williamr@2 | 42 |
* |
williamr@2 | 43 |
* @since v7.0 |
williamr@2 | 44 |
*/ |
williamr@2 | 45 |
class TCTTokenHandle |
williamr@2 | 46 |
{ |
williamr@2 | 47 |
public: |
williamr@2 | 48 |
/** |
williamr@2 | 49 |
* Creates an invalid handle for the token. |
williamr@2 | 50 |
* |
williamr@2 | 51 |
* An invalid handle has a iTokenTypeUid and a iTokenId equal to 0. |
williamr@2 | 52 |
*/ |
williamr@2 | 53 |
IMPORT_C TCTTokenHandle(); |
williamr@2 | 54 |
|
williamr@2 | 55 |
/** |
williamr@2 | 56 |
* Creates a handle for the token. |
williamr@2 | 57 |
* |
williamr@2 | 58 |
* @param aTokenTypeUid The value of the TokenType Uid. |
williamr@2 | 59 |
* @param aTokenId The identity of the Token. |
williamr@2 | 60 |
*/ |
williamr@2 | 61 |
IMPORT_C TCTTokenHandle(TUid aTokenTypeUid, TInt aTokenId); |
williamr@2 | 62 |
|
williamr@2 | 63 |
/** The copy constructor. |
williamr@2 | 64 |
* |
williamr@2 | 65 |
* @param aTokenHandle The Token Handle object to copy |
williamr@2 | 66 |
*/ |
williamr@2 | 67 |
IMPORT_C TCTTokenHandle(const TCTTokenHandle& aTokenHandle); |
williamr@2 | 68 |
|
williamr@2 | 69 |
/** |
williamr@2 | 70 |
* Equality operator. |
williamr@2 | 71 |
* |
williamr@2 | 72 |
* Tests whether this Token Handle object is equal to the specified |
williamr@2 | 73 |
* Token Handle object. |
williamr@2 | 74 |
* |
williamr@2 | 75 |
* @param aTokenHandle The Token Handle object to be compared. |
williamr@2 | 76 |
* @return ETrue, if this Token Handle object is equal to |
williamr@2 | 77 |
* the specified Token Handle object; EFalse otherwise. |
williamr@2 | 78 |
*/ |
williamr@2 | 79 |
IMPORT_C TBool operator ==(const TCTTokenHandle& aTokenHandle) const; |
williamr@2 | 80 |
|
williamr@2 | 81 |
/** |
williamr@2 | 82 |
* Inequality operator. |
williamr@2 | 83 |
* |
williamr@2 | 84 |
* Tests whether this Token Handle object is not equal to the specified |
williamr@2 | 85 |
* Token Handle object. |
williamr@2 | 86 |
* |
williamr@2 | 87 |
* @param aTokenHandle The Token Handle object to be compared. |
williamr@2 | 88 |
* @return ETrue, if this Token Handle object is not equal to |
williamr@2 | 89 |
* the specified Token Handle object; EFalse, otherwise. |
williamr@2 | 90 |
*/ |
williamr@2 | 91 |
inline TBool operator !=(const TCTTokenHandle& aTokenHandle) const; |
williamr@2 | 92 |
|
williamr@2 | 93 |
public: |
williamr@2 | 94 |
/** |
williamr@2 | 95 |
* The UID of the TokenType. |
williamr@2 | 96 |
* |
williamr@2 | 97 |
* This identifies to which TokenType the Token belongs. |
williamr@2 | 98 |
*/ |
williamr@2 | 99 |
TUid iTokenTypeUid; |
williamr@2 | 100 |
|
williamr@2 | 101 |
/** |
williamr@2 | 102 |
* The identity of the Token. |
williamr@2 | 103 |
* |
williamr@2 | 104 |
* This Id is unique within the context of a TokenType. |
williamr@2 | 105 |
*/ |
williamr@2 | 106 |
TInt iTokenId; |
williamr@2 | 107 |
}; |
williamr@2 | 108 |
|
williamr@2 | 109 |
inline TBool TCTTokenHandle::operator !=(const TCTTokenHandle& aTokenHandle) const |
williamr@2 | 110 |
{ |
williamr@2 | 111 |
return !(*this == aTokenHandle); |
williamr@2 | 112 |
} |
williamr@2 | 113 |
|
williamr@2 | 114 |
#endif |