sl@0: /* sl@0: * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __TCTTOKENOBJECTHANDLE_H__ sl@0: #define __TCTTOKENOBJECTHANDLE_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: sl@0: /** sl@0: * Defines a handle to an object represented by a class which is a subclass of sl@0: * the MCTTokenObject class. sl@0: * sl@0: * The handle identifies the object, not the instance of the subclass of MCTTokenObject sl@0: * used to manage that object. It is guaranteed to be unique within the context sl@0: * of a specific device (e.g. mobile phone, etc.) at a specific point in time. sl@0: * This limitation in time is due to the fact that objects can be created and sl@0: * destroyed. We cannot guarantee that a handle will still point to the same sl@0: * object after we add or remove one or more objects from the store from which sl@0: * the object comes. However, it is guaranteed that the addition of objects to sl@0: * the store will not affect the validity of the handles that were obtained previously. sl@0: * For instance, if the object is a certificate in a certificate store, the subclass sl@0: * of MCTTokenObject will be CCTCertInfo and the handle will identify the certificate sl@0: * in the certificate store, not the instance of CCTCertInfo. sl@0: * sl@0: * The handle is especially useful for communication across process boundaries. sl@0: * For example: a process (A) can get a handle to an object, and then give the handle sl@0: * to another process (B). This process (B) can then try to get the same object using that handle. sl@0: * sl@0: * @since v7.0 sl@0: */ sl@0: class TCTTokenObjectHandle sl@0: { sl@0: public: sl@0: /** sl@0: * Creates an invalid handle. sl@0: * sl@0: * An invalid handle has an invalid iTokenHandle and an iObjectId equal to 0. sl@0: */ sl@0: IMPORT_C TCTTokenObjectHandle(); sl@0: sl@0: /** sl@0: * Creates a handle. sl@0: * sl@0: * @param aTokenHandle The handle that identifies the Token where the object sl@0: * is stored. sl@0: * @param aObjectId The identifier of the object within the Token. sl@0: */ sl@0: IMPORT_C TCTTokenObjectHandle(TCTTokenHandle aTokenHandle, TInt aObjectId); sl@0: sl@0: /** sl@0: * Copy Constructor. sl@0: * sl@0: * @param aTokenHandle The handle to copy. sl@0: */ sl@0: IMPORT_C TCTTokenObjectHandle(const TCTTokenObjectHandle& aTokenHandle); sl@0: sl@0: /** sl@0: * Equality operator. sl@0: * sl@0: * Tests whether this TCTTokenObjectHandle object is equal to the specified sl@0: * TCTTokenObjectHandle object. sl@0: * sl@0: * @param aTokenHandle The TCTTokenObjectHandle object to be compared. sl@0: * @return ETrue, if thisTCTTokenObjectHandle object is equal to sl@0: * the specified TCTTokenObjectHandle object; EFalse otherwise. sl@0: */ sl@0: IMPORT_C TBool operator ==(const TCTTokenObjectHandle& aTokenHandle) const; sl@0: sl@0: /** Inequality operator */ sl@0: inline TBool operator !=(const TCTTokenObjectHandle& aTokenHandle) const; sl@0: sl@0: public: sl@0: /** The handle that identifies the Token where the object is stored. */ sl@0: TCTTokenHandle iTokenHandle; sl@0: sl@0: /** sl@0: * The identifier of the object within the Token. sl@0: * sl@0: * This is unique within the context of a particular Token and only at a specific sl@0: * point in time. sl@0: */ sl@0: TInt iObjectId; sl@0: }; sl@0: sl@0: inline TBool TCTTokenObjectHandle::operator !=(const TCTTokenObjectHandle& aHandle) const sl@0: { sl@0: return !(*this == aHandle); sl@0: } sl@0: sl@0: #endif