williamr@2: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: @file TFilterConfigurationIter.h williamr@2: @warning : This file contains Rose Model ID comments - please do not delete williamr@2: */ williamr@2: williamr@2: #ifndef __TFILTERCONFIGURATIONITER_H__ williamr@2: #define __TFILTERCONFIGURATIONITER_H__ williamr@2: williamr@2: // System includes williamr@2: #include williamr@2: williamr@2: // User includes williamr@2: #include williamr@2: williamr@2: // Forward declarations williamr@2: class CHTTPSession; williamr@2: class TSessionFilterInfo; williamr@2: class CFilterConfigurationIterator_UnitTestContext; williamr@2: williamr@2: williamr@2: //##ModelId=3C4C0F45009C williamr@2: class TFilterConfigurationIterator williamr@2: /** williamr@2: This class can only be created and destroyed by the session. It is supplied to the williamr@2: client, if the client wishes to configure the filter that are installed or install williamr@2: filters that must be installed explicitly. The API of the class allows the client to williamr@2: navigate, install, uninstall and query the filter list. The filters visible in this williamr@2: list are only the implicit and explicit filters declared as plugins. This iterator MUST williamr@2: be initialised using the First() method and the return error code checked before any williamr@2: other operations are called. williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: // Methods williamr@2: /** williamr@2: @fn First() williamr@2: Intended Usage: This method sets the current filter to the first filter in the list. williamr@2: This method must be used initially to set the williamr@2: current filter and the returned error code must be noted prior to williamr@2: using any of the methods that query or modify the current filter. williamr@2: @return KErrNone if the first filter is found, KErrNotFound if the filter williamr@2: can't be found or no filters exist williamr@2: @pre Object is constructed williamr@2: @post Current filter is set to the first filter in the list williamr@2: */ williamr@2: //##ModelId=3C4C0F45010C williamr@2: IMPORT_C TInt First(); williamr@2: williamr@2: /** williamr@2: @fn Next() williamr@2: Intended Usage: This method sets the current filter to the next filter in the list. williamr@2: @return KErrNone if the next filter is found, KErrNotFound if the filter williamr@2: can't be found, or no filters exist, or the current filter is at the williamr@2: end of the list. williamr@2: @pre Object is constructed williamr@2: @post Current filter is set to the next filter in the list williamr@2: */ williamr@2: //##ModelId=3C4C0F45010B williamr@2: IMPORT_C TInt Next(); williamr@2: williamr@2: /** williamr@2: @fn AtStart() williamr@2: Intended Usage: This method indicates whether the current filter is the first filter in williamr@2: the list. This method will panic if the iterator has not been initialised williamr@2: using the First() method. williamr@2: @return ETrue if the current filter is the first in the list williamr@2: @pre The iterator has been initialised using the First() method williamr@2: */ williamr@2: //##ModelId=3C4C0F45010A williamr@2: IMPORT_C TBool AtStart(); williamr@2: williamr@2: /** williamr@2: @fn AtEnd() williamr@2: Intended Usage: This method indicates whether the current filter is the last filter in williamr@2: the list. This method will panic if the iterator has not been initialised williamr@2: using the First() method. williamr@2: @return ETrue if the current filter is the last in the list williamr@2: @pre The iterator has been initialised using the First() method williamr@2: */ williamr@2: //##ModelId=3C4C0F450101 williamr@2: IMPORT_C TBool AtEnd(); williamr@2: williamr@2: /** williamr@2: @fn FindByDataType(const TDesC8& aDataType) williamr@2: Intended Usage: This method find the first filter in the list that has a matching data williamr@2: type that is passed in. The method will set the current filter to the williamr@2: filter that matches the data type or if not found the current filter williamr@2: will not change. This method will always begin its search williamr@2: from the beginning of the list. williamr@2: @param aDataType An 8-bit descriptor containing the data type to match the williamr@2: filter plug-in with williamr@2: @return KErrNone is the filter plug-in is found, KErrNotFound if not found williamr@2: @pre Object is constructed williamr@2: @post The current filter is set to the filter that matches the data type williamr@2: */ williamr@2: //##ModelId=3C4C0F4500F8 williamr@2: IMPORT_C TInt FindByDataType(const TDesC8& aDataType); williamr@2: williamr@2: /** williamr@2: @fn CurrentFilterInformation() const williamr@2: Intended Usage: This method will return the information of the current filter. The williamr@2: information is provided in a TFilterInformation structure containing the williamr@2: following information: williamr@2: 1) Display name williamr@2: 2) Data type williamr@2: 3) Version williamr@2: 4) UID williamr@2: 5) Category williamr@2: 6) Install status williamr@2: This method will panic if the iterator has not been initialised using the williamr@2: First() method williamr@2: @return A struct containing the current filter information williamr@2: @pre The iterator has been initialised using the First() method williamr@2: @see TFilterInformation williamr@2: */ williamr@2: //##ModelId=3C4C0F4500F7 williamr@2: IMPORT_C const TFilterInformation CurrentFilterInformation() const; williamr@2: williamr@2: /** williamr@2: @fn InstallCurrentFilter() const williamr@2: Intended Usage: This method will install the current filter. This method will panic if a williamr@2: current filter is not set. williamr@2: @return KErrNone if the filter installed, KErrAlreadyExists if the filter has williamr@2: already been installed, KErrNotFound if the filter cannot be found, williamr@2: KErrNotConnected if the ECom plug-in architecture is not connected, williamr@2: KErrNoMemory is the filter is not installed due to low memory, or any williamr@2: other system-wide error codes. williamr@2: @pre A current filter has been set and is not already installed williamr@2: @post The filter is installed williamr@2: */ williamr@2: //##ModelId=3C4C0F4500F6 williamr@2: IMPORT_C TInt InstallCurrentFilter() const; williamr@2: williamr@2: /** williamr@2: @fn UninstallCurrentFilter() const williamr@2: Intended Usage: This method will uninstall the current filter. This method will panic if williamr@2: a current filter is not set. williamr@2: @return KErrNone is the filter uninstalled correctly, KErrNotFound if the filter williamr@2: has not already been installed williamr@2: @pre A current filter has been set and has already been installed williamr@2: @post The filter is uninstalled williamr@2: */ williamr@2: //##ModelId=3C4C0F4500EF williamr@2: IMPORT_C TInt UninstallCurrentFilter() const; williamr@2: williamr@2: private: // Methods williamr@2: // Friend class williamr@2: friend class CHTTPSession; williamr@2: williamr@2: // Friend class for testing purposes williamr@2: friend class CFilterConfigurationIterator_UnitTestContext; williamr@2: williamr@2: // Standard default constructor, this is private as it is designed so that only williamr@2: // the CHTTPSession object that create it. williamr@2: //##ModelId=3C4C0F4500ED williamr@2: TFilterConfigurationIterator(CHTTPSession* aSession); williamr@2: williamr@2: // Standard destructor, this is private as it is designed so that only the williamr@2: // CHTTPSession object can delete it. williamr@2: //##ModelId=3C4C0F4500EC williamr@2: ~TFilterConfigurationIterator(); williamr@2: williamr@2: private: // Attributes williamr@2: // Pointer to the session implementation. This is not owned. williamr@2: //##ModelId=3C4C0F4500DA williamr@2: CHTTPSession* iSession; williamr@2: williamr@2: // Pointer array containing all the information for all the filter plugins williamr@2: // discovered by ECom. The list is stored and owned by the session. This is williamr@2: // not owned. williamr@2: //##ModelId=3C4C0F4500D0 williamr@2: RPointerArray& iFilterInfoList; williamr@2: williamr@2: // Value conatining the index of the current filter in the list williamr@2: //##ModelId=3C4C0F4500C6 williamr@2: TInt iCurrentFilterIndex; williamr@2: williamr@2: // Value containing the number filters in the list williamr@2: //##ModelId=3C4C0F4500BC williamr@2: TInt iFilterCount; williamr@2: }; williamr@2: williamr@2: #endif // __TFILTERCONFIGURATIONITER_H__