ncdengine/engine/transport/inc/catalogshttpconfig.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_CATALOGSHTTPCONFIG_H
       
    20 #define M_CATALOGSHTTPCONFIG_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "catalogstransporttypes.h"
       
    24 #include "catalogshttptypes.h"
       
    25 
       
    26 class MCatalogsHttpObserver;
       
    27 class MCatalogsHttpHeaders;
       
    28 class RReadStream;
       
    29 class RWriteStream;
       
    30 class TCatalogsConnectionMethod;
       
    31 
       
    32 
       
    33 /**
       
    34 * Interface for setting HTTP configurations
       
    35 */
       
    36 class MCatalogsHttpConfig
       
    37     {
       
    38     public:
       
    39     
       
    40         /**
       
    41         * Set operation priority
       
    42         *
       
    43         * @param aPriority Operation priority
       
    44         */        
       
    45         virtual void SetPriority( TCatalogsTransportPriority aPriority ) = 0;    
       
    46     
       
    47         
       
    48         /**
       
    49         * Returns the operation priority
       
    50         *
       
    51         * @return Operation priority
       
    52         */
       
    53         virtual TCatalogsTransportPriority Priority() const = 0;
       
    54         
       
    55         
       
    56         /**
       
    57         * Sets the source/target directory for Transport operations
       
    58         *
       
    59         * @param aDirectory Directory path
       
    60         * @note If set as empty, the directory must be set for each
       
    61         * download explicitly
       
    62         */
       
    63         virtual void SetDirectoryL( const TDesC& aDirectory ) = 0;
       
    64 
       
    65 
       
    66         /**
       
    67         * Returns the target directory 
       
    68         *        
       
    69         * @return Directory path
       
    70         */
       
    71         virtual const TDesC& Directory() const = 0;
       
    72 
       
    73 
       
    74         /**
       
    75         * Sets the source/target filename for Transport operations
       
    76         *
       
    77         * @param aFilename Filename without the path
       
    78         */
       
    79         virtual void SetFilenameL( const TDesC& aFilename ) = 0;
       
    80 
       
    81 
       
    82         /**
       
    83         * Returns the source/target filename without the path 
       
    84         *        
       
    85         * @return Filename
       
    86         */
       
    87         virtual const TDesC& Filename() const = 0;
       
    88 
       
    89         
       
    90         /**
       
    91          * Returns full path of the target file
       
    92          *
       
    93          * @return Filename
       
    94          */                   
       
    95         virtual HBufC* FullPathLC() const = 0;    
       
    96         
       
    97         
       
    98         /**
       
    99         * Returns the current request headers
       
   100         *
       
   101         * @return Headers
       
   102         */
       
   103         virtual MCatalogsHttpHeaders& RequestHeaders() const = 0;
       
   104                 
       
   105         
       
   106         // Access point
       
   107         
       
   108         /**
       
   109         * Sets the access point
       
   110         *
       
   111         * @param aAccessPointId Access point ID
       
   112         */
       
   113         virtual void SetConnectionMethod( 
       
   114             const TCatalogsConnectionMethod& aMethod ) = 0;
       
   115         
       
   116         
       
   117         /**
       
   118         * Access point getter
       
   119         *
       
   120         * @return Default access point ID
       
   121         */
       
   122         virtual const TCatalogsConnectionMethod& ConnectionMethod() const = 0;
       
   123 
       
   124               
       
   125         /**
       
   126         * Sets the observer for the operation
       
   127         *
       
   128         * @param aObserver Operation observer
       
   129         */
       
   130         virtual void SetObserver( MCatalogsHttpObserver* aObserver ) = 0;
       
   131                                 
       
   132                                 
       
   133         /**
       
   134         * Observer getter
       
   135         *
       
   136         * @return Observer
       
   137         */
       
   138         virtual MCatalogsHttpObserver* Observer() const = 0;
       
   139         
       
   140         
       
   141         /**
       
   142         * Sets the HTTP method
       
   143         * @param aMethod HTTP method
       
   144         */
       
   145         virtual void SetHttpMethod( TCatalogsHttpMethod aMethod ) = 0;
       
   146         
       
   147         
       
   148         /**
       
   149         * Gets the HTTP method
       
   150         * @return HTTP method
       
   151         */
       
   152         virtual TCatalogsHttpMethod HttpMethod() const = 0;
       
   153         
       
   154         
       
   155         /**
       
   156          * Externalizes config to a stream
       
   157          *
       
   158          * @param aStream Target stream
       
   159          */
       
   160         virtual void ExternalizeL( RWriteStream& aStream ) const = 0;        
       
   161         
       
   162         
       
   163         /**
       
   164          * Internalizes config from a stream
       
   165          *
       
   166          * @param aStream Source stream
       
   167          */
       
   168         virtual void InternalizeL( RReadStream& aStream ) = 0;  
       
   169         
       
   170         /**
       
   171          * Options getter
       
   172          */
       
   173         virtual TUint32 Options() const = 0;
       
   174         
       
   175         /**
       
   176          * Options setter
       
   177          */
       
   178         virtual void SetOptions( TUint32 aOptions ) = 0;
       
   179 
       
   180         
       
   181     protected:
       
   182     
       
   183         /** 
       
   184         * Hiding the destructor from the user prevents deleting the 
       
   185         * implementing object through this interface
       
   186         */
       
   187         virtual ~MCatalogsHttpConfig() 
       
   188             {
       
   189             }
       
   190     };
       
   191 
       
   192 
       
   193 #endif //  M_CATALOGSHTTPCONFIG_H