epoc32/include/ct/tcttokenhandle.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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  @file
    21  @publishedAll
    22  @released
    23 */
    24 
    25 #ifndef __TCTTOKENHANDLE_H__
    26 #define __TCTTOKENHANDLE_H__
    27 
    28 #include <e32std.h>
    29 
    30 
    31 /** 
    32  * Defines a handle to a subclass of the MCTToken class.
    33  *
    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.).
    37  * 
    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. 
    42  *
    43  * @since v7.0 
    44  */
    45 class TCTTokenHandle
    46 	{
    47 public:
    48 	/** 
    49 	 * Creates an invalid handle for the token.
    50 	 *
    51 	 * An invalid handle has a iTokenTypeUid and a iTokenId equal to 0. 
    52 	 */
    53 	IMPORT_C TCTTokenHandle();
    54 
    55 	/** 
    56 	 * Creates a handle for the token.
    57 	 *
    58 	 * @param aTokenTypeUid	The value of the TokenType Uid.
    59 	 * @param aTokenId		The identity of the Token. 
    60 	 */
    61 	IMPORT_C TCTTokenHandle(TUid aTokenTypeUid, TInt aTokenId);
    62 	
    63 	/** The copy constructor.
    64 	 *
    65 	 * @param aTokenHandle	The Token Handle object to copy 
    66 	 */
    67 	IMPORT_C TCTTokenHandle(const TCTTokenHandle& aTokenHandle);
    68 
    69 	/** 
    70 	 * Equality operator.
    71 	 *
    72 	 * Tests whether this Token Handle object is equal to the specified 
    73 	 * Token Handle object.	
    74 	 *
    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. 
    78 	 */
    79 	IMPORT_C TBool operator ==(const TCTTokenHandle& aTokenHandle) const;
    80 	
    81 	/** 
    82 	 * Inequality operator.
    83 	 *
    84 	 * Tests whether this Token Handle object is not equal to the specified 
    85 	 * Token Handle object. 
    86 	 *
    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.
    90 	 */
    91 	inline TBool operator !=(const TCTTokenHandle& aTokenHandle) const;
    92 
    93 public:
    94 	/** 
    95 	 * The UID of the TokenType.
    96 	 *
    97 	 * This identifies to which TokenType the Token belongs. 
    98 	 */
    99 	TUid iTokenTypeUid;
   100 	
   101 	/** 
   102 	 * The identity of the Token.
   103 	 *
   104 	 * This Id is unique within the context of a TokenType. 
   105 	 */
   106 	TInt iTokenId;
   107 	};
   108 
   109 inline TBool TCTTokenHandle::operator !=(const TCTTokenHandle& aTokenHandle) const
   110 	{
   111 	return !(*this == aTokenHandle);
   112 	}
   113 
   114 #endif