syncmlfw/common/syncagent/inc/NSmlResponseController.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Status response buffering
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __NSMLRESPONSECONTROLLER_H
       
    20 #define __NSMLRESPONSECONTROLLER_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CNSmlFutureReservation;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 class CNSmlResponseController : public CBase 
       
    31 	{
       
    32 	public:  // enumerations
       
    33 		enum TResponseDetail 
       
    34 		{
       
    35 		EResponseNoDetail,
       
    36 		EResponseInitAlert
       
    37 		};
       
    38 
       
    39 	public: // constructors and desctructor
       
    40 	static CNSmlResponseController* NewL(); 
       
    41 	static CNSmlResponseController* NewLC();
       
    42 	~CNSmlResponseController();    //from CBase
       
    43 
       
    44 	public: //new functions
       
    45  
       
    46 	TInt CreateNewResponseItemL();
       
    47 	void RemoveResponseItem( TInt aMsgID, TInt aCmdID ); 
       
    48 	void SetMsgID( TInt aEntryID, TInt aMsgID );
       
    49 	void SetCmdL( TInt aEntryID, const TDesC8& aCmd );
       
    50 	void SetCmdID( TInt aEntryID, TInt aCmdID );
       
    51 	IMPORT_C void SetLUIDL( TInt aEntryID, const TDesC8& aLUID );
       
    52 	IMPORT_C void SetAppIndex( TInt aEntryID, TInt aAppIndex );
       
    53 	void SetChalTypeL( TInt aEntryID, const TDesC8& aType );
       
    54 	void SetChalFormatL( TInt aEntryID, const TDesC8& aFormat );
       
    55 	void SetChalNextNonceL( TInt aEntryID, const TDesC8& aNextNonce );
       
    56 	IMPORT_C void SetResponseDetail( TInt aEntryID, TResponseDetail aResponseDetail );
       
    57 	IMPORT_C void SetMoreData( TInt aEntryID );
       
    58 	void RemoveAllReceivedOnes();  
       
    59 	IMPORT_C void ResetL();
       
    60 	TBool MatchStatusElement( const TDesC8& aMsgID, const TDesC8& aCmdID, TInt aStatusCode, TInt& aEntryID );
       
    61 
       
    62 	void Begin();
       
    63 	TBool NextResponseInfo( TInt& aEntryID );
       
    64 	TBool ItemResponseInfo( const TDesC8& aLUID, TInt& aEntryID ) const;
       
    65 
       
    66 	IMPORT_C TDesC8& Cmd( TInt aEntryID ) const;
       
    67 	IMPORT_C TPtrC8 LUID( TInt aEntryID ) const;
       
    68 	IMPORT_C TInt AppIndex( TInt aEntryID ) const;
       
    69 	IMPORT_C TInt StatusCode( TInt aEntryID ) const;
       
    70 	TBool StatusReceived( TInt aEntryID ) const;
       
    71 	IMPORT_C TPtrC8 ChalType( TInt aEntryID ) const;
       
    72 	TPtrC8 ChalFormat( TInt aEntryID ) const;
       
    73 	TPtrC8 ChalNextNonce( TInt aEntryID ) const;
       
    74 	IMPORT_C TResponseDetail ResponseDetail( TInt aEntryID ) const;
       
    75 	TBool BusyStatus( TInt aMsgID ) const;
       
    76 	IMPORT_C TBool MoreData( TInt aEntryID ) const;
       
    77 	IMPORT_C TInt EntryID( TInt aCmdID, TInt aMsgID) const;
       
    78 
       
    79 	private:
       
    80 	void ConstructL();
       
    81 	CNSmlResponseController();
       
    82 	CNSmlResponseController( const CNSmlResponseController& aOther );
       
    83 	CNSmlResponseController& operator=( const CNSmlResponseController& aOther );
       
    84 	void CreateResponseChalL( TInt aIndex );
       
    85 	void FreeResources( TInt aI );
       
    86 		
       
    87 	private: //Data
       
    88 	//
       
    89 	struct TChal
       
    90 		{
       
    91 		HBufC8* chalType;
       
    92 		HBufC8* chalFormat;
       
    93 		HBufC8* chalNextNonce;
       
    94 		};
       
    95 	
       
    96 	struct TResponseData
       
    97 		{
       
    98 		TInt responseMsgID;
       
    99 		HBufC8* responseCmd;
       
   100 		TInt responseCmdID;
       
   101 		HBufC8* responseLUID; 
       
   102 		TInt responseAppIndex;
       
   103 		TInt responseStatusCode;
       
   104 		TBool responseStatusReceived;
       
   105 		TChal* responseChal;
       
   106 		TResponseDetail responseDetail;
       
   107 		TBool responseMoreData;
       
   108 		};
       
   109 	CArrayFixFlat<TResponseData>* iResponse;
       
   110 	TInt iEntryID;
       
   111 	// Reserved to maintain binary compability
       
   112 	CNSmlFutureReservation* iReserved;
       
   113 	};
       
   114 
       
   115 #endif // __NSMLRESPONSECONTROLLER_H