1 // Copyright (c) 2007-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.
14 // Place holder for common constants, type definitions and enums.
25 #ifndef __INETURILISTDEF_H__
26 #define __INETURILISTDEF_H__
37 Types of supported service type.
57 Types of supported list type.
96 /** Exact path match **/
98 /** partial prefix path match **/
99 EPartialPrefixPath =0x04,
100 /** Partial suffix path match **/
101 EPartialSuffixPath =0x05
105 Error codes error numbers -7650 to -7699 have been reserved for InetUriList.
107 static const TInt KErrorBase = -7650;
109 URI already exists in database.
111 static const TInt KErrUriAlreadyExists = KErrorBase;
113 URI not found in database.
115 static const TInt KErrUriNotFound = KErrorBase - 1;
117 Addition of URI failed.
119 static const TInt KErrUriAddFailed = KErrorBase - 2;
121 Removal of URI failed.
123 static const TInt KErrUriRemoveFailed = KErrorBase - 3;
125 Updation of URI properties failed.
127 static const TInt KErrUriUpdateFailed = KErrorBase - 4;
131 static const TInt KErrUriReadOnly = KErrorBase - 5;
133 Service type of URI is missing.
135 static const TInt KErrServiceTypeNotPresent = KErrorBase - 6;
139 static const TInt KErrNotOpen = KErrorBase - 7;
141 Invalid stream handle
143 static const TInt KErrInvalidStreamHandle = KErrorBase - 8;
146 Panic text if handle is not open.
148 _LIT(KInetUriListErrHandleNotOpen, "Handle not open");
153 This class defines the argument parameters for the query operation. It is possible to
154 set the arguments in various combinations. The argument types can be ServiceType,
155 ListType, URI in TDesC8 form, and URIMatch.
176 Bit width of the type.
194 A templated constructor that constructs the query argument.
195 It takes one argument.
197 template < class T0 >
198 explicit inline TQueryArgs ( T0 a0 )
201 iFlags=(Type(a0)<<(( Type(a0))*KBitsPerType));
205 A templated constructor that constructs the query argument.
206 It takes two arguments.
208 template < class T0, class T1 >
209 inline TQueryArgs ( T0 a0, T1 a1 )
213 iFlags=(Type(a0)<<(( Type(a0))*KBitsPerType)) |
214 (Type(a1)<<(( Type(a1))*KBitsPerType));
218 A templated constructor that constructs the query argument.
219 It takes three arguments.
221 template < class T0, class T1, class T2 >
222 inline TQueryArgs ( T0 a0, T1 a1, T2 a2 )
227 iFlags=(Type(a0)<<(Type(a0)*KBitsPerType)) |
228 (Type(a1)<<(Type(a1)*KBitsPerType)) |
229 (Type(a2)<<(Type(a2)*KBitsPerType));
233 A templated constructor that constructs the query argument.
234 It takes four arguments.
236 template < class T0, class T1, class T2, class T3 >
237 inline TQueryArgs ( T0 a0, T1 a1, T2 a2, T3 a3 )
243 iFlags=(Type(a0)<<(Type(a0)*KBitsPerType)) |
244 (Type(a1)<<(Type(a1)*KBitsPerType)) |
245 (Type(a2)<<(Type(a2)*KBitsPerType)) |
246 (Type(a3)<<(Type(a3)*KBitsPerType));
251 Checks whether the flag is set for the given argument type.
255 TBool IsSet ( TArgType aType ) const
257 TInt val = iFlags & ( aType << ( aType * KBitsPerType ) );
258 return iFlags & ( aType << ( aType * KBitsPerType ) );
262 Returns the argument if set, otherwise returns KErrNotFound.
266 TInt Get ( TArgType aType ) const
268 if ( IsSet ( aType ) )
269 return iArgs[aType - 1];
274 Maximum number of arguments. Currently set as 4.
288 TArgType Type ( const TDesC8* )
293 TArgType Type ( InetUriList::TServiceType )
298 TArgType Type ( InetUriList::TListType )
303 TArgType Type ( InetUriList::TURIMatch )
308 void Assign ( const TDesC8* aValue )
310 iArgs[Type(aValue)-1] = (TInt)aValue;
313 void Assign ( InetUriList::TServiceType aValue )
315 iArgs[Type(aValue)-1] = aValue;
318 void Assign ( InetUriList::TListType aValue )
320 iArgs[Type(aValue)-1] = aValue;
323 void Assign ( InetUriList::TURIMatch aValue )
325 iArgs[Type(aValue)-1] = aValue;
329 TInt iArgs [KMaxArguments];
333 #endif // __INETURILISTDEF_H__