epoc32/include/http/cauthenticationfilterinterface.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 
    17 
    18 /**
    19  @file CAuthenticationFilterInterface.h
    20  @warning : This file contains Rose Model ID comments - please do not delete
    21 */
    22 
    23 #ifndef	__CAUTHENTICATIONFILTERINTERFACE_H__
    24 #define	__CAUTHENTICATIONFILTERINTERFACE_H__
    25 
    26 // System includes
    27 #include <e32base.h>
    28 #include <ecom/ecom.h>
    29 #include <http/rhttpsession.h>
    30 
    31 // Forward declarations
    32 class MHTTPAuthenticationCallback;
    33 
    34 
    35 class CAuthenticationFilterInterface : public CBase
    36 /**
    37 The ECOM interface definition for an HTTP authentication filter.  Implementations
    38 of an authentication filter must inherit this class.
    39 @publishedAll
    40 @released
    41 */
    42 	{
    43 public: // Methods
    44 	/**
    45 	@fn				InstallFilterL(RHTTPSession& aSession, MHTTPAuthenticationCallback* aCallback)
    46 	Intended Usage:	This method is used to install the authentication filter to the filter queue.
    47 					The returned pointer is not owned as the filters must be self-destroying when
    48 					they are unloaded.
    49 	@param			aSession A handle to the transport session
    50 	@param			aCallback A pointer to the object implementing the callback function
    51 	@return			Pointer to the newly installed plugin
    52 	@pre 			The session had already been setup
    53 	@post			The filter(s) have been installed
    54 	*/
    55 	inline static void InstallFilterL(RHTTPSession& aSession, MHTTPAuthenticationCallback* aCallback);
    56 
    57 	/**
    58 	@fn				~CAuthenticationFilterInterface()
    59 	Intended Usage:	Virtual destructor
    60 	@pre 			The object identified by the destructor key in iEcomDtorID exists
    61 	@post			The object is destroyed
    62 	*/
    63 	inline ~CAuthenticationFilterInterface();
    64 
    65 public:
    66 	struct TAuthenticationParams
    67 		{
    68 		RHTTPSession* iSession;
    69 		MHTTPAuthenticationCallback* iCallback;
    70 		};
    71 
    72 private: // Attributes
    73 	/// The ECom destructor key identifier
    74 	TUid iEcomDtorID;
    75 	};
    76 
    77 //----------------------------------------------------------------------------------------
    78 
    79 inline void CAuthenticationFilterInterface::InstallFilterL(RHTTPSession& aSession, MHTTPAuthenticationCallback* aCallback)
    80 	{
    81 	const TUid KUidAuthenticationFilter = {0x101F447C};
    82 	TAuthenticationParams authParams;
    83 	authParams.iSession = &aSession;
    84 	authParams.iCallback = aCallback;
    85 	REComSession::CreateImplementationL(KUidAuthenticationFilter, _FOFF(CAuthenticationFilterInterface,iEcomDtorID), &authParams);
    86 	}
    87 
    88 inline CAuthenticationFilterInterface::~CAuthenticationFilterInterface()
    89 	{
    90 	REComSession::DestroyedImplementation(iEcomDtorID);
    91 	}
    92 
    93 #endif // __CAUTHENTICATIONFILTERINTERFACE_H__