phoneengine/callhandling/inc/cpevideocallhandling.h
changeset 36 2eacb6118286
parent 30 ebdbd102c78a
child 37 ba76fc04e6c2
equal deleted inserted replaced
30:ebdbd102c78a 36:2eacb6118286
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  This file contains the header file of the CPEVideoCallHandling object
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPEVIDEOCALLHANDLING_H
       
    20 #define CPEVIDEOCALLHANDLING_H
       
    21 
       
    22 //INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <mpemessagesender.h>
       
    25 
       
    26 // CONSTANTS
       
    27 const TInt KPEDataCallIdBase( KPEMaximumNumberOfVoiceCalls +
       
    28          KPEMaximumNumberOfConferenceCalls );
       
    29 
       
    30 // MACROS
       
    31 // None.
       
    32 
       
    33 // DATA TYPES
       
    34 // None.
       
    35 
       
    36 // FUNCTION PROTOTYPES
       
    37 // None.
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 class CPESingleCall;
       
    41 class MPEPhoneModelInternal;
       
    42 class MPEMessageSender;
       
    43 class CCCE;
       
    44 class MCCECall;
       
    45 class CPECallArrayOwner;
       
    46 class CPEGprsTermination;
       
    47 class MPEMonitorCommandOwner;
       
    48 class MPEDataStore;
       
    49 
       
    50 // CLASS DECLARATION
       
    51 
       
    52 /**
       
    53 * Handles video call related events from phone engine
       
    54 *
       
    55 * @lib CallHandlingGsm.lib
       
    56 * @since Series60_4.0
       
    57 */
       
    58 class CPEVideoCallHandling : public CBase,
       
    59                              public MPEMessageSender
       
    60     {
       
    61     public: // Constructors and destructor
       
    62         /**
       
    63         * Two-phased constructor
       
    64         */
       
    65         static CPEVideoCallHandling* NewL( 
       
    66                 MPEMessageSender& aOwner,
       
    67                 MPEPhoneModelInternal& aModel, 
       
    68                 CCCE& aConvergedCallEngine,
       
    69                 CPECallArrayOwner& aCallArrayOwner );
       
    70 
       
    71         /**
       
    72         * Destructor
       
    73         */
       
    74         virtual ~CPEVideoCallHandling();
       
    75 
       
    76     public:    // New functions
       
    77         
       
    78         /**
       
    79         * Makes answer request.
       
    80         * @return Symbian OS error code
       
    81         */
       
    82         TInt AnswerCall();
       
    83 
       
    84         /**
       
    85         * Returns call terminated error
       
    86         * @param aCallId, call identification number
       
    87         * @return Return errorCode
       
    88         */        
       
    89         TInt CallTerminatedError( const TInt aCallId );
       
    90 
       
    91         /**
       
    92         * Checks if there are any connected calls
       
    93         */
       
    94         TBool ConnectedCalls();
       
    95 
       
    96         /**
       
    97         * Checks if the call has reserved serial communications data port for use
       
    98         * @param aCallId, call identification number
       
    99         * @return ETrue if the data port is reserved for use or EFalse if not
       
   100         */
       
   101         TBool DataPortInUse( TInt aCallId ) const;
       
   102 
       
   103         /**
       
   104         * Creates dialing request.
       
   105         * @param aNumber, the telephone number to be called
       
   106         * @return Symbian OS error code
       
   107         */
       
   108         TInt DialCall( const TPEPhoneNumber& aNumber, TInt& aCallId );
       
   109         
       
   110         /**
       
   111         * Makes HangUp request. 
       
   112         * @param aCallId, call identification number
       
   113         * @return Symbian OS error code
       
   114         */
       
   115         TInt HangUp( TInt aCallId );
       
   116 
       
   117         /**
       
   118         * Initializes a single video call
       
   119         * @param aCall handle to converged call engine call object
       
   120         */
       
   121         void InitCall( MCCECall& aCall );
       
   122 
       
   123         /**
       
   124         * Checks if the data call is a multimedia call
       
   125         * @param aCallId, call identification number
       
   126         * @return TBool, ETrue if this is a multimedia call, EFalse if not
       
   127         */
       
   128         TBool IsMultimedia( TInt aCallId ) const;
       
   129 
       
   130         /**
       
   131         * Notifies system for changes to the call state.
       
   132         * @param aMessage, message id
       
   133         * @param aCallId, call identification number
       
   134         */
       
   135         void NotifySystemCallStateChanged( 
       
   136             MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
       
   137             TInt aCallId );
       
   138 
       
   139         /**
       
   140         * Makes resume request to the Multimode ETel 
       
   141         * @param aCallId, call identification number
       
   142         * @return Symbian OS error code
       
   143         */
       
   144         TInt ResumeCall( TInt aCallId );
       
   145 
       
   146         /**
       
   147         * Makes terminate all connection request.
       
   148         * @return KErrNone if operation was successful
       
   149         * @return KerrNotFound if there is not a call 
       
   150         * @return KErrServerBusy if similar request is already being serviced 
       
   151         * @return KErrGeneral
       
   152         * @return KErrNotSupported if feature is not supported
       
   153         */
       
   154         TInt TerminateAllConnections();
       
   155 
       
   156         /**
       
   157         * Starts monitoring incoming data calls
       
   158         */
       
   159         void StartUp();
       
   160 
       
   161         /**
       
   162         * Swaps connected and held calls
       
   163         * @return Symbian OS error code
       
   164         */
       
   165         TInt SwapCalls();
       
   166 
       
   167         /**
       
   168         * Checks is phonenumber available
       
   169         * @param aCallId, call identification number
       
   170         */
       
   171         TBool IsPhoneNumberAvailable( const TInt aCallId );
       
   172 
       
   173         /**
       
   174         * Video Call By State
       
   175         */
       
   176         CPESingleCall* VideoCallByState( TPEState aState );
       
   177                                               
       
   178         /**
       
   179         * Video Call By call id
       
   180         */
       
   181         CPESingleCall* VideoCallById( TInt aCallId );
       
   182         
       
   183         /**
       
   184          * Replace active video call with a waiting video call
       
   185          * NOT SUPPORTED AS OF 5.1
       
   186          */
       
   187         TInt ReplaceActive( TInt aCallId  );
       
   188 
       
   189         /**
       
   190         * Returns the number of non-idle data calls
       
   191         * @return Number of calls. 
       
   192         */
       
   193         TInt GetNumberOfCalls ();
       
   194         
       
   195         /**
       
   196         * Get the call state
       
   197         * @paramaCallId, call identification number
       
   198         * @return the call state. 
       
   199         */
       
   200         TPEState GetCallState ( TInt aCallId );
       
   201         
       
   202         /**
       
   203         * Returns information of the data call
       
   204         * @param aCallInfo, call info.
       
   205         * @param aCallId, call identification number
       
   206         * @return Symbian OS error code
       
   207         */  
       
   208         TInt GetCallInfo( RMobileCall::TMobileCallInfoV3& aCallInfo, TInt aCallId );
       
   209         
       
   210         /**
       
   211         * Finds data call name given the call id
       
   212         * @param aCallId, call identification number
       
   213         * @return data call name
       
   214         */
       
   215         TName& VideoCallName( const TInt aCallId );
       
   216         
       
   217         /**
       
   218         * Returns call duration time
       
   219         * @param aDuration the duration value of the call
       
   220         * @return KErrNone or KErrNotFound.
       
   221         */    
       
   222         TInt GetCallDuration( TTimeIntervalSeconds& aDuration, TInt aCallId );
       
   223         
       
   224         /**
       
   225         * Makes reject request. 
       
   226         * @return Symbian OS error code
       
   227         */
       
   228         TInt RejectCall( );
       
   229 
       
   230         /**
       
   231         * Makes HangUp requests for all calls
       
   232         * @return Symbian OS error code (KErrNotFound if there are no calls to release)
       
   233         */
       
   234         TInt ReleaseAll();
       
   235 
       
   236     public:    // From MPEMessageSender
       
   237 
       
   238         /**
       
   239         * Reroutes error message to Phone Engine, usable by call objects
       
   240         * @param aCallId Identification number of the call.
       
   241         * @param aErrorCode, the error code stored after previous unsuccessful request
       
   242         */
       
   243         void SendErrorMessage( 
       
   244             const TInt aCallId, 
       
   245             const TInt aErrorCode );
       
   246         
       
   247         /**
       
   248         * Overrides CPEDataCallHandling::SendMessage to provide internal handling for gsm events
       
   249         * @param aMessage, message id
       
   250         */
       
   251         void SendMessage( 
       
   252             const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
       
   253             const TInt aCallId );
       
   254                   
       
   255         /**
       
   256         * Reroutes call messages
       
   257         * @param aMessage The message code of the message
       
   258         * @param aName Name of call fill be maped to call id
       
   259         */  
       
   260         void SendMessage( 
       
   261             const MEngineMonitor::TPEMessagesFromPhoneEngine aMessage,
       
   262             const TName& aName );
       
   263        
       
   264         /**
       
   265         * Reroutes call messages.
       
   266         * @param aMessage specifies the event that has taken place
       
   267         */
       
   268         void HandleInternalMessage(
       
   269             TInt aMessage );
       
   270         
       
   271     private:
       
   272         /**
       
   273         * C++ default constructor
       
   274         */
       
   275         CPEVideoCallHandling( MPEMessageSender& aOwner,
       
   276                               MPEPhoneModelInternal& aModel, 
       
   277                               CCCE& aConvergedCallEngine,
       
   278                               CPECallArrayOwner& aCallArrayOwner );
       
   279 
       
   280         /**
       
   281         * By default Symbian 2nd phase constructor is private
       
   282         */
       
   283         void ConstructL();
       
   284           
       
   285         /**
       
   286         * SetCallParams.
       
   287         * @param None.
       
   288         * @return None.
       
   289         */
       
   290         void SetCallParams( TInt aCallId );
       
   291         
       
   292         /**
       
   293         * Create new CPESingleCall object to CPECallArrayOwner and open new MCCECall ojcte to CCE.
       
   294         * @param None.
       
   295         * @return returns pointer to CPESingleCall objecte.
       
   296         */
       
   297         CPESingleCall* OpenNewCallL( const TPEPhoneNumber& aNumber );
       
   298         
       
   299         /**
       
   300         * Returns data call object by state
       
   301         * @param aState, call state
       
   302         * @return pointer to data call object
       
   303         */
       
   304         CPESingleCall* VideoCallByState( const TPEState aState ) const;
       
   305         
       
   306         /**
       
   307         * Returns data call object by name
       
   308         * @param aName, call name
       
   309         * @return pointer to data call
       
   310         */
       
   311         CPESingleCall* VideoCallByName( const TName& aName );
       
   312         
       
   313         /**
       
   314         * Checks if there are any data calls in the specified state
       
   315         * @param aState, call state
       
   316         * @return TBool, ETrue if there is a data call in the specified state
       
   317         *                EFalse if there is no data call in the specified state
       
   318         */
       
   319         TBool VideoCallInState( const TPEState& aState ) const;
       
   320         
       
   321         /**
       
   322         * Delete's call object and reset's datastore.
       
   323         * @param aCallid.
       
   324         */
       
   325         TInt ReleaseCallObject( const TInt aCallId  ); 
       
   326         
       
   327     private: // Data
       
   328     
       
   329         // Reference to owner of this class
       
   330         MPEMessageSender& iOwner;
       
   331         // Reference to phone model
       
   332         MPEPhoneModelInternal& iModel;
       
   333         // Etel phone connection.
       
   334         CCCE& iConvergedCallEngine;
       
   335         // Data call name stored for Video Call Manager use
       
   336         TName iDataCallName;
       
   337         // Call array owner
       
   338         CPECallArrayOwner& iCallArrayOwner;
       
   339         // Reference to data store
       
   340         MPEDataStore& iDataStore;
       
   341         // Restore Cause Video Call Reject 
       
   342         TBool iRestoreCauseVTCallReject;
       
   343         
       
   344         // Owned GPRS termination instance.
       
   345         CPEGprsTermination* iGprsInterface;
       
   346         /*
       
   347          * Call parameters for dialing
       
   348          * Own.
       
   349          */
       
   350         CCCECallParameters* iCallOpenParams;
       
   351 
       
   352 };
       
   353 
       
   354 #endif // CPEVIDEOCALLHANDLING_H
       
   355             
       
   356 // End of File