1 // Copyright (c) 2008-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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Place holder for common constants, type definitions and enums.
24 #ifndef __INETURILISTDEF_H__
25 #define __INETURILISTDEF_H__
36 Types of supported service type.
56 Types of supported list type.
84 Types of TLD Query type.
91 /** Top Level Domain List type **/
93 /** Top Level Domain Policy data **/
109 /** Exact path match **/
111 /** partial prefix path match **/
112 EPartialPrefixPath =0x04,
113 /** Partial suffix path match **/
114 EPartialSuffixPath =0x05
118 Error codes error numbers -7650 to -7699 have been reserved for InetUriList.
120 static const TInt KErrorBase = -7650;
122 URI already exists in database.
124 static const TInt KErrUriAlreadyExists = KErrorBase;
126 URI not found in database.
128 static const TInt KErrUriNotFound = KErrorBase - 1;
130 Addition of URI failed.
132 static const TInt KErrUriAddFailed = KErrorBase - 2;
134 Removal of URI failed.
136 static const TInt KErrUriRemoveFailed = KErrorBase - 3;
138 Updation of URI properties failed.
140 static const TInt KErrUriUpdateFailed = KErrorBase - 4;
144 static const TInt KErrUriReadOnly = KErrorBase - 5;
146 Service type of URI is missing.
148 static const TInt KErrServiceTypeNotPresent = KErrorBase - 6;
152 static const TInt KErrNotOpen = KErrorBase - 7;
154 Invalid stream handle
156 static const TInt KErrInvalidStreamHandle = KErrorBase - 8;
160 static const TInt KErrTldUriNotPresent = KErrorBase - 9;
162 Query Type of URI is missing.
164 static const TInt KErrTldQueryTypeNotPresent = KErrorBase - 10;
166 Policy Data is not present.
168 static const TInt KErrPolicyDataNotPresent = KErrorBase - 11;
170 TLD list type is not present.
172 static const TInt KErrPolicyListTypeNotPresent = KErrorBase - 12;
174 Requested TLD type is not supported.
176 static const TInt KErrInvalidTLD = KErrorBase - 13;
178 Panic text if handle is not open.
180 _LIT(KInetUriListErrHandleNotOpen, "Handle not open");
182 Panic text if handle is not open.
184 _LIT(KTldInvalidRequest, "Invalid Request");
189 This class defines the argument parameters for the query operation. It is possible to
190 set the arguments in various combinations. The argument types can be ServiceType,
191 ListType, URI in TDesC8 form, and URIMatch.
196 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
220 A templated constructor that constructs the query argument.
221 It takes one argument.
223 template < class T0 >
224 explicit inline TQueryArgs ( T0 a0 )
227 iFlags=(Type(a0)<<(( Type(a0))*KBitsPerType));
231 A templated constructor that constructs the query argument.
232 It takes two arguments.
234 template < class T0, class T1 >
235 inline TQueryArgs ( T0 a0, T1 a1 )
239 iFlags=(Type(a0)<<(( Type(a0))*KBitsPerType)) |
240 (Type(a1)<<(( Type(a1))*KBitsPerType));
244 A templated constructor that constructs the query argument.
245 It takes three arguments.
247 template < class T0, class T1, class T2 >
248 inline TQueryArgs ( T0 a0, T1 a1, T2 a2 )
253 iFlags=(Type(a0)<<(Type(a0)*KBitsPerType)) |
254 (Type(a1)<<(Type(a1)*KBitsPerType)) |
255 (Type(a2)<<(Type(a2)*KBitsPerType));
259 A templated constructor that constructs the query argument.
260 It takes four arguments.
262 template < class T0, class T1, class T2, class T3 >
263 inline TQueryArgs ( T0 a0, T1 a1, T2 a2, T3 a3 )
269 iFlags=(Type(a0)<<(Type(a0)*KBitsPerType)) |
270 (Type(a1)<<(Type(a1)*KBitsPerType)) |
271 (Type(a2)<<(Type(a2)*KBitsPerType)) |
272 (Type(a3)<<(Type(a3)*KBitsPerType));
276 Returns the argument if set, otherwise returns KErrNotFound.
278 TInt Get ( TArgType aType ) const
280 if ( IsSet ( aType ) )
281 return iArgs[aType - 1];
287 Bit width of the type.
294 Maximum number of arguments. Currently set as 4.
301 Checks whether the flag is set for the given argument type.
303 TBool IsSet ( TArgType aType ) const
305 TInt val = iFlags & ( aType << ( aType * KBitsPerType ) );
306 return iFlags & ( aType << ( aType * KBitsPerType ) );
309 TArgType Type ( const TDesC8* )
314 TArgType Type ( InetUriList::TServiceType )
319 TArgType Type ( InetUriList::TListType )
324 TArgType Type ( InetUriList::TURIMatch )
329 void Assign ( const TDesC8* aValue )
331 iArgs[Type(aValue)-1] = (TInt)aValue;
334 void Assign ( InetUriList::TServiceType aValue )
336 iArgs[Type(aValue)-1] = aValue;
339 void Assign ( InetUriList::TListType aValue )
341 iArgs[Type(aValue)-1] = aValue;
344 void Assign ( InetUriList::TURIMatch aValue )
346 iArgs[Type(aValue)-1] = aValue;
350 TInt iArgs [KMaxArguments];
372 Bit width of the type.
390 A templated constructor that constructs the query argument.
391 It takes one argument.
393 template < class T0 >
394 explicit inline TQueryArgs ( T0 a0 )
397 iFlags=(Type(a0)<<(( Type(a0))*KBitsPerType));
401 A templated constructor that constructs the query argument.
402 It takes two arguments.
404 template < class T0, class T1 >
405 inline TQueryArgs ( T0 a0, T1 a1 )
409 iFlags=(Type(a0)<<(( Type(a0))*KBitsPerType)) |
410 (Type(a1)<<(( Type(a1))*KBitsPerType));
414 A templated constructor that constructs the query argument.
415 It takes three arguments.
417 template < class T0, class T1, class T2 >
418 inline TQueryArgs ( T0 a0, T1 a1, T2 a2 )
423 iFlags=(Type(a0)<<(Type(a0)*KBitsPerType)) |
424 (Type(a1)<<(Type(a1)*KBitsPerType)) |
425 (Type(a2)<<(Type(a2)*KBitsPerType));
429 A templated constructor that constructs the query argument.
430 It takes four arguments.
432 template < class T0, class T1, class T2, class T3 >
433 inline TQueryArgs ( T0 a0, T1 a1, T2 a2, T3 a3 )
439 iFlags=(Type(a0)<<(Type(a0)*KBitsPerType)) |
440 (Type(a1)<<(Type(a1)*KBitsPerType)) |
441 (Type(a2)<<(Type(a2)*KBitsPerType)) |
442 (Type(a3)<<(Type(a3)*KBitsPerType));
447 Checks whether the flag is set for the given argument type.
451 TBool IsSet ( TArgType aType ) const
453 TInt val = iFlags & ( aType << ( aType * KBitsPerType ) );
454 return iFlags & ( aType << ( aType * KBitsPerType ) );
458 Returns the argument if set, otherwise returns KErrNotFound.
462 TInt Get ( TArgType aType ) const
464 if ( IsSet ( aType ) )
465 return iArgs[aType - 1];
470 Maximum number of arguments. Currently set as 4.
484 TArgType Type ( const TDesC8* )
489 TArgType Type ( InetUriList::TServiceType )
494 TArgType Type ( InetUriList::TListType )
499 TArgType Type ( InetUriList::TURIMatch )
504 void Assign ( const TDesC8* aValue )
506 iArgs[Type(aValue)-1] = (TInt)aValue;
509 void Assign ( InetUriList::TServiceType aValue )
511 iArgs[Type(aValue)-1] = aValue;
514 void Assign ( InetUriList::TListType aValue )
516 iArgs[Type(aValue)-1] = aValue;
519 void Assign ( InetUriList::TURIMatch aValue )
521 iArgs[Type(aValue)-1] = aValue;
525 TInt iArgs [KMaxArguments];
530 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
532 #endif // __INETURILISTDEF_H__