applayerprotocols/httpexamples/cookies/inc/mhttpcookiemanager.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef		__MHTTPCOOKIEFILTER_H__
       
    17 #define		__MHTTPCOOKIEFILTER_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <http/rhttptransaction.h>
       
    21 
       
    22 class CCookie;
       
    23 
       
    24 /** Interface for a cookie manager.
       
    25 	The StoreCookieL and GetCookiesL functions need to be implemented
       
    26 */
       
    27 class MHttpCookieManager
       
    28 	{
       
    29 public: 
       
    30 	/** Store a cookie. This will get called with each cookie that is encountered in a 
       
    31 		transaction response. 
       
    32 		Implementations of this interface may leave with any of KErrNoMemory if there is insufficient
       
    33 		memory or any other system-wide error code if an attempt to append to an internal list fails.
       
    34 		If this function leaves then the transaction will be failed. 
       
    35 		Care should be made to make sure that this function leaves only when necessary.
       
    36 		@param aCookie. The cookie to be stored. Ownership of aCookie is passed to the 
       
    37 		instantiation of this class.
       
    38 		@param aUri The Uri of the request that supplied this cookie.  This is required so
       
    39 		that the manager can complete any missing attributes of the cookie.
       
    40 	*/
       
    41 	virtual void StoreCookieL(CCookie* aCookie, const TUriC8& aUri) =0;
       
    42 
       
    43 	/** Get the relevant cookies for a transaction
       
    44 		@param	aTransaction	The transaction which cookies are requested for
       
    45 		@param	aCookieList		An array which will be filled with the cookies for 
       
    46 			aTransaction. The array should be empty when this function is called.
       
    47 		@param	aCookie2Reqd	Flag indicating whether a Cookie2 header should be added to the 
       
    48 								outgoing request headers
       
    49 	*/
       
    50 	virtual void GetCookiesL(RHTTPTransaction aTransaction, RArray<CCookie*>& aCookieList, TBool& aCookie2Reqd)=0;
       
    51 	};
       
    52 
       
    53 #endif	// __MHTTPCOOKIEFILTER_H__