epoc32/include/mw/ineturilistdef.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/mw/ineturilistdef.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/mw/ineturilistdef.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,9 +1,9 @@
     1.4 -// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6  // All rights reserved.
     1.7  // This component and the accompanying materials are made available
     1.8 -// 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
     1.9 +// under the terms of "Eclipse Public License v1.0"
    1.10  // which accompanies this distribution, and is available
    1.11 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.13  //
    1.14  // Initial Contributors:
    1.15  // Nokia Corporation - initial contribution.
    1.16 @@ -13,8 +13,7 @@
    1.17  // Description:
    1.18  // Place holder for common constants, type definitions and enums.
    1.19  //
    1.20 -
    1.21 -
    1.22 +//
    1.23  
    1.24  /**
    1.25   @file
    1.26 @@ -82,6 +81,20 @@
    1.27  		};
    1.28  	
    1.29  	/**
    1.30 +	Types of TLD Query type.
    1.31 +	
    1.32 +	@publishedAll
    1.33 +	@released
    1.34 +	*/
    1.35 +	enum TTLDQueryType
    1.36 +		{
    1.37 +		/** Top Level Domain List type **/
    1.38 +		EPolicyListType=0x01,
    1.39 +		/** Top Level Domain Policy data **/
    1.40 +		EPolicyCharSet=0x02
    1.41 +		};
    1.42 +	
    1.43 +	/**
    1.44  	Types of matches.
    1.45  	
    1.46  	@publishedAll
    1.47 @@ -141,11 +154,34 @@
    1.48  	Invalid stream handle
    1.49  	*/
    1.50  	static const TInt KErrInvalidStreamHandle 		= KErrorBase - 8;
    1.51 -	
    1.52 +	/** 
    1.53 +	Tld URI is missing.
    1.54 +	*/
    1.55 +	static const TInt KErrTldUriNotPresent 			= KErrorBase - 9;
    1.56 +	/** 
    1.57 +	Query Type of URI is missing.
    1.58 +	*/
    1.59 +	static const TInt KErrTldQueryTypeNotPresent 	= KErrorBase - 10;
    1.60 +	/** 
    1.61 +	Policy Data is not present.
    1.62 +	*/
    1.63 +	static const TInt KErrPolicyDataNotPresent 		= KErrorBase - 11;	
    1.64 +	/** 
    1.65 +	TLD list type is not present.
    1.66 +	*/
    1.67 +	static const TInt KErrPolicyListTypeNotPresent	= KErrorBase - 12;	
    1.68 +	/** 
    1.69 +	Requested TLD  type is not supported.
    1.70 +	*/
    1.71 +	static const TInt KErrInvalidTLD				= KErrorBase - 13;	
    1.72  	/** 
    1.73  	Panic text if handle is not open.
    1.74  	*/
    1.75  	_LIT(KInetUriListErrHandleNotOpen,		"Handle not open");
    1.76 +	/** 
    1.77 +	Panic text if handle is not open.
    1.78 +	*/
    1.79 +	_LIT(KTldInvalidRequest,				"Invalid Request");
    1.80  
    1.81  	}
    1.82  
    1.83 @@ -157,13 +193,12 @@
    1.84  @publishedAll
    1.85  @released
    1.86  */
    1.87 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.88  class TQueryArgs
    1.89  	{
    1.90 -	public:
    1.91 +  	public:
    1.92  		/**
    1.93 -		The argument types.
    1.94 -		
    1.95 -		@internalComponent
    1.96 +		The argument types.	
    1.97  		*/
    1.98  		enum TArgType
    1.99  			{
   1.100 @@ -172,15 +207,6 @@
   1.101  			EListType,
   1.102  			EURIMatch
   1.103  			};
   1.104 -		/**
   1.105 -		Bit width of the type.
   1.106 -		
   1.107 -		@internalComponent
   1.108 -		*/
   1.109 -		enum 
   1.110 -			{
   1.111 -			KBitsPerType = 3			
   1.112 -			};
   1.113  		
   1.114  		/**
   1.115  		Default constructor
   1.116 @@ -246,7 +272,177 @@
   1.117  					(Type(a3)<<(Type(a3)*KBitsPerType));
   1.118  			}
   1.119  		
   1.120 +		/**
   1.121 +		Returns the argument if set, otherwise returns KErrNotFound.		
   1.122 +		*/		
   1.123 +		TInt Get ( TArgType aType ) const
   1.124 +			{
   1.125 +			if ( IsSet ( aType ) )
   1.126 +				return iArgs[aType - 1];
   1.127 +			return KErrNotFound;			
   1.128 +			}
   1.129 +							
   1.130 +	private:		
   1.131 +		/**
   1.132 +		Bit width of the type.		
   1.133 +		*/
   1.134 +		enum 
   1.135 +			{
   1.136 +			KBitsPerType = 3			
   1.137 +			};
   1.138 +		/**
   1.139 +		Maximum number of arguments. Currently set as 4.
   1.140 +		*/
   1.141 +		enum
   1.142 +			{
   1.143 +			KMaxArguments = 4
   1.144 +			};
   1.145 +		/**
   1.146 +		Checks whether the flag is set for the given argument type.
   1.147 +		*/
   1.148 +		TBool IsSet ( TArgType aType ) const
   1.149 +			{
   1.150 +			TInt val = iFlags & ( aType << ( aType  * KBitsPerType ) );
   1.151 +			return iFlags & ( aType << ( aType  * KBitsPerType ) );
   1.152 +			}
   1.153  
   1.154 +		TArgType Type ( const TDesC8* )
   1.155 +			{
   1.156 +			return EUri;				
   1.157 +			}
   1.158 +			
   1.159 +		TArgType Type ( InetUriList::TServiceType )
   1.160 +			{
   1.161 +			return EServiceType;				
   1.162 +			}
   1.163 +
   1.164 +		TArgType Type ( InetUriList::TListType )
   1.165 +			{
   1.166 +			return EListType;				
   1.167 +			}
   1.168 +
   1.169 +		TArgType Type ( InetUriList::TURIMatch )
   1.170 +			{
   1.171 +			return EURIMatch;				
   1.172 +			}
   1.173 +		
   1.174 +		void Assign ( const TDesC8* aValue )
   1.175 +			{
   1.176 +			iArgs[Type(aValue)-1] = (TInt)aValue;
   1.177 +			}
   1.178 +			
   1.179 +		void Assign ( InetUriList::TServiceType aValue )
   1.180 +			{
   1.181 +			iArgs[Type(aValue)-1] = aValue;
   1.182 +			}
   1.183 +			
   1.184 +		void Assign ( InetUriList::TListType aValue )
   1.185 +			{
   1.186 +			iArgs[Type(aValue)-1] = aValue;
   1.187 +			}
   1.188 +			
   1.189 +		void Assign ( InetUriList::TURIMatch aValue )
   1.190 +			{
   1.191 +			iArgs[Type(aValue)-1] = aValue;
   1.192 +			}
   1.193 +			
   1.194 +	private:	
   1.195 +		TInt iArgs [KMaxArguments];
   1.196 +		TInt iFlags;
   1.197 +	};
   1.198 +
   1.199 +#else
   1.200 +
   1.201 +class TQueryArgs
   1.202 +	{
   1.203 +	public:
   1.204 +		/**
   1.205 +		The argument types.
   1.206 +		
   1.207 +		@internalComponent
   1.208 +		*/
   1.209 +		enum TArgType
   1.210 +			{
   1.211 +			EUri = 1,
   1.212 +			EServiceType,
   1.213 +			EListType,
   1.214 +			EURIMatch
   1.215 +			};
   1.216 +		/**
   1.217 +		Bit width of the type.
   1.218 +		
   1.219 +		@internalComponent
   1.220 +		*/
   1.221 +		enum 
   1.222 +			{
   1.223 +			KBitsPerType = 3			
   1.224 +			};
   1.225 +		
   1.226 +		/**
   1.227 +		Default constructor
   1.228 +		*/
   1.229 +		inline TQueryArgs ()
   1.230 +			:iFlags ( 0 )
   1.231 +			{}
   1.232 +
   1.233 +
   1.234 +		/**
   1.235 +		A templated constructor that constructs the query argument.
   1.236 +		It takes one argument.
   1.237 +		*/
   1.238 +		template < class T0 >
   1.239 +		explicit inline TQueryArgs ( T0 a0 )
   1.240 +			{
   1.241 +			Assign ( a0 );
   1.242 +			iFlags=(Type(a0)<<(( Type(a0))*KBitsPerType));
   1.243 +			}
   1.244 +
   1.245 +		/**
   1.246 +		A templated constructor that constructs the query argument.
   1.247 +		It takes two arguments.
   1.248 +		*/
   1.249 +		template < class T0, class T1 >
   1.250 +		inline TQueryArgs ( T0 a0, T1 a1 )
   1.251 +			{
   1.252 +			Assign ( a0 );
   1.253 +			Assign ( a1 );
   1.254 +			iFlags=(Type(a0)<<(( Type(a0))*KBitsPerType)) |
   1.255 +					(Type(a1)<<(( Type(a1))*KBitsPerType));
   1.256 +			}
   1.257 +
   1.258 +		/**
   1.259 +		A templated constructor that constructs the query argument.
   1.260 +		It takes three arguments.
   1.261 +		*/
   1.262 +		template < class T0, class T1, class T2 >
   1.263 +		inline TQueryArgs ( T0 a0, T1 a1, T2 a2 )
   1.264 +			{
   1.265 +			Assign ( a0 );
   1.266 +			Assign ( a1 );
   1.267 +			Assign ( a2 );
   1.268 +			iFlags=(Type(a0)<<(Type(a0)*KBitsPerType)) | 
   1.269 +					(Type(a1)<<(Type(a1)*KBitsPerType)) |
   1.270 +					(Type(a2)<<(Type(a2)*KBitsPerType));
   1.271 +			}
   1.272 +
   1.273 +		/**
   1.274 +		A templated constructor that constructs the query argument.
   1.275 +		It takes four arguments.
   1.276 +		*/
   1.277 +		template < class T0, class T1, class T2, class T3 >
   1.278 +		inline TQueryArgs ( T0 a0, T1 a1, T2 a2, T3 a3 )
   1.279 +			{
   1.280 +			Assign ( a0 );
   1.281 +			Assign ( a1 );
   1.282 +			Assign ( a2 );
   1.283 +			Assign ( a3 );				
   1.284 +			iFlags=(Type(a0)<<(Type(a0)*KBitsPerType)) | 
   1.285 +					(Type(a1)<<(Type(a1)*KBitsPerType)) |
   1.286 +					(Type(a2)<<(Type(a2)*KBitsPerType)) |
   1.287 +					(Type(a3)<<(Type(a3)*KBitsPerType));
   1.288 +			}
   1.289 +
   1.290 +			
   1.291  		/**
   1.292  		Checks whether the flag is set for the given argument type.
   1.293  				
   1.294 @@ -272,7 +468,7 @@
   1.295  		
   1.296  		/**
   1.297  		Maximum number of arguments. Currently set as 4.
   1.298 -		
   1.299 +
   1.300  		@internalComponent
   1.301  		*/
   1.302  		enum
   1.303 @@ -327,7 +523,10 @@
   1.304  			
   1.305  	private:	
   1.306  		TInt iArgs [KMaxArguments];
   1.307 -		TInt iFlags;			
   1.308 +		TInt iFlags;
   1.309  	};
   1.310  
   1.311 +
   1.312 +#endif	//SYMBIAN_ENABLE_SPLIT_HEADERS
   1.313 +	
   1.314  #endif // __INETURILISTDEF_H__