epoc32/include/authority16.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100 (2010-03-31)
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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 "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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // This file contains the API definition for the classes TAuthorityC16 and
    15 // CAuthority16. These classes provide non-modifying (TAuthorityC16) and 
    16 // modifying (CAuthority16) functionality for the components of an
    17 // Authority as described in RFC2396.
    18 // 
    19 //
    20 
    21 /**
    22  @file Authority16.h
    23  @publishedAll
    24  @deprecated Deprecated in 9.1
    25 */
    26 
    27 #ifndef __AUTHORITY16_H__
    28 #define __AUTHORITY16_H__
    29 
    30 // System includes
    31 //
    32 #include <e32base.h>
    33 #include <authoritycommon.h>
    34 
    35 
    36 /**
    37 Dependencies : TAuthorityComponent.
    38 Comments : Provides non-modifying functionality on the components of an authority 
    39 object as defined in RFC2396. There are 3 components; userinfo, host and port.
    40 
    41 The	object holds descriptor pointers to the parsed authority components and a descriptor 
    42 pointer to the authority. It is non-owning. It uses 16-bit descriptors.
    43 
    44 The functionality provided by this API allows the authority components to be extracted
    45 from the parsed authority, checked for their presence in the authority and be compared 
    46 with those in another TAuthorityC16 object.
    47 @publishedAll
    48 @deprecated Deprecated in 9.1
    49 @since 6.0
    50 */
    51 class TAuthorityC16
    52 	{
    53 public:	// Methods
    54 
    55 	IMPORT_C const TDesC16& Extract(TAuthorityComponent aComponent) const;
    56 	IMPORT_C TBool IsPresent(TAuthorityComponent aComponent) const;
    57 	IMPORT_C TInt Compare(const TAuthorityC16& aAuthority, TAuthorityComponent aComponent) const;
    58 	IMPORT_C const TDesC16& AuthorityDes() const;
    59 	IMPORT_C HBufC* DisplayFormL(TAuthorityComponent aComponent = EAuthorityComplete ) const;
    60 
    61 protected:	// Methods
    62 
    63 
    64 	IMPORT_C TAuthorityC16();
    65 
    66 	void Reset();
    67 
    68 protected:	// Attributes
    69 
    70 	/** 
    71 		The array of descriptor pointers to the authority components.
    72 	 */
    73 	TPtrC16	iComponent[EAuthorityMaxComponents];
    74 
    75 	/** 
    76 		The descriptor pointer to the authority.
    77 	 */
    78 	TPtrC16	iAuthorityDes;
    79 
    80 /**
    81 	A friend class.
    82 	@see		CAuthority16
    83 	@since		6.0
    84  */
    85 	friend class CAuthority16;
    86 
    87 /**
    88 	A friend class used for testing.
    89 	@see		TAuthorityC16StateAccessor
    90 	@since		6.0
    91  */
    92 	friend class TAuthorityC16StateAccessor;	
    93 
    94 	};
    95 
    96 /**
    97 Dependencies : TAuthorityC16
    98 Comments : Provides functionality to parse a descriptor into the components of an 
    99 authority as defined in RFC2396. There are 3 components; userinfo, host and port.
   100 
   101 This uses 16-bit descriptors.
   102 
   103 Format of an authority is; [userinfo@]host[:port]
   104 
   105 @warning The descriptor that is parsed by an object of this class will be referenced 
   106 by that object. If the original descriptor is no longer in scope there will be undefined 
   107 behaviour.
   108 @publishedAll
   109 @deprecated Deprecated in 9.1. Use UriUtils::CreateAuthorityL() instead
   110 @since 6.0
   111 */
   112 class TAuthorityParser16 : public TAuthorityC16
   113 	{
   114 public:	// Methods
   115 
   116 	IMPORT_C TAuthorityParser16();
   117 	IMPORT_C TInt Parse(const TDesC16& aAuthority);
   118 
   119 	};
   120 
   121 /**
   122 Dependencies : CBase, TAuthorityC16.
   123 Comments : Provides modifying functionality on the components of an authority object, as
   124 defined in RFC2396. There are 3 components; userinfo, host and port.
   125 
   126 The	object holds parsed authority information. It is owning. It uses 16-bit descriptors.
   127 
   128 The functionality provided by this API allows the authority components to be set or removed 
   129 from this parsed authority. Also, it provides a reference to TAuthorityC16 object so that 
   130 the non-modifying functionality can be used.
   131 @publishedAll
   132 @deprecated Deprecated in 9.1
   133 @since 6.0
   134 */
   135 class CAuthority16 : public CBase
   136 	{
   137 public: // Methods
   138 
   139 	IMPORT_C static CAuthority16* NewL(const TAuthorityC16& aAuthority);
   140 	IMPORT_C static CAuthority16* NewLC(const TAuthorityC16& aAuthority);
   141 	IMPORT_C static CAuthority16* NewL();
   142 	IMPORT_C static CAuthority16* NewLC();
   143 	IMPORT_C ~CAuthority16();
   144 
   145 	IMPORT_C const TAuthorityC16& Authority() const;
   146 	IMPORT_C void SetComponentL(const TDesC16& aData, TAuthorityComponent aComponent);
   147 	IMPORT_C void SetAndEscapeComponentL(const TDesC16& aData, TAuthorityComponent aComponent);
   148 	IMPORT_C void RemoveComponentL(TAuthorityComponent aComponent);
   149 
   150 private:	// Methods
   151 
   152 	CAuthority16(const TAuthorityC16& aAuthority);
   153 
   154 	void ConstructL();
   155 
   156 	void FormAuthorityL();
   157 
   158 private:	// Attributes
   159 
   160 	/** 
   161 		The descriptor buffer that contains the authority.
   162 	 */
   163 	HBufC16*		iAuthorityBuf;
   164 
   165 	/** 
   166 		The parsed authority object.
   167 	 */
   168 	TAuthorityC16	iAuthority;
   169 
   170 /**
   171 	A friend class used for testing.
   172 	@see		TAuthority16StateAccessor
   173 	@since		6.0
   174  */
   175 	friend class TAuthority16StateAccessor;
   176 
   177 	};
   178 /** 	
   179 Do not use. Use TAuthorityC8 instead
   180 @publishedAll
   181 @deprecated Deprecated in 9.1
   182  */
   183 typedef TAuthorityC16		TAuthorityC;
   184 
   185 /** 	
   186 Do not use. Use TAuthorityParser8 instead
   187 @publishedAll
   188 @deprecated Deprecated in 9.1
   189  */
   190 typedef TAuthorityParser16	TAuthorityParser;
   191 
   192 /**
   193 Do not use. Use CAuthority8 instead
   194 @publishedAll
   195 @deprecated Deprecated in 9.1
   196  */
   197 typedef CAuthority16 CAuthority;
   198 
   199 #endif	// __AUTHORITY16_H__