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 __MCTTOKENINTERFACE_H__ sl@0: #define __MCTTOKENINTERFACE_H__ sl@0: sl@0: class MCTToken; sl@0: sl@0: /** sl@0: * The base class for all token interfaces. sl@0: * sl@0: * This class provides functionality to interact with the token's reference counting sl@0: * framework. (Interfaces themselves are not reference counted, but the token sl@0: * must remain open while it has open interfaces.) sl@0: * sl@0: * @since v7.0 sl@0: */ sl@0: class MCTTokenInterface sl@0: { sl@0: public: sl@0: /** sl@0: * Gets the associated token. sl@0: * sl@0: * @return The associated token. sl@0: */ sl@0: virtual MCTToken& Token() = 0; sl@0: sl@0: /** sl@0: * Destroys the object. sl@0: * sl@0: * The interface should be destroyed via this method as the destructor is protected. sl@0: * sl@0: * Also takes care of reference counting the token. sl@0: */ sl@0: IMPORT_C void Release(); sl@0: sl@0: protected: sl@0: /** sl@0: * This function should release the interface and all its owned resources. sl@0: * sl@0: * It is called by Release(). The default implementation simply does a 'delete sl@0: * this'. If other behaviour is required (for instance to implement a reference sl@0: * counting system for the interfaces themselves, the interfaces can override sl@0: * this function.) sl@0: */ sl@0: IMPORT_C virtual void DoRelease(); sl@0: sl@0: /** sl@0: * The interface should be destroyed via the Release() sl@0: * function. Hence, this destructor is protected. sl@0: */ sl@0: inline virtual ~MCTTokenInterface() = 0; sl@0: }; sl@0: sl@0: /** Destructor */ sl@0: inline MCTTokenInterface::~MCTTokenInterface() sl@0: { sl@0: } sl@0: sl@0: #endif // __MCTTOKENINTERFACE_H__