telephonyserverplugins/common_tsy/commontsy/inc/mmtsy/cmmconferencecalltsy.h
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
child 42 3adadc800673
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 /*
       
     2 * Copyright (c) 2006-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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMMCONFERENCECALLTSY_H
       
    21 #define CMMCONFERENCECALLTSY_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <etelmm.h>
       
    25 #include <et_phone.h>
       
    26 #include "MmTsy_timeoutdefs.h"
       
    27 #include <ctsy/tflogger.h>
       
    28 #include "cmmcalltsy.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CMmConferenceCallExtInterface;
       
    32 class CMmTsyReqHandleStore;
       
    33 class CMmPhoneTsy;
       
    34 
       
    35 // CONSTANTS
       
    36 _LIT( KDelimiter, ";" );
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41  * The CMmConferenceCallTsy object is an aggregation of all the
       
    42  * CMmCallTsy objects that are part of the conference call.
       
    43  */
       
    44 NONSHARABLE_CLASS( CMmConferenceCallTsy ) : public CSubSessionExtBase
       
    45     {
       
    46     
       
    47     public: // Enumerations
       
    48 
       
    49         /** Request types used for Conference Calls. */
       
    50         enum TConferenceCallRequestTypes
       
    51             {
       
    52             EMultimodeConferenceCallReqHandleUnknown, //0
       
    53             EMultimodeConferenceCallCreateConference,
       
    54             EMultimodeConferenceCallAddCall,
       
    55             EMultimodeConferenceCallSwap,
       
    56             EMultimodeConferenceCallHangUp,
       
    57             EMultimodeConferenceCallStatusChangeNotification, //5
       
    58             EMultimodeConferenceCallCapsChangeNotification,
       
    59             EMultimodeConferenceCallConferenceEventNotification, //7
       
    60 
       
    61             // ATTENTION:: Declare constant for those requests that need
       
    62             // own request handle record in iTsyReqHandleStore above the
       
    63             // following!
       
    64             EMultimodeConferenceCallMaxNumOfRequests
       
    65             };
       
    66     
       
    67     public: // Constructors and destructor
       
    68 
       
    69         /**
       
    70          * Two-phased constructor. 
       
    71          * @param CMmPhoneTsy* aMmPhone: pointer to the Phone object
       
    72          * @return created object
       
    73          */
       
    74         static CMmConferenceCallTsy* NewL( CMmPhoneTsy* aMmPhone );
       
    75 
       
    76         /**
       
    77          * Destructor
       
    78          */
       
    79         ~CMmConferenceCallTsy();
       
    80 
       
    81         // New functions
       
    82     
       
    83         /**
       
    84          * Pure virtual method inherited from MTelObjectTSY
       
    85          *          
       
    86          *
       
    87          * @param const TDesC& aName: name of the object that should be opened
       
    88          * @return opened object
       
    89          */
       
    90         CTelObject* OpenNewObjectByNameL( const TDesC& aName );
       
    91 
       
    92         /**
       
    93          * Pure virtual method inherited from MTelObjectTSY
       
    94          *          
       
    95          *
       
    96          * @param const TDesC& aName: name of the object that was opened
       
    97          * @return created object
       
    98          */
       
    99         CTelObject* OpenNewObjectL( TDes& aNewName );
       
   100 
       
   101         /**
       
   102          * Dispatches multimode API functions calls
       
   103          *          
       
   104          *
       
   105          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   106          * @param const TInt aIpc: request IPC number
       
   107          * @param const TDataPackage& aPackage: packaged request parameters
       
   108          * @return result of the request
       
   109          */
       
   110         TInt ExtFunc( const TTsyReqHandle aTsyReqHandle, const TInt aIpc,
       
   111             const TDataPackage& aPackage );
       
   112 
       
   113         /**
       
   114          * Returns request mode for given IPC number
       
   115          *          
       
   116          *
       
   117          * @param const TInt aIpc: request IPC number
       
   118          * @return request mode
       
   119          */
       
   120         CTelObject::TReqMode ReqModeL( const TInt aIpc );
       
   121 
       
   122         /**
       
   123          * Returns number of slots to be used for given IPC
       
   124          *          
       
   125          *
       
   126          * @param const TInt aIpc: request IPC number
       
   127          * @return result of the request
       
   128          */
       
   129         TInt NumberOfSlotsL( const TInt aIpc );
       
   130 
       
   131         /**
       
   132          * Cancels request that's IPC number and request handle are given in
       
   133          * parameters
       
   134          *          
       
   135          *
       
   136          * @param const TInt aIpc: request IPC number
       
   137          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   138          * @return result of the request
       
   139          */
       
   140         TInt CancelService( const TInt aIpc, 
       
   141             const TTsyReqHandle aTsyReqHandle );
       
   142 
       
   143         /**
       
   144          * Initialisation method that is called by ETel Server
       
   145          *          
       
   146          *
       
   147          */
       
   148         void Init();
       
   149 
       
   150         /**
       
   151          * Returns conference call status
       
   152          *          
       
   153          *
       
   154          * @return CC status
       
   155          */
       
   156         RMobileConferenceCall::TMobileConferenceStatus Status() const;
       
   157 
       
   158         /**
       
   159          * This function returns conference call capabilities
       
   160          *          
       
   161          *
       
   162          * @return CC capabilities
       
   163          */
       
   164         TUint32 Caps() const;
       
   165 
       
   166         /**
       
   167          * Register given notification
       
   168          *          
       
   169          *
       
   170          * @param const TInt aIpc: request IPC number
       
   171          * @return result of the request
       
   172          */
       
   173         TInt RegisterNotification( const TInt aIpc );
       
   174 
       
   175         /**
       
   176          * Deregister given notification
       
   177          *          
       
   178          *
       
   179          * @param const TInt aIpc: request IPC number
       
   180          * @return result of the request
       
   181          */
       
   182         TInt DeregisterNotification( const TInt aIpc );
       
   183 
       
   184         /**
       
   185          * Complete caps change notification
       
   186          *          
       
   187          *
       
   188          * @param New conference call capabilities
       
   189          */
       
   190         void CompleteNotifyCapsChange( TUint32 aCaps );
       
   191 
       
   192         /**
       
   193          * Complete creation of conference call
       
   194          *          
       
   195          *
       
   196          * @param TInt aResult: error code
       
   197          */
       
   198         void CompleteCreateConference( TInt aResult );
       
   199 
       
   200         /**
       
   201          * Complete Adding a call to Conference call
       
   202          *          
       
   203          *
       
   204          * @param TInt aResult: error code
       
   205          */
       
   206         void CompleteAddCall( TInt aResult );
       
   207 
       
   208         /**
       
   209          * Complete swap request
       
   210          *          
       
   211          *
       
   212          * @param TInt aResult: error code
       
   213          */
       
   214         void CompleteSwap( TInt aResult );
       
   215 
       
   216         /**
       
   217          * Complete hangup request
       
   218          *          
       
   219          *
       
   220          * @param TInt aResult: error code
       
   221          */
       
   222         void CompleteHangUp( TInt aResult );
       
   223 
       
   224         /**
       
   225          * Complete conference status change notification
       
   226          *          
       
   227          *
       
   228          */
       
   229         void CompleteNotifyConferenceStatusChange();
       
   230 
       
   231         /**
       
   232          * Complete conference event notification
       
   233          *          
       
   234          *
       
   235          * @param TName aName: name of the call to which the event occured
       
   236          * @param RMobileConferenceCall::TMobileConferenceEvent aEvent: event
       
   237          */
       
   238         void CompleteNotifyConferenceEvent( const TName& aName,
       
   239             RMobileConferenceCall::TMobileConferenceEvent aEvent );
       
   240 
       
   241         /**
       
   242          * Checks if given call can be splitted from the conference call
       
   243          *          
       
   244          *
       
   245          * @param TInt aCallId: call ID
       
   246          * @return TBool: ETrue if can be splitted, else EFalse
       
   247          */
       
   248         TBool IsGoOneToOneSupported( TInt aCallId );
       
   249 
       
   250         /**
       
   251          * Returns the active Conference call extension
       
   252          *          
       
   253          *
       
   254          * @return active CC extension
       
   255          */
       
   256         CMmConferenceCallExtInterface* GetActiveConferenceCallExtension();
       
   257 
       
   258         /**
       
   259          * Sets the active call extension
       
   260          *          
       
   261          *
       
   262          * @param CMmConferenceCallExtInterface*: new active CC extension
       
   263          * @return KErrNone or error value
       
   264          */
       
   265         TInt SetActiveConferenceCallExtension(
       
   266                 CMmConferenceCallExtInterface* aMmConferenceCallExt );
       
   267 
       
   268         /**
       
   269          * Checks if is possible to create a conference call
       
   270          *          
       
   271          *
       
   272          */
       
   273         void CheckConferenceCapability();
       
   274 
       
   275         /**
       
   276          * Returns current count of calls in conference call
       
   277          *          
       
   278          *
       
   279          * @return Number of calls in conference call
       
   280          */
       
   281         TInt NumberOfCallsInConference() const;
       
   282 
       
   283         /**
       
   284          * Can be used for checking if certain request is pending in TSY
       
   285          *          
       
   286          *
       
   287          * @param CMmConferenceCallTsy::TConferenceCallRequestTypes
       
   288          *           aReqType: request type
       
   289          * @return request active or not
       
   290          */
       
   291         TBool ServiceRequested(
       
   292             CMmConferenceCallTsy::TConferenceCallRequestTypes aReqType );
       
   293 
       
   294         /**
       
   295          * Inform Conference Call object that a status of a single 
       
   296          * call has changed
       
   297          *          
       
   298          *
       
   299          * @param RMobileCall::TMobileCallStatus aNewStatus: new status of a single call
       
   300          * @param TInt aCallId: call ID of that call
       
   301          */
       
   302         void CallStatusChanged( RMobileCall::TMobileCallStatus aNewStatus,
       
   303 			     TInt aCallId );
       
   304 		
       
   305 		    /**
       
   306          * Returns the Phone object
       
   307          *          
       
   308          *
       
   309          * @return Pointer to the Phone object
       
   310          */
       
   311         CMmPhoneTsy* Phone();
       
   312 
       
   313 #ifdef REQHANDLE_TIMER
       
   314         /**
       
   315          * Calls the needed complete method due timer expiration
       
   316          *          
       
   317          *
       
   318          * @param TInt aReqHandleType: req handle type.
       
   319          * @param TInt aError: error value
       
   320          */
       
   321         void Complete( TInt aReqHandleType, TInt aError );
       
   322 #endif
       
   323 
       
   324 #ifdef USING_CTSY_DISPATCHER
       
   325         
       
   326         /**
       
   327          * Get call object for connected call used in conference creation phase. 
       
   328          */         
       
   329         CMmCallTsy* ConnectedCall() { return iConnectedCall; }
       
   330         
       
   331         /**
       
   332          * Get call object for held call used in conference creation phase. 
       
   333          */         
       
   334         CMmCallTsy* HeldCall() { return iHoldCall; }
       
   335         
       
   336 #endif // USING_CTSY_DISPATCHER       
       
   337         
       
   338     private:
       
   339     
       
   340         /**
       
   341          * C++ default constructor.
       
   342          */
       
   343         CMmConferenceCallTsy();
       
   344 
       
   345         /**
       
   346          * By default Symbian 2nd phase constructor is private.
       
   347          */
       
   348         void ConstructL();
       
   349 
       
   350         /**
       
   351          * Handles extended client requests. Uses TRAP to ensure functioning on
       
   352          * memory allocation failure
       
   353          *          
       
   354          *
       
   355          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   356          * @param const TInt aIpc: request IPC number
       
   357          * @param const TDataPackage& aPackage: packaged request parameters
       
   358          * @return result of the request
       
   359          */
       
   360         TInt DoExtFuncL( const TTsyReqHandle aTsyReqHandle,
       
   361             const TInt aIpc, const TDataPackage& aPackage);
       
   362 
       
   363         /**
       
   364          * Returns the call capabilities to the client
       
   365          *          
       
   366          *
       
   367          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   368          * @param TUint32* aCaps: pointer where to copy the capabilities
       
   369          * @return result of the request
       
   370          */
       
   371         TInt GetCaps( const TTsyReqHandle aTsyReqHandle, TUint32* aCaps );
       
   372 
       
   373         /**
       
   374          * Request for Conference call caps change notifications
       
   375          *          
       
   376          *
       
   377          * @param TUint32* aCaps: pointer where to copy the capabilities when changed
       
   378          * @return result of the request
       
   379          */
       
   380         TInt NotifyCapsChange( TUint32* aCaps );
       
   381 
       
   382         /**
       
   383          * Cancel Conference call caps change notifications
       
   384          *          
       
   385          *
       
   386          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   387          * @return result of the request
       
   388          */
       
   389         TInt NotifyCapsChangeCancel( const TTsyReqHandle aTsyReqHandle );
       
   390 
       
   391         /**
       
   392          * This method allows clients to create the initial conference call
       
   393          *          
       
   394          *
       
   395          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   396          * @return result of the request
       
   397          */
       
   398         TInt CreateConferenceL( const TTsyReqHandle aTsyReqHandle );
       
   399 
       
   400         /**
       
   401          * This method adds the single voice call specified by the aCallName
       
   402          * parameter to an existing conference call
       
   403          *          
       
   404          *
       
   405          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   406          * @param const TName* aCallName: name of the call to be added
       
   407          * @return result of the request
       
   408          */
       
   409         TInt AddCallL( const TTsyReqHandle aTsyReqHandle,
       
   410             const TName* aCallName );
       
   411 
       
   412         /**
       
   413          * Allows a client to switch a conference call between "Active" and
       
   414          * "Hold" states
       
   415          *          
       
   416          *
       
   417          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   418          * @return result of the request
       
   419          */
       
   420         TInt SwapL( const TTsyReqHandle aTsyReqHandle );
       
   421 
       
   422         /**
       
   423          * This method terminates the whole conference call
       
   424          *          
       
   425          *
       
   426          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   427          * @return TInt: result of the request
       
   428          */
       
   429         TInt HangUpL( const TTsyReqHandle aTsyReqHandle );
       
   430 
       
   431         /**
       
   432          * This method returns the number of calls that are currently part of
       
   433          * the conference call
       
   434          *          
       
   435          *
       
   436          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   437          * @param TInt* aCount: number of calls in conference
       
   438          * @return result of the request
       
   439          */
       
   440         TInt EnumerateCalls( const TTsyReqHandle aTsyReqHandle,
       
   441             TInt* aCount );
       
   442 
       
   443         /**
       
   444          * This method returns a current snapshot of the call information
       
   445          * associated with the call specified by the aIndex parameter
       
   446          *          
       
   447          *
       
   448          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   449          * @param TInt* aIndex: index of the call
       
   450          * @param TDes8* aCallInfo: pointer where to copy the call information
       
   451          * @return result of the request
       
   452          */
       
   453         TInt GetMobileCallInfo( const TTsyReqHandle aTsyReqHandle,
       
   454             TInt* aIndex, TDes8* aCallInfo );
       
   455 
       
   456         /**
       
   457          * This method allows clients to retrieve the current status of the
       
   458          * conference call
       
   459          *          
       
   460          *
       
   461          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   462          * @param RMobileConferenceCall::TMobileConferenceStatus*
       
   463          *       aStatus: pointer where to copy the CC status
       
   464          * @return result of the request
       
   465          */
       
   466         TInt GetConferenceStatus( const TTsyReqHandle aTsyReqHandle,
       
   467             RMobileConferenceCall::TMobileConferenceStatus* aStatus );
       
   468 
       
   469         /**
       
   470          * This method allows clients to be notified of a change in the status
       
   471          * of a conference call
       
   472          *          
       
   473          *
       
   474          * @param RMobileConferenceCall::TMobileConferenceStatus*
       
   475          *       aStatus: pointer where to copy the CC status when changed
       
   476          * @return TInt: result of the request
       
   477          */
       
   478         TInt NotifyConferenceStatusChange(
       
   479             RMobileConferenceCall::TMobileConferenceStatus* aStatus );
       
   480 
       
   481         /**
       
   482          * Cancels an outstanding asynchronous NotifyConferenceStatusChange 
       
   483          * request
       
   484          *          
       
   485          *
       
   486          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   487          * @return result of the request
       
   488          */
       
   489         TInt NotifyConferenceStatusChangeCancel(
       
   490             const TTsyReqHandle aTsyReqHandle );
       
   491 
       
   492         /**
       
   493          * This method allows a client to be notified when a conference call
       
   494          * event occurs
       
   495          *          
       
   496          *
       
   497          * @param RMobileConferenceCall::TMobileConferenceEvent*
       
   498          *       aEvent: pointer where to copy the CC event when occured
       
   499          * @param TName* aCallName: name of the call to which the eevnt 
       
   500          * occurred
       
   501          * @return result of the request
       
   502          */
       
   503         TInt NotifyConferenceEvent(
       
   504             RMobileConferenceCall::TMobileConferenceEvent* aEvent,
       
   505             TName* aCallName );
       
   506 
       
   507         /**
       
   508          * Cancels an outstanding asynchronous NotifyConferenceEvent request
       
   509          *          
       
   510          *
       
   511          * @param const TTsyReqHandle aTsyReqHandle: TSY request handle
       
   512          * @return result of the request
       
   513          */
       
   514         TInt NotifyConferenceEventCancel( const TTsyReqHandle aTsyReqHandle );
       
   515 
       
   516         /**
       
   517          * Resets internal attributes of Conference call
       
   518          *
       
   519          */
       
   520         void ResetAttributes();
       
   521 
       
   522         /**
       
   523          * Remove calls from Conference call that are not participating it
       
   524          */
       
   525 		void RemoveNonParticipatingCall();
       
   526 
       
   527 
       
   528 #ifdef REQHANDLE_TIMER
       
   529         /**
       
   530          * Chooses the type of response, automatic or common
       
   531          *          
       
   532          *
       
   533          * @param const TInt aIndex: index where to store the req handle.
       
   534          * @param const TTsyReqHandle aTsyReqHandle: req handle to be stored.
       
   535          */
       
   536         void SetTypeOfResponse( const TInt aIndex,
       
   537             const TTsyReqHandle aTsyReqHandle );
       
   538 #endif
       
   539 
       
   540 #ifdef TF_LOGGING_ENABLED
       
   541         /**
       
   542          * Overloads original ReqCompleted for logging purposes
       
   543          *          
       
   544          *
       
   545          * @param const TTsyReqHandle aTsyReqHandle
       
   546          * @param const Tint aError
       
   547          */
       
   548         void ReqCompleted( const TTsyReqHandle aTsyReqHandle,
       
   549             const TInt aError );
       
   550 #endif
       
   551 
       
   552     private: // member data
       
   553 
       
   554         /**
       
   555          * Pointer to multimode phone object
       
   556          */         
       
   557         CMmPhoneTsy* iMmPhone;
       
   558 
       
   559         /**
       
   560          * Pointer to external conference call interface object
       
   561          * Own.
       
   562          */                  
       
   563         CMmConferenceCallExtInterface* iMmConferenceCallExtInterface;
       
   564 
       
   565         /**
       
   566          * Number of calls in conference call
       
   567          */         
       
   568         TInt iNumOfCallsInConferenceCall;
       
   569 
       
   570         /**
       
   571          * Conference call status
       
   572          */         
       
   573         RMobileConferenceCall::TMobileConferenceStatus iStatus;
       
   574 
       
   575         /**
       
   576          * Conference call capabilities
       
   577          */         
       
   578         TUint32 iConferenceCaps;
       
   579 
       
   580         /**
       
   581          * Flag telling if confenrence call caps have changed
       
   582          */         
       
   583         TBool iCapsChanged;
       
   584 
       
   585         /**
       
   586          * Last used req handle type
       
   587          */         
       
   588         TConferenceCallRequestTypes iReqHandleType;
       
   589 
       
   590         /**
       
   591          * Table for conference call request handles
       
   592          */         
       
   593         TTsyReqHandle iConferenceCallReqHandles[
       
   594             EMultimodeConferenceCallMaxNumOfRequests];
       
   595 
       
   596         /**
       
   597          * Storate for Conference call's TSY req handles
       
   598          * Own.         
       
   599          */         
       
   600         CMmTsyReqHandleStore* iTsyReqHandleStore;
       
   601 
       
   602         /**
       
   603          * Pointer to the conference call capabilities
       
   604          */         
       
   605         TUint32* iRetCaps;
       
   606 
       
   607         /**
       
   608          * Pointer to the conference call status
       
   609          */         
       
   610         RMobileConferenceCall::TMobileConferenceStatus* iRetStatus;
       
   611 
       
   612         /**
       
   613          * Pointer to the name of the call that has had a conference event
       
   614          */         
       
   615         TName* iRetConferenceEventCallName;
       
   616 
       
   617         /**
       
   618          * Pointer to the conference call event
       
   619          */         
       
   620         RMobileConferenceCall::TMobileConferenceEvent* iRetConferenceEvent;
       
   621 
       
   622         /**
       
   623          * Name of the call to be added to Conference call
       
   624          */         
       
   625         TName iAddCallName;
       
   626         
       
   627         /**
       
   628          * used in creation phase to store  call objected
       
   629          */         
       
   630         CMmCallTsy* iConnectedCall;
       
   631         
       
   632         /**
       
   633          * used in creation phase to store  call objected
       
   634          */         
       
   635         CMmCallTsy* iHoldCall;
       
   636 
       
   637     };
       
   638 
       
   639 #endif // CMMCONFERENCECALLTSY_H
       
   640 
       
   641 // End of File