1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // 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
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @file TFilterConfigurationIter.h
20 @warning : This file contains Rose Model ID comments - please do not delete
23 #ifndef __TFILTERCONFIGURATIONITER_H__
24 #define __TFILTERCONFIGURATIONITER_H__
30 #include <http/tfilterinformation.h>
32 // Forward declarations
34 class TSessionFilterInfo;
35 class CFilterConfigurationIterator_UnitTestContext;
38 //##ModelId=3C4C0F45009C
39 class TFilterConfigurationIterator
41 This class can only be created and destroyed by the session. It is supplied to the
42 client, if the client wishes to configure the filter that are installed or install
43 filters that must be installed explicitly. The API of the class allows the client to
44 navigate, install, uninstall and query the filter list. The filters visible in this
45 list are only the implicit and explicit filters declared as plugins. This iterator MUST
46 be initialised using the First() method and the return error code checked before any
47 other operations are called.
55 Intended Usage: This method sets the current filter to the first filter in the list.
56 This method must be used initially to set the
57 current filter and the returned error code must be noted prior to
58 using any of the methods that query or modify the current filter.
59 @return KErrNone if the first filter is found, KErrNotFound if the filter
60 can't be found or no filters exist
61 @pre Object is constructed
62 @post Current filter is set to the first filter in the list
64 //##ModelId=3C4C0F45010C
65 IMPORT_C TInt First();
69 Intended Usage: This method sets the current filter to the next filter in the list.
70 @return KErrNone if the next filter is found, KErrNotFound if the filter
71 can't be found, or no filters exist, or the current filter is at the
73 @pre Object is constructed
74 @post Current filter is set to the next filter in the list
76 //##ModelId=3C4C0F45010B
81 Intended Usage: This method indicates whether the current filter is the first filter in
82 the list. This method will panic if the iterator has not been initialised
83 using the First() method.
84 @return ETrue if the current filter is the first in the list
85 @pre The iterator has been initialised using the First() method
87 //##ModelId=3C4C0F45010A
88 IMPORT_C TBool AtStart();
92 Intended Usage: This method indicates whether the current filter is the last filter in
93 the list. This method will panic if the iterator has not been initialised
94 using the First() method.
95 @return ETrue if the current filter is the last in the list
96 @pre The iterator has been initialised using the First() method
98 //##ModelId=3C4C0F450101
99 IMPORT_C TBool AtEnd();
102 @fn FindByDataType(const TDesC8& aDataType)
103 Intended Usage: This method find the first filter in the list that has a matching data
104 type that is passed in. The method will set the current filter to the
105 filter that matches the data type or if not found the current filter
106 will not change. This method will always begin its search
107 from the beginning of the list.
108 @param aDataType An 8-bit descriptor containing the data type to match the
110 @return KErrNone is the filter plug-in is found, KErrNotFound if not found
111 @pre Object is constructed
112 @post The current filter is set to the filter that matches the data type
114 //##ModelId=3C4C0F4500F8
115 IMPORT_C TInt FindByDataType(const TDesC8& aDataType);
118 @fn CurrentFilterInformation() const
119 Intended Usage: This method will return the information of the current filter. The
120 information is provided in a TFilterInformation structure containing the
121 following information:
128 This method will panic if the iterator has not been initialised using the
130 @return A struct containing the current filter information
131 @pre The iterator has been initialised using the First() method
132 @see TFilterInformation
134 //##ModelId=3C4C0F4500F7
135 IMPORT_C const TFilterInformation CurrentFilterInformation() const;
138 @fn InstallCurrentFilter() const
139 Intended Usage: This method will install the current filter. This method will panic if a
140 current filter is not set.
141 @return KErrNone if the filter installed, KErrAlreadyExists if the filter has
142 already been installed, KErrNotFound if the filter cannot be found,
143 KErrNotConnected if the ECom plug-in architecture is not connected,
144 KErrNoMemory is the filter is not installed due to low memory, or any
145 other system-wide error codes.
146 @pre A current filter has been set and is not already installed
147 @post The filter is installed
149 //##ModelId=3C4C0F4500F6
150 IMPORT_C TInt InstallCurrentFilter() const;
153 @fn UninstallCurrentFilter() const
154 Intended Usage: This method will uninstall the current filter. This method will panic if
155 a current filter is not set.
156 @return KErrNone is the filter uninstalled correctly, KErrNotFound if the filter
157 has not already been installed
158 @pre A current filter has been set and has already been installed
159 @post The filter is uninstalled
161 //##ModelId=3C4C0F4500EF
162 IMPORT_C TInt UninstallCurrentFilter() const;
166 friend class CHTTPSession;
168 // Friend class for testing purposes
169 friend class CFilterConfigurationIterator_UnitTestContext;
171 // Standard default constructor, this is private as it is designed so that only
172 // the CHTTPSession object that create it.
173 //##ModelId=3C4C0F4500ED
174 TFilterConfigurationIterator(CHTTPSession* aSession);
176 // Standard destructor, this is private as it is designed so that only the
177 // CHTTPSession object can delete it.
178 //##ModelId=3C4C0F4500EC
179 ~TFilterConfigurationIterator();
181 private: // Attributes
182 // Pointer to the session implementation. This is not owned.
183 //##ModelId=3C4C0F4500DA
184 CHTTPSession* iSession;
186 // Pointer array containing all the information for all the filter plugins
187 // discovered by ECom. The list is stored and owned by the session. This is
189 //##ModelId=3C4C0F4500D0
190 RPointerArray<TSessionFilterInfo>& iFilterInfoList;
192 // Value conatining the index of the current filter in the list
193 //##ModelId=3C4C0F4500C6
194 TInt iCurrentFilterIndex;
196 // Value containing the number filters in the list
197 //##ModelId=3C4C0F4500BC
201 #endif // __TFILTERCONFIGURATIONITER_H__