pressrv_plat/xdm_api/inc/XdmProtocolInfo.h
changeset 0 c8caa15ef882
equal deleted inserted replaced
-1:000000000000 0:c8caa15ef882
       
     1 /*
       
     2 * Copyright (c) 2005 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:   XDM protocol information
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __XDMPROTOCOLINFO__
       
    22 #define __XDMPROTOCOLINFO__
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "XdmCredentials.h"
       
    26     
       
    27 //FORWARD DECLARATION
       
    28 class CXdmDocument;
       
    29 
       
    30 //CLASS DECLARATION
       
    31 class CXdmProtocolInfo : public CBase
       
    32     {
       
    33     public:
       
    34         
       
    35         /**
       
    36         * Create a new protocol info object
       
    37         *
       
    38         * @param TInt ID of the access point to use
       
    39         * @param TUid The UID of the XDM protocol to use
       
    40         * @param TDesC& Address of the remote host
       
    41         * @return CXdmProtocolInfo The protocol info object
       
    42         */
       
    43         IMPORT_C static CXdmProtocolInfo* NewL( TInt aAccessPoint,
       
    44                                                 TInt aProtocolUid,
       
    45                                                 const TDesC& aRootLocation );
       
    46         
       
    47         /**
       
    48         * Create a new protocol info object
       
    49         *
       
    50         * @param TInt ID of the settings collection
       
    51         *
       
    52         * NOTE: In order to be able to use this overload
       
    53         *       of the constructor, the client must first 
       
    54         *       fetch the collection of XDM Settings through
       
    55         *       the static method XdmSettingsL() declared in
       
    56         *       CXdmEngine API. This method returns an array 
       
    57         *       of strings, which denote the names of the
       
    58         *       settings collections stored for XDM.
       
    59         *
       
    60         * @return CXdmProtocolInfo* The protocol info object
       
    61         */
       
    62         IMPORT_C static CXdmProtocolInfo* NewL( TInt aSettingsId );
       
    63                                                 
       
    64         /**
       
    65         * Return the root location of the XDM documents
       
    66         *
       
    67         * @return TPtrC RootURI
       
    68         */
       
    69         IMPORT_C TPtrC Root() const;
       
    70 
       
    71         /**
       
    72         * Return the access point
       
    73         *
       
    74         * @return TInt Access point
       
    75         */
       
    76         IMPORT_C TInt AccessPoint() const;
       
    77         
       
    78         /**
       
    79         * Return the the UID of the protocol in use
       
    80         *
       
    81         * @return TUid UID of the protocol implementation
       
    82         */
       
    83         IMPORT_C TUid ProtocolUid() const;
       
    84         
       
    85         /**
       
    86         * Set appropriate credentials in case the used
       
    87         * resource requires authorization.
       
    88         *
       
    89         * @param TXdmCredentials Credentials for the user
       
    90         * @return void
       
    91         */
       
    92         IMPORT_C void SetCredentials( const TXdmCredentials aCredentials );
       
    93 
       
    94         /**
       
    95         * Enable/disable cache
       
    96         *
       
    97         * @param TBool Is cache in use or not
       
    98         * @return void
       
    99         */
       
   100         IMPORT_C void SetCacheUsage( TBool aCacheUsage );
       
   101 
       
   102         /**
       
   103         * Enable/disable secure transfer
       
   104         *
       
   105         * @param TBool Is the protocol secure
       
   106         * @return void
       
   107         */
       
   108         IMPORT_C void SetSecurity( TBool aSecure );
       
   109 
       
   110         /**
       
   111         * Is secure transfer enabled
       
   112         *
       
   113         * @return TBool Secure or not
       
   114         */
       
   115         IMPORT_C TBool IsSecure() const;
       
   116         
       
   117         /**
       
   118         * Check cache usage
       
   119         *
       
   120         * @return TBool Is cache in use
       
   121         */
       
   122         IMPORT_C TBool IsCacheEnabled() const;
       
   123         
       
   124         /**
       
   125         * Return the credentials
       
   126         *
       
   127         * @return TXdmCredentials& Credentials for the user
       
   128         */
       
   129         IMPORT_C const TXdmCredentials& Credentials() const;
       
   130         
       
   131         /**
       
   132         * Return the ID of the settings
       
   133         *
       
   134         * @return TInt SettingsID
       
   135         */
       
   136         IMPORT_C TInt SettingsID() const;
       
   137 
       
   138         /**
       
   139         * Destructor
       
   140         */
       
   141         IMPORT_C virtual ~CXdmProtocolInfo();
       
   142 
       
   143     private:
       
   144         
       
   145         /**
       
   146         * C++ constructor is private
       
   147         */
       
   148         CXdmProtocolInfo();
       
   149         
       
   150         /**
       
   151         * C++ constructor is private
       
   152         *
       
   153         * @param TInt UID of the protocol plugin
       
   154         */
       
   155         CXdmProtocolInfo( TInt aProtocolUid );
       
   156                                            
       
   157         /**
       
   158         * C++ constructor is private
       
   159         *
       
   160         * @param TInt ID of the access point in use
       
   161         * @param TInt UID of the protocol plugin
       
   162         */
       
   163         CXdmProtocolInfo( TInt aAccessPoint,
       
   164                           TInt aProtocolUid );
       
   165 
       
   166         /**
       
   167         * Symbian OS second-phase constructor
       
   168         *
       
   169         * @param TDesC& Root location
       
   170         * @return void
       
   171         */
       
   172         void ConstructL( const TDesC& aRootLocation );
       
   173         
       
   174         /**
       
   175         * Symbian OS non-leaving constructor
       
   176         *
       
   177         * @param TInt Settings ID
       
   178         * @return void
       
   179         */
       
   180         void Construct( TInt aSettingsId );
       
   181 
       
   182     private:  //Data
       
   183         
       
   184         TUid                           iProtocolUid;
       
   185         TInt                           iSettingsId;
       
   186         TInt                           iAccessPoint;
       
   187         TBool                          iSecure;
       
   188         TBool                          iUseCache;
       
   189         HBufC*                         iRootLocation;
       
   190         TXdmCredentials                iCredentials;
       
   191     };
       
   192 
       
   193 #endif      //__XDMPROTOCOLINFO__
       
   194             
       
   195 // End of File