epoc32/include/ct/tcttokenhandle.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
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
williamr@2
    21
/**
williamr@2
    22
 @file
williamr@2
    23
 @publishedAll
williamr@2
    24
 @released
williamr@2
    25
*/
williamr@2
    26
williamr@2
    27
#ifndef __TCTTOKENHANDLE_H__
williamr@2
    28
#define __TCTTOKENHANDLE_H__
williamr@2
    29
williamr@2
    30
#include <e32std.h>
williamr@2
    31
williamr@2
    32
williamr@2
    33
/** 
williamr@2
    34
 * Defines a handle to a subclass of the MCTToken class.
williamr@2
    35
 *
williamr@2
    36
 * The handle identifies the class, not a particular instance of that class. 
williamr@2
    37
 * It is guaranteed to be unique within the context of a specific device (e.g. 
williamr@2
    38
 * mobile phone, etc.).
williamr@2
    39
 * 
williamr@2
    40
 * The handle is especially useful for communication across process boundaries. 
williamr@2
    41
 * For example: a process (A) can open a token (T), get a handle to it and then 
williamr@2
    42
 * give the handle to another process (B). This process (B) can then try to open 
williamr@2
    43
 * the token (T) using that handle. 
williamr@2
    44
 *
williamr@2
    45
 * @since v7.0 
williamr@2
    46
 */
williamr@2
    47
class TCTTokenHandle
williamr@2
    48
	{
williamr@2
    49
public:
williamr@2
    50
	/** 
williamr@2
    51
	 * Creates an invalid handle for the token.
williamr@2
    52
	 *
williamr@2
    53
	 * An invalid handle has a iTokenTypeUid and a iTokenId equal to 0. 
williamr@2
    54
	 */
williamr@2
    55
	IMPORT_C TCTTokenHandle();
williamr@2
    56
williamr@2
    57
	/** 
williamr@2
    58
	 * Creates a handle for the token.
williamr@2
    59
	 *
williamr@2
    60
	 * @param aTokenTypeUid	The value of the TokenType Uid.
williamr@2
    61
	 * @param aTokenId		The identity of the Token. 
williamr@2
    62
	 */
williamr@2
    63
	IMPORT_C TCTTokenHandle(TUid aTokenTypeUid, TInt aTokenId);
williamr@2
    64
	
williamr@2
    65
	/** The copy constructor.
williamr@2
    66
	 *
williamr@2
    67
	 * @param aTokenHandle	The Token Handle object to copy 
williamr@2
    68
	 */
williamr@2
    69
	IMPORT_C TCTTokenHandle(const TCTTokenHandle& aTokenHandle);
williamr@2
    70
williamr@2
    71
	/** 
williamr@2
    72
	 * Equality operator.
williamr@2
    73
	 *
williamr@2
    74
	 * Tests whether this Token Handle object is equal to the specified 
williamr@2
    75
	 * Token Handle object.	
williamr@2
    76
	 *
williamr@2
    77
	 * @param aTokenHandle	The Token Handle object to be compared.
williamr@2
    78
	 * @return				ETrue, if this Token Handle object is equal to 
williamr@2
    79
	 * 						the specified Token Handle object; EFalse otherwise. 
williamr@2
    80
	 */
williamr@2
    81
	IMPORT_C TBool operator ==(const TCTTokenHandle& aTokenHandle) const;
williamr@2
    82
	
williamr@2
    83
	/** 
williamr@2
    84
	 * Inequality operator.
williamr@2
    85
	 *
williamr@2
    86
	 * Tests whether this Token Handle object is not equal to the specified 
williamr@2
    87
	 * Token Handle object. 
williamr@2
    88
	 *
williamr@2
    89
	 * @param aTokenHandle	The Token Handle object to be compared.
williamr@2
    90
	 * @return				ETrue, if this Token Handle object is not equal to
williamr@2
    91
	 *						the specified Token Handle object; EFalse, otherwise.
williamr@2
    92
	 */
williamr@2
    93
	inline TBool operator !=(const TCTTokenHandle& aTokenHandle) const;
williamr@2
    94
williamr@2
    95
public:
williamr@2
    96
	/** 
williamr@2
    97
	 * The UID of the TokenType.
williamr@2
    98
	 *
williamr@2
    99
	 * This identifies to which TokenType the Token belongs. 
williamr@2
   100
	 */
williamr@2
   101
	TUid iTokenTypeUid;
williamr@2
   102
	
williamr@2
   103
	/** 
williamr@2
   104
	 * The identity of the Token.
williamr@2
   105
	 *
williamr@2
   106
	 * This Id is unique within the context of a TokenType. 
williamr@2
   107
	 */
williamr@2
   108
	TInt iTokenId;
williamr@2
   109
	};
williamr@2
   110
williamr@2
   111
inline TBool TCTTokenHandle::operator !=(const TCTTokenHandle& aTokenHandle) const
williamr@2
   112
	{
williamr@2
   113
	return !(*this == aTokenHandle);
williamr@2
   114
	}
williamr@2
   115
williamr@2
   116
#endif