ncdengine/engine/transport/inc/catalogshttpheaders.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_CATALOGSHTTPHEADERS_H
       
    20 #define M_CATALOGSHTTPHEADERS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 
       
    25 class CCatalogsKeyValuePair;
       
    26 class RReadStream;
       
    27 class RWriteStream;
       
    28 
       
    29 /**
       
    30 * Interface for HTTP headers
       
    31 */
       
    32 class MCatalogsHttpHeaders
       
    33     {
       
    34     public:
       
    35     
       
    36         /**
       
    37         * Adds an HTTP header
       
    38         * 
       
    39         * @param aHeader Header name
       
    40         * @param aValue Header data
       
    41         */
       
    42         virtual void AddHeaderL( const TDesC8& aHeader, 
       
    43             const TDesC8& aValue ) = 0;
       
    44         
       
    45         
       
    46         /** 
       
    47         * Removes an HTTP header
       
    48         * 
       
    49         * @param aHeader Header name
       
    50         * @return KErrNotFound if the header was not found
       
    51         */
       
    52         virtual TInt RemoveHeader( const TDesC8& aHeader ) = 0;
       
    53 
       
    54 
       
    55         /**
       
    56         * Adds an HTTP header
       
    57         * 
       
    58         * @param aHeader Header name
       
    59         * @param aValue Header data
       
    60         */
       
    61         virtual void AddHeaderL( const TDesC16& aHeader, 
       
    62             const TDesC16& aValue ) = 0;
       
    63         
       
    64         
       
    65         /** 
       
    66         * Removes an HTTP header
       
    67         * 
       
    68         * @param aHeader Header name
       
    69         * @return KErrNotFound if the header was not found
       
    70         */
       
    71         virtual TInt RemoveHeader( const TDesC16& aHeader ) = 0;
       
    72            
       
    73             
       
    74         /**
       
    75         * Returns an array of current headers
       
    76         *
       
    77         * @return Array of headers
       
    78         */
       
    79         virtual RPointerArray<CCatalogsKeyValuePair>& Headers() = 0;
       
    80         
       
    81 
       
    82         /**
       
    83         * Returns an array of current headers
       
    84         *
       
    85         * @return Array of headers
       
    86         */
       
    87         virtual const RPointerArray<CCatalogsKeyValuePair>& 
       
    88             Headers() const = 0;
       
    89         
       
    90 
       
    91         /**
       
    92         * Searches for the header that matches the key
       
    93         * 
       
    94         * @param aPair Wanted key
       
    95         * @return Header
       
    96         * @exception KErrNotFound if a matching header was not found
       
    97         */        
       
    98         virtual const TDesC8& HeaderByKeyL( const TDesC8& aKey ) const = 0;
       
    99         
       
   100 
       
   101         /**
       
   102         * Searches for the header that matches the key
       
   103         * 
       
   104         * @param aPair Wanted key
       
   105         * @return Header
       
   106         * @exception KErrNotFound if a matching header was not found
       
   107         */        
       
   108         virtual const TDesC8& HeaderByKeyL( const TDesC16& aKey ) const = 0;
       
   109         
       
   110         
       
   111         /**
       
   112          * Externalize
       
   113          *
       
   114          * @param aStream Target stream
       
   115          */
       
   116         virtual void ExternalizeL( RWriteStream& aStream ) const = 0;
       
   117         
       
   118         
       
   119         /**
       
   120          * Internalize
       
   121          *
       
   122          * @param aStream Source stream
       
   123          */
       
   124         virtual void InternalizeL( RReadStream& aStream ) = 0;
       
   125     
       
   126     };
       
   127 
       
   128 #endif // M_CATALOGSHTTPHEADERS_H