webservices/wsstar/wsstarplugin/inc/wsstarsessionconsumer.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2006-2006 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:    Header declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 #ifndef WSSTAR_SESSION_CONSUMER_H
       
    29 #define WSSTAR_SESSION_CONSUMER_H
       
    30 
       
    31 // INCLUDES
       
    32 #include <e32base.h>
       
    33 #include "msenremoteserviceconsumer.h"
       
    34 #include "senpointermap.h"
       
    35 #include "SenSoapMessage.h"
       
    36 #include "wsstarmessagecontext.h"
       
    37 
       
    38 
       
    39 
       
    40 // DATA TYPES
       
    41 typedef RSenPointerMap<TDesC8, HBufC8> RSentMessagesPointerMap;
       
    42 
       
    43 
       
    44 // FORWARD DECLARATIONS
       
    45 class RFileLogger;
       
    46 
       
    47 
       
    48 // CLASS DECLARATION
       
    49 /*
       
    50     Its wrapper for remote consumer. In the same time it inherits from remote consumer. Why?
       
    51     Because we can not cast inside framework pluging to our wsstar session a remote consumer, 
       
    52     which was created in core
       
    53     
       
    54     Object can ot be extended to more complex class. Can be cast to narrow class, but not in other way
       
    55 */
       
    56 class CWSStarSessionConsumer : public CBase, public MSenRemoteServiceConsumer
       
    57     {
       
    58 public: // Constructors and destructor
       
    59     
       
    60     static CWSStarSessionConsumer* NewL(MSenRemoteServiceConsumer& aServiceConsumer,
       
    61                                        RFileLogger& aLogger);
       
    62 
       
    63     static CWSStarSessionConsumer* NewLC(MSenRemoteServiceConsumer& aServiceConsumer,
       
    64                                         RFileLogger& aLogger);
       
    65 
       
    66     virtual ~CWSStarSessionConsumer();
       
    67  // From MSenRemoteServiceConsumer:
       
    68     TInt HandleMessageL(HBufC8* aMessage,
       
    69                         const TInt aTxnId,
       
    70                         MSenProperties* aResponseTransportProperties);
       
    71 
       
    72     TInt HandleErrorL(HBufC8* aError,
       
    73                       const TInt aErrorCode,
       
    74                       const TInt aTxnId,
       
    75                       MSenProperties* aResponseTransportProperties);
       
    76 
       
    77     void SetStatusL(const TInt status);
       
    78 
       
    79 
       
    80 
       
    81     TInt MessageForSendingL(const TDesC8& aBody,
       
    82                             CWSStarMessageContext*& aCtx);
       
    83 // New functions
       
    84 
       
    85     /**
       
    86     * Expects() is called by CWSStarServiceSession to check
       
    87     * whether or not this consumer expects certain response
       
    88     */
       
    89     virtual TBool Expects(const TDesC8& aRelatesTo, const TDesC8* aTo);
       
    90 
       
    91     const TDesC8& Id() const;
       
    92     TInt SetSessionL(MSenRemoteServiceSession& iServiceSession);
       
    93 
       
    94     void HandleSoapMessageL( CSenSoapMessage* apMessage,
       
    95                              const TInt aTxnId,
       
    96                              MSenProperties* aResponseTransportProperties,
       
    97                              TBool aCompleteMessage );
       
    98 
       
    99    
       
   100 
       
   101 /*
       
   102     void SetSentMessageIdL(const TDesC8& aSentMessageId);
       
   103     TPtrC8 SentMessageId();
       
   104     void SetReceivedMessageIdL(const TDesC8& aReceivedMessageId);
       
   105     TPtrC8 ReceivedMessageId();
       
   106 */
       
   107     CSenIdentifier& Identifier() const;
       
   108     TDesC8* BodyL(const TDesC8& aMessageID) const;
       
   109     const TDesC8& TransportProperties(const TDesC8& aMessageID) const;
       
   110     MSenTransport& TransportL();
       
   111     virtual TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk);
       
   112     virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
       
   113                 const TDesC8& aSoapOrCid, TInt aProgress);    
       
   114     TBool HasAuthenticationCallback();
       
   115     TInt ReauthenticationNeededL(CSenIdentityProvider*& aIdp);
       
   116 	virtual void SetDataTrafficDetails(TSenDataTrafficDetails& aDetails) ; 
       
   117     TBool HasCoBrandingCallback();
       
   118     TBool OnGetBrandIdL(  const TDesC8& aBrandIdListAsXmlSnippet, RBuf8& aSelectedBrandId);
       
   119 
       
   120 protected:
       
   121     RFileLogger* Log() const;
       
   122 
       
   123 
       
   124 private: 
       
   125 
       
   126     /**
       
   127     * C++ default constructor.
       
   128     */
       
   129     CWSStarSessionConsumer(MSenRemoteServiceConsumer& aServiceConsumer,
       
   130                           RFileLogger& aLogger);
       
   131     
       
   132     /**
       
   133     * By default Symbian 2nd phase constructor is private.
       
   134     */
       
   135     void ConstructL();
       
   136 
       
   137 
       
   138 
       
   139 private: // Data
       
   140     MSenRemoteServiceConsumer& iConsumer;
       
   141     RFileLogger& iLogger;
       
   142     //HBufC8* iSentMessageId;     // owned
       
   143     //HBufC8* iReceivedMessageId; // owned
       
   144     RSentMessagesPointerMap iSentMessages; // owned
       
   145     RMapDescriptors         iSendReplyTo; // owned
       
   146     RMapDescriptors iTranspProp;
       
   147     };
       
   148     
       
   149 #endif // WSSTAR_SESSION_CONSUMER_H
       
   150 
       
   151 // End of File