webservices/wsconnection/inc/rsenserviceconnection.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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 #ifndef R_SEN_SERVICE_CONNECTION_H
       
    26 #define R_SEN_SERVICE_CONNECTION_H
       
    27 
       
    28 // INCLUDES
       
    29 #include <e32base.h>
       
    30 #include <flogger.h>
       
    31 #include "senchunk.h"
       
    32 #include "senservicemanagerdefines.h" // internal Core\inc  - IPC enumerations
       
    33 #include "SenServiceConnection.h" 
       
    34 
       
    35 // FORWARD DECLARE
       
    36 class CSenSoapEnvelope;
       
    37 class CSenChunk;
       
    38 class RFile;
       
    39 class RSenServiceConnection;
       
    40 #ifdef __ENABLE_ALR__
       
    41 class MMobilityProtocolResp;
       
    42 #endif
       
    43 
       
    44 class TFourInts
       
    45     {
       
    46     public:
       
    47     	TInt iInt1;
       
    48     	TInt iInt2;
       
    49     	TInt iInt3;
       
    50     	TInt iInt4;
       
    51 	};
       
    52 
       
    53 NONSHARABLE_CLASS(CSenProgressResourceHandler): private CActive
       
    54     {
       
    55     friend class RSenServiceConnection;
       
    56     private:
       
    57     CSenProgressResourceHandler(TInt aTxnId, TBool aIncoming, TBool aIsSoap,
       
    58             TInt aProgress, RSenServiceConnection* aOwner);
       
    59     ~CSenProgressResourceHandler();
       
    60     void DoCancel();
       
    61     void RunL();
       
    62     TInt SetBuffer(const TDesC8& aSoapOrCid);
       
    63     
       
    64     private:
       
    65     TPckgBuf<TTransferProgress> iProgressData;
       
    66     HBufC8* iSoapOrCid;
       
    67     RSenServiceConnection* iOwner;
       
    68     CSenProgressResourceHandler* iNext;
       
    69     CSenProgressResourceHandler* iPrevious;
       
    70     };
       
    71 
       
    72 NONSHARABLE_CLASS(CSenConnAgentSync): public CActive
       
    73     {
       
    74     friend class RSenServiceConnection;
       
    75 private:
       
    76     CSenConnAgentSync();
       
    77     ~CSenConnAgentSync();
       
    78     void DoCancel();
       
    79     void RunL();
       
    80     void Start();
       
    81     };
       
    82 
       
    83 // CLASS DECLARATION
       
    84 class RSenServiceConnection : public RSessionBase
       
    85     {
       
    86 public:
       
    87         /**
       
    88         * C++ default constructor.
       
    89         */
       
    90         RSenServiceConnection(RFileLogger* aLog);
       
    91         
       
    92         // New functions
       
    93         TInt Connect();
       
    94         TVersion Version() const;
       
    95         void Initialize( TRequestStatus& aStatus, 
       
    96         				 TDes8& aErrPtr, 
       
    97         				 TDes& aSessionId, 
       
    98         				 CSenChunk& aSenChunk,
       
    99                          TInt aSdLength,
       
   100                          TInt aCpLength,
       
   101                          TBool aHasAuthenticationCallback );
       
   102 
       
   103 
       
   104         /**
       
   105         * Transaction method is asynchronous
       
   106         * 
       
   107         * @param aStatus is the AO's status
       
   108         * @param aErrPtr is where error will be written by server
       
   109         * @param aTxnPtr is where transaction ID received from 
       
   110         * transport (in the server-side) will be written by server
       
   111         * @param aChunk is reference to new chunk, which will be opened
       
   112         * RChunk (S60 3rd Edition) or RFile (S60 2nd Edition)
       
   113         * @param aChunkName defines the global name for new RChunk (S60 2nd edition)
       
   114         * @param aRequest is the message copied into RChunk
       
   115         * @return KErrNone or system-wide error code. Note that if
       
   116         * an error is returned, then SendReceive has not been called
       
   117         * and caller (SC implementation class) does not need to call 
       
   118         * SetActive()
       
   119         */
       
   120         void Transaction(TRequestStatus& aStatus, 
       
   121                          TDes8& aErrPtr, 
       
   122                          TDes8& aTxnPtr, 
       
   123                          CSenChunk& aClientOp);
       
   124 
       
   125         TInt SendMsgAndReceiveTxnId(CSenChunk& aClientOp);
       
   126 
       
   127         TInt IsReady(TBool& aReady);
       
   128         TInt HasFacet(TDesC8& aUri, TBool& aHasFacet);
       
   129         TInt CompleteServerMessagesOnOff( TBool& aOnOff );
       
   130         void SetLog(RFileLogger* aLog);
       
   131         TInt RequestServiceDescription(TDes8& aSdLength);
       
   132         TInt ReceiveServiceDescription(TDes8& aServiceDescription);
       
   133         TInt StartTransaction();
       
   134         TInt TransactionCompleted();
       
   135         void CancelSession(TRequestStatus& aStatus);
       
   136         void CancelRequests(TRequestStatus& aStatus);
       
   137         void CancelRequest(TInt aTransactionID);
       
   138    	    void DataTrafficDetails(TSenDataTrafficDetails& aDetails,TSenDataTrafficOperations& aOperation);  
       
   139         TInt SetTransportPropertiesL(CSenChunk& aSenChunk);
       
   140         TInt TransportPropertiesL(CSenChunk& aSenChunk);        
       
   141 
       
   142         TInt MoveFile(CSenChunk& aSenChunk, 
       
   143                       const TDesC8& aCid, 
       
   144                       RFile& aFile);
       
   145 
       
   146         TInt SendFileHandle(CSenChunk& aSenChunk, 
       
   147                       		RFile& aFile);
       
   148         TInt MoveChunk(CSenChunk& aSenChunk, 
       
   149                        const TDesC8& aCid, 
       
   150                        RChunk& aChunk,
       
   151                        TInt aDataOffset, 
       
   152                        TInt aDataSize);
       
   153                        
       
   154         TInt ConnectionID();
       
   155         
       
   156         TInt IdentityProviderL(CSenChunk& aSenChunk);
       
   157         TInt RegisterIdentityProvider(TDesC8& aMessage);
       
   158         void SetChannel(TInt aChannel);
       
   159         
       
   160         TInt RegisterTransferObserver(const TDesC* aServerName, TAny* aConnection);
       
   161         // @return KErrNoMemory if out of heap
       
   162         TInt SendFileProgress( TInt aTxnId, TBool aIncoming,TBool aIsSoap,
       
   163                                const TDesC8& aSoapOrCid, TInt aProgress );
       
   164         void Remove(CSenProgressResourceHandler* aResourceHandler);
       
   165         void Close();
       
   166         
       
   167         TInt SearchIdentityProviderL(CSenChunk& aSenChunk, const TDesC8& aProviderId);
       
   168         TInt RegisterAuthenticationObserver(const TDesC* aServerName, TAny* aConnection);
       
   169         TInt RegisterCoBrandingObserver(const TDesC* aServerName, TAny* aConnection);
       
   170 #ifdef __ENABLE_ALR__
       
   171 	    TInt RegisterMobilityObserverL(const TDesC* aServerName, TAny* aConnection) ;
       
   172 	    TInt MigrateToPrefferedCarrierL(TBool &aUserChoice) ;
       
   173 	    TInt NewCarrierAcceptedL(TBool &aUserChoice) ;
       
   174 #endif
       
   175 
       
   176     private: // Helper functions
       
   177         RFileLogger* Log() const;
       
   178 
       
   179     private: // Data
       
   180         TInt                iMessageContextId; // locally (in SC scope) unique message context ID counter
       
   181         RFileLogger*        iLog;
       
   182         TPckgBuf<TFourInts> iFourInts;
       
   183         CSenProgressResourceHandler* iFirst;
       
   184         TInt                iTLSLogChannel;
       
   185     };
       
   186     
       
   187 #endif //R_SEN_SERVICE_CONNECTION_H
       
   188