webservices/wsoviplugin/inc/wsovisessionconsumer.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2008 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 WSOvi_SESSION_CONSUMER_H
       
    29 #define WSOvi_SESSION_CONSUMER_H
       
    30 
       
    31 // INCLUDES
       
    32 #include <e32base.h>
       
    33 #include "msenremoteserviceconsumer.h"
       
    34 #include "senpointermap.h"
       
    35 #include "SenSoapMessage.h"
       
    36 #include "wsovimessagecontext.h"
       
    37 
       
    38 
       
    39 
       
    40 // DATA TYPES
       
    41 typedef RSenPointerMap<TDesC8, HBufC8> RSentMessagesPointerMap;
       
    42 
       
    43 
       
    44 // FORWARD DECLARATIONS
       
    45 class RFileLogger;
       
    46 class CSenHttpTransportProperties;
       
    47 
       
    48 
       
    49 // CLASS DECLARATION
       
    50 /*
       
    51     Its wrapper for remote consumer. In the same time it inherits from remote consumer. Why?
       
    52     Because we can not cast inside framework pluging to our WSOvi session a remote consumer, 
       
    53     which was created in core
       
    54     
       
    55     Object can ot be extended to more complex class. Can be cast to narrow class, but not in other way
       
    56 */
       
    57 class CWSOviSessionConsumer : public CBase, public MSenRemoteServiceConsumer
       
    58     {
       
    59 public: // Constructors and destructor
       
    60     
       
    61     static CWSOviSessionConsumer* NewL(MSenRemoteServiceConsumer& aServiceConsumer);
       
    62 
       
    63     static CWSOviSessionConsumer* NewLC(MSenRemoteServiceConsumer& aServiceConsumer);
       
    64 
       
    65     virtual ~CWSOviSessionConsumer();
       
    66  // From MSenRemoteServiceConsumer:
       
    67     TInt HandleMessageL(HBufC8* aMessage,
       
    68                         const TInt aTxnId,
       
    69                         MSenProperties* aResponseTransportProperties);
       
    70 
       
    71     TInt HandleErrorL(HBufC8* aError,
       
    72                       const TInt aErrorCode,
       
    73                       const TInt aTxnId,
       
    74                       MSenProperties* aResponseTransportProperties);
       
    75 
       
    76     void SetStatusL(const TInt status);
       
    77 
       
    78 
       
    79 
       
    80     TInt MessageForSendingL(CSenHttpTransportProperties*& aTP,
       
    81                             CWSOviMessageContext*& aCtx);
       
    82 // New functions
       
    83 
       
    84     const TDesC8& Id() const;
       
    85     TInt SetSessionL(MSenRemoteServiceSession& iServiceSession);
       
    86 
       
    87     CSenIdentifier& Identifier() const;
       
    88     const TDesC8& TransportProperties(const TDesC8& aMessageID) const;
       
    89     MSenTransport& TransportL();
       
    90     virtual TInt ChunkByTxnIdL(TInt aTxnId, CSenChunk*& aChunk);
       
    91     virtual void FileProgress(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
       
    92                 const TDesC8& aSoapOrCid, TInt aProgress);    
       
    93     TBool HasAuthenticationCallback();
       
    94 	TInt ReauthenticationNeededL(CSenIdentityProvider*& aIdp);
       
    95 
       
    96 	virtual void SetDataTrafficDetails(TSenDataTrafficDetails& aDetails) ;
       
    97 
       
    98 private: 
       
    99 
       
   100     /**
       
   101     * C++ default constructor.
       
   102     */
       
   103     CWSOviSessionConsumer(MSenRemoteServiceConsumer& aServiceConsumer);
       
   104     
       
   105     /**
       
   106     * By default Symbian 2nd phase constructor is private.
       
   107     */
       
   108     void ConstructL();
       
   109 
       
   110 
       
   111 
       
   112 private: // Data
       
   113     MSenRemoteServiceConsumer& iConsumer;
       
   114     RSentMessagesPointerMap iSentMessages; // owned
       
   115     RMapDescriptors         iSendReplyTo; // owned
       
   116     RMapDescriptors iTranspProp;
       
   117     };
       
   118     
       
   119 #endif // WSOvi_SESSION_CONSUMER_H
       
   120 
       
   121 // End of File
       
   122