sl@0: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: // 
sl@0: // 
sl@0: //
sl@0: 
sl@0: /**
sl@0:  @file UriUtils.h
sl@0:  @publishedAll
sl@0:  @released
sl@0: */
sl@0: 
sl@0: #ifndef __URIUTILS_H__
sl@0: #define __URIUTILS_H__
sl@0: 
sl@0: // System includes
sl@0: //
sl@0: #include <e32base.h>
sl@0: #include <authority8.h>
sl@0: #include <uri8.h>
sl@0: #include <uri16.h>
sl@0: 
sl@0: 
sl@0: /**
sl@0:   Comments :
sl@0:   @publishedAll
sl@0:   @released
sl@0: */
sl@0: class UriUtils
sl@0: 	{
sl@0: public:
sl@0: /** 
sl@0: 	Enum defining a flag used to indicate host type.
sl@0: 	@publishedAll
sl@0: 	@released
sl@0: 	@since 9.1	
sl@0:  */
sl@0: 	enum TUriHostType
sl@0: 		{
sl@0: 		/** 
sl@0: 			Indicates host is of type IPv6. Example: 1080:0:0:0:8:800:200C:417A 
sl@0: 		 */
sl@0: 		EIPv6Host,
sl@0: 		/**
sl@0: 			Indicates host is of type IPv4. Example: 192.168.202.18 
sl@0: 		 */
sl@0: 		EIPv4Host,
sl@0: 		/** 
sl@0: 			Indicates host is in text form. Example: www.mypage.com 
sl@0: 		 */
sl@0: 		ETextHost,
sl@0: 		};
sl@0: 
sl@0: 	IMPORT_C static CUri8* ConvertToInternetFormL(const TUriC16& aUri);
sl@0: 	IMPORT_C static CUri16* ConvertToDisplayFormL(const TUriC8& aUri);
sl@0: 
sl@0: 	IMPORT_C static CUri8* CreateUriL(const TDesC& aUri);
sl@0: 	IMPORT_C static CAuthority8* CreateAuthorityL(const TDesC& aAuthority) ;
sl@0: 
sl@0: 	IMPORT_C static TBool HasInvalidChars(const TDesC8& aData);
sl@0: 	IMPORT_C static TBool HasInvalidChars(const TDesC16& aData);
sl@0: 
sl@0: 	IMPORT_C static TUriHostType HostType(const TDesC8& aHost);
sl@0: 	IMPORT_C static TUriHostType HostType(const TDesC16& aHost);
sl@0: 	IMPORT_C static CUri8* NormaliseUriL(const TUriC8& aUri);
sl@0: 	};
sl@0: 
sl@0: #endif	// __URIUTILS_H__