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
     1 /*
     2 * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 
    20 
    21 /**
    22  @file
    23  @publishedAll
    24  @released
    25 */
    26 
    27 #ifndef __TCTTOKENHANDLE_H__
    28 #define __TCTTOKENHANDLE_H__
    29 
    30 #include <e32std.h>
    31 
    32 
    33 /** 
    34  * Defines a handle to a subclass of the MCTToken class.
    35  *
    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.).
    39  * 
    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. 
    44  *
    45  * @since v7.0 
    46  */
    47 class TCTTokenHandle
    48 	{
    49 public:
    50 	/** 
    51 	 * Creates an invalid handle for the token.
    52 	 *
    53 	 * An invalid handle has a iTokenTypeUid and a iTokenId equal to 0. 
    54 	 */
    55 	IMPORT_C TCTTokenHandle();
    56 
    57 	/** 
    58 	 * Creates a handle for the token.
    59 	 *
    60 	 * @param aTokenTypeUid	The value of the TokenType Uid.
    61 	 * @param aTokenId		The identity of the Token. 
    62 	 */
    63 	IMPORT_C TCTTokenHandle(TUid aTokenTypeUid, TInt aTokenId);
    64 	
    65 	/** The copy constructor.
    66 	 *
    67 	 * @param aTokenHandle	The Token Handle object to copy 
    68 	 */
    69 	IMPORT_C TCTTokenHandle(const TCTTokenHandle& aTokenHandle);
    70 
    71 	/** 
    72 	 * Equality operator.
    73 	 *
    74 	 * Tests whether this Token Handle object is equal to the specified 
    75 	 * Token Handle object.	
    76 	 *
    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. 
    80 	 */
    81 	IMPORT_C TBool operator ==(const TCTTokenHandle& aTokenHandle) const;
    82 	
    83 	/** 
    84 	 * Inequality operator.
    85 	 *
    86 	 * Tests whether this Token Handle object is not equal to the specified 
    87 	 * Token Handle object. 
    88 	 *
    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.
    92 	 */
    93 	inline TBool operator !=(const TCTTokenHandle& aTokenHandle) const;
    94 
    95 public:
    96 	/** 
    97 	 * The UID of the TokenType.
    98 	 *
    99 	 * This identifies to which TokenType the Token belongs. 
   100 	 */
   101 	TUid iTokenTypeUid;
   102 	
   103 	/** 
   104 	 * The identity of the Token.
   105 	 *
   106 	 * This Id is unique within the context of a TokenType. 
   107 	 */
   108 	TInt iTokenId;
   109 	};
   110 
   111 inline TBool TCTTokenHandle::operator !=(const TCTTokenHandle& aTokenHandle) const
   112 	{
   113 	return !(*this == aTokenHandle);
   114 	}
   115 
   116 #endif