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