convergedcallengine/csplugin/inc/cspvideocallconnectionhandler.h
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:  Delivers asynchronous requests to ETel
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSPVIDEOCALLCONNECTIONHANDLER_H
       
    20 #define CSPVIDEOCALLCONNECTIONHANDLER_H
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <etelmm.h>
       
    25 #include <rmmcustomapi.h>
       
    26 #include <es_sock.h>
       
    27 #include <es_enum.h>
       
    28 
       
    29 class CSPVideoCall;
       
    30 
       
    31 /**
       
    32 * Handles data call connection specific requests.
       
    33 * Provides canceling via CActive::Cancel().
       
    34 * 
       
    35 */
       
    36 class CSPVideoCallConnectionHandler : public CActive
       
    37     {
       
    38         
       
    39     public:
       
    40         
       
    41         /**
       
    42         * Constructs the requester via two phase.
       
    43         *
       
    44         * @param aObserver the observer for request errors
       
    45         * @param aCall ETel RMobileCall reference that is the object
       
    46         * of the request.
       
    47         */
       
    48         static CSPVideoCallConnectionHandler* NewL( CSPVideoCall& aObserver, 
       
    49                                            RMobileCall& aCall );
       
    50         
       
    51         /**
       
    52         * C++ default destructor
       
    53         */
       
    54         virtual ~CSPVideoCallConnectionHandler( );
       
    55 
       
    56         /**
       
    57         * Initializes connection including data port loaning.
       
    58         * @since S60 3.2
       
    59         * @return KErrNone if successful, else error code
       
    60         */
       
    61         TInt InitializeConnection(  );
       
    62         
       
    63         /**
       
    64         * Releases connection including data port loaning.
       
    65         * @since S60 3.2
       
    66         * @return KErrNone if successful, else error code
       
    67         */        
       
    68         TInt ReleaseConnection( );
       
    69 
       
    70         /**
       
    71         * Connection initialized.
       
    72         * @since S60 3.2
       
    73         * @return connection initialized status
       
    74         */
       
    75         TBool ConnectionInitialized(  );
       
    76      
       
    77     protected: // From CActive
       
    78         
       
    79         /**
       
    80         * From CActive
       
    81         * RunL
       
    82         * @since S60 3.2
       
    83         */
       
    84         void RunL();
       
    85         
       
    86         /**
       
    87         * From CActive
       
    88         * Cancels the monitor
       
    89         * @since S60 3.2
       
    90         */
       
    91         void DoCancel();
       
    92         
       
    93     private:
       
    94     
       
    95         /**
       
    96         * Constructs the connection handler.
       
    97         *
       
    98         * @param aObserver the observer for request errors
       
    99         * @param aCall ETel RMobileCall reference that is the object
       
   100         * of the request.
       
   101         */
       
   102         CSPVideoCallConnectionHandler( CSPVideoCall& aObserver, 
       
   103                               RMobileCall& aCall );
       
   104         
       
   105         /**
       
   106         * Constructing in the second phase.
       
   107         */
       
   108         void ConstructL();
       
   109 
       
   110         /**
       
   111         * Create socket connection.  
       
   112         */
       
   113         TInt CreateSocketConnection();
       
   114 
       
   115         /**
       
   116         * Loan data port. 
       
   117         * Initiates asynchronous request to loan dataport. 
       
   118         */
       
   119         TInt LoanDataPort();
       
   120         
       
   121         /**
       
   122         * Close socket connection.  
       
   123         */
       
   124         void CloseConnection();
       
   125                
       
   126         
       
   127     private: // data
       
   128         /**
       
   129         * Observer for request errors.
       
   130         */
       
   131         CSPVideoCall& iObserver;        
       
   132        
       
   133         /**
       
   134         * ETel call which this monitors
       
   135         */
       
   136         RMobileCall& iCall;        
       
   137         
       
   138         /**
       
   139         * Comm port info.
       
   140         */
       
   141         RCall::TCommPort iCommPort;
       
   142         
       
   143         /**
       
   144         * Connection reference
       
   145         */
       
   146         RConnection iConnection;
       
   147         
       
   148         /**
       
   149         * Tells if socket connection has been initialized
       
   150         */
       
   151         TBool iConnectionInitialized;
       
   152         
       
   153         /**
       
   154         * Socket Server handle.
       
   155         */
       
   156         RSocketServ iSocketServer;
       
   157         
       
   158     };
       
   159     
       
   160 #endif // CSPVIDEOCALLCONNECTIONHANDLER_H