epoc32/include/ct/tcttokenobjecthandle.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/ct/tcttokenobjecthandle.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/ct/tcttokenobjecthandle.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,115 @@
     1.4 -tcttokenobjecthandle.h
     1.5 +/*
     1.6 +* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Eclipse Public License v1.0"
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description: 
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +
    1.24 +
    1.25 +/**
    1.26 + @file
    1.27 + @publishedAll
    1.28 + @released
    1.29 +*/
    1.30 +
    1.31 +#ifndef __TCTTOKENOBJECTHANDLE_H__
    1.32 +#define __TCTTOKENOBJECTHANDLE_H__
    1.33 +
    1.34 +#include <e32std.h>
    1.35 +#include <ct/tcttokenhandle.h>
    1.36 +
    1.37 +
    1.38 +/** 
    1.39 + * Defines a handle to an object represented by a class which is a subclass of 
    1.40 + * the MCTTokenObject class.
    1.41 + * 
    1.42 + * The handle identifies the object, not the instance of the subclass of MCTTokenObject 
    1.43 + * used to manage that object. It is guaranteed to be unique within the context 
    1.44 + * of a specific device (e.g. mobile phone, etc.) at a specific point in time. 
    1.45 + * This limitation in time is due to the fact that objects can be created and 
    1.46 + * destroyed. We cannot guarantee that a handle will still point to the same 
    1.47 + * object after we add or remove one or more objects from the store from which 
    1.48 + * the object comes. However, it is guaranteed that the addition of objects to 
    1.49 + * the store will not affect the validity of the handles that were obtained previously. 
    1.50 + * For instance, if the object is a certificate in a certificate store, the subclass 
    1.51 + * of MCTTokenObject will be CCTCertInfo and the handle will identify the certificate 
    1.52 + * in the certificate store, not the instance of CCTCertInfo.
    1.53 + * 
    1.54 + * The handle is especially useful for communication across process boundaries. 
    1.55 + * For example: a process (A) can get a handle to an object, and then give the handle 
    1.56 + * to another process (B). This process (B) can then try to get the same object using that handle. 
    1.57 + *
    1.58 + * @since v7.0 
    1.59 + */
    1.60 +class TCTTokenObjectHandle
    1.61 +	{
    1.62 +public:
    1.63 +	/** 
    1.64 +	 * Creates an invalid handle.
    1.65 +	 *
    1.66 +	 * An invalid handle has an invalid iTokenHandle and an iObjectId equal to 0. 
    1.67 +	 */
    1.68 +	IMPORT_C TCTTokenObjectHandle();
    1.69 +	
    1.70 +	/** 
    1.71 +	 * Creates a handle.
    1.72 +	 *
    1.73 +	 * @param aTokenHandle	The handle that identifies the Token where the object 
    1.74 +	 * 						is stored.
    1.75 +	 * @param aObjectId		The identifier of the object within the Token. 
    1.76 +	 */
    1.77 +	IMPORT_C TCTTokenObjectHandle(TCTTokenHandle aTokenHandle, TInt aObjectId);
    1.78 +	
    1.79 +	/** 
    1.80 +	 * Copy Constructor.
    1.81 +	 *
    1.82 +	 * @param aTokenHandle	The handle to copy. 
    1.83 +	 */
    1.84 +	IMPORT_C TCTTokenObjectHandle(const TCTTokenObjectHandle& aTokenHandle);
    1.85 +	
    1.86 +	/** 
    1.87 +	 * Equality operator.
    1.88 +	 *
    1.89 +	 * Tests whether this TCTTokenObjectHandle object is equal to the specified 
    1.90 +	 * TCTTokenObjectHandle object.	
    1.91 +	 *
    1.92 +	 * @param aTokenHandle	The TCTTokenObjectHandle object to be compared.
    1.93 +	 * @return				ETrue, if thisTCTTokenObjectHandle object is equal to 
    1.94 +	 * 						the specified TCTTokenObjectHandle object; EFalse otherwise. 
    1.95 +	 */
    1.96 +	IMPORT_C TBool operator ==(const TCTTokenObjectHandle& aTokenHandle) const;
    1.97 +	
    1.98 +	/** Inequality operator */
    1.99 +	inline TBool operator !=(const TCTTokenObjectHandle& aTokenHandle) const;
   1.100 + 
   1.101 + public:
   1.102 +	/** The handle that identifies the Token where the object is stored. */
   1.103 +	TCTTokenHandle iTokenHandle;
   1.104 +	
   1.105 +	/** 
   1.106 +	 * The identifier of the object within the Token.
   1.107 +	 *
   1.108 +	 * This is unique within the context of a particular Token and only at a specific 
   1.109 +	 * point in time. 
   1.110 +	 */
   1.111 +	TInt iObjectId;
   1.112 +	};
   1.113 +
   1.114 +inline TBool TCTTokenObjectHandle::operator !=(const TCTTokenObjectHandle& aHandle) const
   1.115 +	{
   1.116 +	return !(*this == aHandle);
   1.117 +	}
   1.118 +
   1.119 +#endif