Msrp/MsrpClient/inc/RMSRPSession.h
branchMSRP_FrameWork
changeset 58 cdb720e67852
parent 25 505ad3f0ce5c
equal deleted inserted replaced
25:505ad3f0ce5c 58:cdb720e67852
    32 
    32 
    33 // Class declaration
    33 // Class declaration
    34 
    34 
    35 class RMSRPSession : public RSubSessionBase, public MMSRPServerInterface
    35 class RMSRPSession : public RSubSessionBase, public MMSRPServerInterface
    36     {
    36     {
    37 public:
    37     public:
    38     /**
    38         /**
    39       * constructor.
    39           * constructor.
    40       */
    40           */
    41     RMSRPSession();
    41         RMSRPSession();
       
    42         
       
    43     public: // New functions
       
    44         /**
       
    45           * Opens a Sub-Session to MSRP Server
       
    46           * @param aRMSRP reference to main server session
       
    47           * @param aIapId internet accesss point identifier
       
    48           * @param aSession session id from invite
       
    49           * @return Status of the operation
       
    50           */
       
    51         TInt CreateServerSubSession( RMSRP& aRMSRP, 
       
    52                                      const TUint32 aIapId,
       
    53                                      const TDesC8& aSessionId );
       
    54         
       
    55         void CloseServerSubSession( );
       
    56         
       
    57         /**
       
    58           * Send a request to server whether to receive 
       
    59           * or not to receive progress reports
       
    60           * @param aProgress True if user wants to receive progress
       
    61           *                  reports
       
    62           * @return system-wide error code
       
    63           */
       
    64         TInt SetProgressReports( TBool aProgress );        
       
    65         
       
    66     public: // From MMSRPServerInterface
       
    67         
       
    68         void GetLocalPathL( TDes8 &aLocalHost );
       
    69         void Connect( const TDesC8& aRemoteHost,
       
    70                       const TUint aRemotePort,
       
    71                       const TDesC8& aRemoteSessionID,
       
    72                       TRequestStatus& aStatus );
       
    73         void ListenConnections( const TDesC8& aRemoteHost,
       
    74                                 const TUint aRemotePort,
       
    75                                 const TDesC8& aRemoteSessionID,
       
    76                                 TBool aIsMessage,
       
    77                                 TRequestStatus& aStatus );
       
    78         void ListenMessages( TBool aIsMessage,
       
    79                              TRequestStatus& aStatus );
       
    80         void ListenSendResult( const TDesC8& aSessionID,
       
    81                                TRequestStatus& aStatus );
       
    82         TInt SendMessage( TDesC8& aMessageBuffer );
       
    83         TInt CancelSending( const TDesC8& aMessageId );
       
    84         TInt CancelReceiving( const TDesC8& aMessageId );
       
    85         void CancelSendResultListening( );
       
    86         const TDesC8& GetMessageIdOfSentMessage( ) const;
       
    87         TInt GetStatusOfSentMessage( ) const;
       
    88         TInt GetStatusOfReceivedMessage( ) const;
       
    89         const TDesC8& GetReceivedMessage( ) const;
       
    90         TBool GetListenProgress() const;
       
    91         TInt GetBytesReceived() const;
       
    92         TInt GetTotalBytesReceived() const;
       
    93         TBool GetSendProgress() const;
       
    94         TInt GetBytesSent() const;
       
    95         TInt GetTotalBytes() const;
       
    96         TDesC8& ListenMessageId();
       
    97         TDesC8& SendMessageId();
    42     
    98     
    43 public: // New functions
    99     private: //variables
    44     /**
   100         
    45       * Opens a Sub-Session to MSRP Server
   101         // Local path data to be recived from the server
    46       * @return Status of the operation
   102         TPckgBuf< TLocalPathMSRPData > iLocalPathMSRPDataPckg;
    47       */
   103             
    48     TInt CreateServerSubSession( RMSRP& aRMSRP, 
   104         // Connection data to be sent to server
    49                                  const TUint32 aIapId );
   105         TPckgBuf< TConnectMSRPData > iConnectMSRPDataPckg;
       
   106         
       
   107         // Message sending data to be sent to server
       
   108         TPckgBuf< TSendMSRPData > iSendMSRPDataPckg;
    50     
   109     
    51     void CloseServerSubSession( );
   110         // Listen for incoming messages data package
    52    
   111         TPckgBuf< TListenMSRPData > iListenMSRPDataPckg;
    53     
   112     
    54 public: // From base class
   113         // Listen for response to sent messages data package
    55     
   114         TPckgBuf< TListenSendResultMSRPData > iSendResultListenMSRPDataPckg;
    56     // From MMSRPServerInterface
       
    57     
       
    58     void GetLocalPathL( TDes8 &aLocalHost,
       
    59                        TDes8 &aSessionID );
       
    60     
       
    61     void Connect( const TDesC8& aRemoteHost,
       
    62                   const TUint aRemotePort,
       
    63                   const TDesC8& aRemoteSessionID,
       
    64                   TRequestStatus& aStatus );
       
    65         
       
    66     void ListenConnections( const TDesC8& aRemoteHost,
       
    67                             const TUint aRemotePort,
       
    68                             const TDesC8& aRemoteSessionID,
       
    69                             TBool aIsMessage,
       
    70                             TRequestStatus& aStatus );
       
    71     
       
    72     void ListenMessages( TBool aIsMessage,
       
    73                          TRequestStatus& aStatus );
       
    74     
       
    75     void ListenSendResult( const TDesC8& aSessionID,
       
    76                            TRequestStatus& aStatus );
       
    77             
       
    78     TInt SendMessage( TDesC8& aMessageBuffer );
       
    79         
       
    80     TInt CancelSending( TDesC8& aMessageId );
       
    81     
       
    82     void CancelReceiving( );
       
    83     void CancelSendResultListening( );
       
    84         
       
    85     const TDesC8& GetMessageIdOfSentMessage( ) const;
       
    86     TInt GetStatusOfSentMessage( ) const;
       
    87     TInt GetStatusOfReceivedMessage( ) const;
       
    88     const TDesC8& GetReceivedMessage( ) const;
       
    89     
       
    90     TBool GetListenProgress() const;
       
    91     TInt GetBytesReceived() const;
       
    92     TInt GetTotalBytesReceived() const;
       
    93     
       
    94     TBool GetSendProgress() const;
       
    95     TInt GetBytesSent() const;
       
    96     TInt GetTotalBytes() const;
       
    97 
       
    98     
       
    99     TInt SendFileL(TDesC8& aFileParamBuffer);
       
   100     TInt ReceiveFileL(TDesC8& aFileParamBuffer);
       
   101 private: //variables
       
   102     
       
   103     // Local path data to be recived from the server
       
   104     TPckgBuf< TLocalPathMSRPData > iLocalPathMSRPDataPckg;
       
   105         
       
   106     // Connection data to be sent to server
       
   107     TPckgBuf< TConnectMSRPData > iConnectMSRPDataPckg;
       
   108     
       
   109     // Message sending data to be sent to server
       
   110     TPckgBuf< TSendMSRPData > iSendMSRPDataPckg;
       
   111 
       
   112     // Listen for incoming messages data package
       
   113     TPckgBuf< TListenMSRPData > iListenMSRPDataPckg;
       
   114 
       
   115     // Listen for response to sent messages data package
       
   116     TPckgBuf< TListenSendResultMSRPData > iSendResultListenMSRPDataPckg;
       
   117         
       
   118     };
   115     };
   119 
   116 
   120 #endif /* RMSRPSESSION_H_ */
   117 #endif /* RMSRPSESSION_H_ */