vtengines/videoteleng/CallCtrl/Inc/CVtCtlSessionContainer.h
changeset 0 ed9695c8bcbe
equal deleted inserted replaced
-1:000000000000 0:ed9695c8bcbe
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Container for ETel session and subsessions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CVTCTLSESSIONCONTAINER_H
       
    21 #define CVTCTLSESSIONCONTAINER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <etelmm.h>
       
    26 #include "MVtCtlLineEventObserver.h"
       
    27 #include "MVtCtlCallStatusObserver.h"
       
    28 #include "MVtCtlCallControl.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CVtCtlLineMonitor;
       
    32 class CVtCtlCallMonitor;
       
    33 class CVtCtlVideoCall;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  Container for ETel (sub)session(s).
       
    39 *
       
    40 *  @lib CSCallCtrl
       
    41 *  @since 2.6
       
    42 */
       
    43 NONSHARABLE_CLASS( CVtCtlSessionContainer ) : 
       
    44     public CBase, 
       
    45     public MVtCtlLineEventObserver,
       
    46     public MVtCtlCallStatusObserver
       
    47     {
       
    48     public:  // Constructors and destructor
       
    49         
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         * @param aObserver call status observer
       
    53         */
       
    54         static CVtCtlSessionContainer* NewL(
       
    55             MVtCtlCallStatusObserver& aObserver );
       
    56         
       
    57         /**
       
    58         * Destructor.
       
    59         */
       
    60         virtual ~CVtCtlSessionContainer();
       
    61 
       
    62     public: // MVtCtlLineEventObserver
       
    63 
       
    64         /**
       
    65         * @see MVtCtlLineEventObserver::HandleLineEventL
       
    66         */
       
    67         virtual void HandleLineEventL(
       
    68             const TLineEvent aEvent, 
       
    69             TDesC& aCallName );
       
    70 
       
    71         /*****************************************************
       
    72         *   Series 60 Customer / ETel
       
    73         *   Series 60  ETel API
       
    74         *****************************************************/
       
    75         virtual void HandleLineEventL( 
       
    76             const TLineEvent aEvent, 
       
    77             const RMobileCall::TMobileCallStatus aStatus );
       
    78 
       
    79     public: // MVtCtlCallStatusObserver
       
    80         
       
    81         /**
       
    82         * @see MVtCtlLineEventObserver::HandleCallStatusChangeL
       
    83         */
       
    84         virtual void HandleCallStatusChangeL( 
       
    85             TVtCtlSessionId aId,
       
    86             MVtCtlCallControl::TVtCtlState aStatus,
       
    87             MVtCtlCallControl::TVtCtlState aPreviousStatus );
       
    88 
       
    89     public: // New functions
       
    90 
       
    91         /**
       
    92         * Finds call by name.
       
    93         * @param aCallName search key
       
    94         * @return call or NULL if not found
       
    95         */
       
    96         CVtCtlVideoCall* FindCall( TDesC& aCallName ) const;
       
    97         
       
    98         /**
       
    99         * Finds call by session id.
       
   100         * @param aId search key
       
   101         * @return call or NULL if not found
       
   102         */
       
   103         CVtCtlVideoCall* FindCall( TVtCtlSessionId aId ) const;
       
   104 
       
   105         /**
       
   106         * Gets sessions.
       
   107         * @param aArray sessions are returned in this
       
   108         * @return number of sessions in aArray
       
   109         */
       
   110         TInt GetSessions( RVtCtlSessionIdArray& aArray ) const;        
       
   111 
       
   112     private:
       
   113 
       
   114         /**
       
   115         * Removes call from array and deletes it.
       
   116         * @param aId session id
       
   117         */
       
   118         void DestructCall( TVtCtlSessionId aId );
       
   119 
       
   120         /**
       
   121         * Checks that call is of correct type (multimedia)
       
   122         * @param aName call object
       
   123         * @param aName call name
       
   124         * @return ETrue if call is multimedia call
       
   125         */
       
   126         /*****************************************************
       
   127         *   Series 60 Customer / ETel
       
   128         *   Series 60  ETel API
       
   129         *****************************************************/
       
   130         TBool CheckCallTypeL( 
       
   131             RMobileCall& aCall,
       
   132             const TName& aName );
       
   133 
       
   134         /**
       
   135         * Initializes video call object
       
   136         * @param aCallName call name        
       
   137         * @return ETrue if call was initialized
       
   138         */
       
   139         TBool InitCallL( const TName& aCallName );
       
   140 
       
   141     private:
       
   142 
       
   143         /**
       
   144         * C++ constructor.
       
   145         * @param aObserver call status observer
       
   146         */
       
   147         CVtCtlSessionContainer( MVtCtlCallStatusObserver& aObserver );
       
   148 
       
   149         /**
       
   150         * By default Symbian 2nd phase constructor is private.
       
   151         */
       
   152         void ConstructL();
       
   153 
       
   154     private:
       
   155 
       
   156         /**
       
   157         * Class for maintaining session identities
       
   158         */
       
   159         class TVtCtlSessionIdentities
       
   160             {
       
   161             public:
       
   162                 // c++ default constructor
       
   163                 TVtCtlSessionIdentities();
       
   164 
       
   165                 /**
       
   166                 * Create new session id
       
   167                 * @return session id
       
   168                 */
       
   169                 TVtCtlSessionId Create();
       
   170 
       
   171                 /**
       
   172                 * Returns current session id
       
   173                 * @return session id
       
   174                 */
       
   175                 TVtCtlSessionId Current() const;
       
   176 
       
   177             private:
       
   178                 // Last session id
       
   179                 TVtCtlSessionId iCurrentId;
       
   180             };
       
   181 
       
   182     private:    // Data
       
   183         
       
   184         // ETel session
       
   185         RTelServer             iServer;
       
   186 
       
   187         // Phone session
       
   188         /*****************************************************
       
   189         *   Series 60 Customer / ETel
       
   190         *   Series 60  ETel API
       
   191         *****************************************************/
       
   192         RMobilePhone           iPhone;
       
   193 
       
   194         // Data line
       
   195         /*****************************************************
       
   196         *   Series 60 Customer / ETel
       
   197         *   Series 60  ETel API
       
   198         *****************************************************/
       
   199         RMobileLine            iLine;
       
   200 
       
   201         // Monitors new calls on line.
       
   202         CVtCtlLineMonitor*     iLineMonitor;
       
   203         
       
   204         // Array of ongoing video calls
       
   205         RPointerArray<CVtCtlVideoCall> iCalls;
       
   206 
       
   207         // Session id management
       
   208         TVtCtlSessionIdentities iSessionIds;
       
   209 
       
   210         // Call status observer
       
   211         MVtCtlCallStatusObserver& iObserver;
       
   212     };
       
   213 
       
   214 #endif      // CVTCTLSESSIONCONTAINER_H   
       
   215             
       
   216 // End of File