epoc32/include/ct/tcttokenobjecthandle.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 __TCTTOKENOBJECTHANDLE_H__
williamr@2
    28
#define __TCTTOKENOBJECTHANDLE_H__
williamr@2
    29
williamr@2
    30
#include <e32std.h>
williamr@2
    31
#include <ct/tcttokenhandle.h>
williamr@2
    32
williamr@2
    33
williamr@2
    34
/** 
williamr@2
    35
 * Defines a handle to an object represented by a class which is a subclass of 
williamr@2
    36
 * the MCTTokenObject class.
williamr@2
    37
 * 
williamr@2
    38
 * The handle identifies the object, not the instance of the subclass of MCTTokenObject 
williamr@2
    39
 * used to manage that object. It is guaranteed to be unique within the context 
williamr@2
    40
 * of a specific device (e.g. mobile phone, etc.) at a specific point in time. 
williamr@2
    41
 * This limitation in time is due to the fact that objects can be created and 
williamr@2
    42
 * destroyed. We cannot guarantee that a handle will still point to the same 
williamr@2
    43
 * object after we add or remove one or more objects from the store from which 
williamr@2
    44
 * the object comes. However, it is guaranteed that the addition of objects to 
williamr@2
    45
 * the store will not affect the validity of the handles that were obtained previously. 
williamr@2
    46
 * For instance, if the object is a certificate in a certificate store, the subclass 
williamr@2
    47
 * of MCTTokenObject will be CCTCertInfo and the handle will identify the certificate 
williamr@2
    48
 * in the certificate store, not the instance of CCTCertInfo.
williamr@2
    49
 * 
williamr@2
    50
 * The handle is especially useful for communication across process boundaries. 
williamr@2
    51
 * For example: a process (A) can get a handle to an object, and then give the handle 
williamr@2
    52
 * to another process (B). This process (B) can then try to get the same object using that handle. 
williamr@2
    53
 *
williamr@2
    54
 * @since v7.0 
williamr@2
    55
 */
williamr@2
    56
class TCTTokenObjectHandle
williamr@2
    57
	{
williamr@2
    58
public:
williamr@2
    59
	/** 
williamr@2
    60
	 * Creates an invalid handle.
williamr@2
    61
	 *
williamr@2
    62
	 * An invalid handle has an invalid iTokenHandle and an iObjectId equal to 0. 
williamr@2
    63
	 */
williamr@2
    64
	IMPORT_C TCTTokenObjectHandle();
williamr@2
    65
	
williamr@2
    66
	/** 
williamr@2
    67
	 * Creates a handle.
williamr@2
    68
	 *
williamr@2
    69
	 * @param aTokenHandle	The handle that identifies the Token where the object 
williamr@2
    70
	 * 						is stored.
williamr@2
    71
	 * @param aObjectId		The identifier of the object within the Token. 
williamr@2
    72
	 */
williamr@2
    73
	IMPORT_C TCTTokenObjectHandle(TCTTokenHandle aTokenHandle, TInt aObjectId);
williamr@2
    74
	
williamr@2
    75
	/** 
williamr@2
    76
	 * Copy Constructor.
williamr@2
    77
	 *
williamr@2
    78
	 * @param aTokenHandle	The handle to copy. 
williamr@2
    79
	 */
williamr@2
    80
	IMPORT_C TCTTokenObjectHandle(const TCTTokenObjectHandle& aTokenHandle);
williamr@2
    81
	
williamr@2
    82
	/** 
williamr@2
    83
	 * Equality operator.
williamr@2
    84
	 *
williamr@2
    85
	 * Tests whether this TCTTokenObjectHandle object is equal to the specified 
williamr@2
    86
	 * TCTTokenObjectHandle object.	
williamr@2
    87
	 *
williamr@2
    88
	 * @param aTokenHandle	The TCTTokenObjectHandle object to be compared.
williamr@2
    89
	 * @return				ETrue, if thisTCTTokenObjectHandle object is equal to 
williamr@2
    90
	 * 						the specified TCTTokenObjectHandle object; EFalse otherwise. 
williamr@2
    91
	 */
williamr@2
    92
	IMPORT_C TBool operator ==(const TCTTokenObjectHandle& aTokenHandle) const;
williamr@2
    93
	
williamr@2
    94
	/** Inequality operator */
williamr@2
    95
	inline TBool operator !=(const TCTTokenObjectHandle& aTokenHandle) const;
williamr@2
    96
 
williamr@2
    97
 public:
williamr@2
    98
	/** The handle that identifies the Token where the object is stored. */
williamr@2
    99
	TCTTokenHandle iTokenHandle;
williamr@2
   100
	
williamr@2
   101
	/** 
williamr@2
   102
	 * The identifier of the object within the Token.
williamr@2
   103
	 *
williamr@2
   104
	 * This is unique within the context of a particular Token and only at a specific 
williamr@2
   105
	 * point in time. 
williamr@2
   106
	 */
williamr@2
   107
	TInt iObjectId;
williamr@2
   108
	};
williamr@2
   109
williamr@2
   110
inline TBool TCTTokenObjectHandle::operator !=(const TCTTokenObjectHandle& aHandle) const
williamr@2
   111
	{
williamr@2
   112
	return !(*this == aHandle);
williamr@2
   113
	}
williamr@2
   114
williamr@2
   115
#endif