vtengines/videoteleng/CallCtrl/Src/CVtCtlCallControlStub.cpp
changeset 0 ed9695c8bcbe
equal deleted inserted replaced
-1:000000000000 0:ed9695c8bcbe
       
     1 /*
       
     2 * Copyright (c) 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:  Stub version of call control.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #pragma CTC SKIP
       
    20 // INCLUDE FILES
       
    21 #include    "CVtCtlCallControl.h"
       
    22 #include    "MVtCtlEventObserver.h"
       
    23 #include    "CVtCtlSessionContainer.h"
       
    24 #include    "CVtCtlVideoCall.h"
       
    25 #include    "VtCtlTypes.h"
       
    26 #include    <CVtLogger.h>
       
    27 
       
    28 // CONSTANTS
       
    29 _LIT( KVtCtlStubTelNumber, "0501234567" );
       
    30 
       
    31 // Duration
       
    32 const TInt KVtCtlStubDuration = 5;
       
    33 
       
    34 
       
    35 // ============================ MEMBER FUNCTIONS ===============================
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CVtCtlCallControl::NewL
       
    39 // Two-phase constructor.
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 CVtCtlCallControl* CVtCtlCallControl::NewL(
       
    43             MVtCtlEventObserver& aEventObserver )
       
    44     {
       
    45     __VTPRINTENTER( "CVtCtlCallControlStub.NewL" )
       
    46     CVtCtlCallControl* self = new ( ELeave )
       
    47         CVtCtlCallControl( aEventObserver );
       
    48     CleanupStack::PushL( self );
       
    49     self->ConstructL();
       
    50     CleanupStack::Pop();
       
    51     __VTPRINTEXIT( "CVtCtlCallControlStub.NewL" )
       
    52     return self;
       
    53     }
       
    54         
       
    55 // -----------------------------------------------------------------------------
       
    56 // CVtCtlCallControl::~CVtCtlCallControl
       
    57 // Destructor
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 CVtCtlCallControl::~CVtCtlCallControl()
       
    61     {
       
    62     __VTPRINTENTER( "CVtCtlCallControlStub.~" )
       
    63     delete iContainer;
       
    64     // uninitialize logging
       
    65     VTLOGUNINIT
       
    66     __VTPRINTEXIT( "CVtCtlCallControlStub.~" )
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CVtCtlCallControl::CVtCtlCallControl
       
    71 // c++ constructor
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 CVtCtlCallControl::CVtCtlCallControl(
       
    75     MVtCtlEventObserver& aEventObserver) :
       
    76     iEventObserver( aEventObserver )
       
    77     {
       
    78     __VTPRINTENTER( "CVtCtlCallControlStub.CVtCtlCallControl" )
       
    79     __VTPRINTEXIT( "CVtCtlCallControlStub.CVtCtlCallControl" )
       
    80     }
       
    81 
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CVtCtlCallControl::ConstructL
       
    85 // 
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 void CVtCtlCallControl::ConstructL()
       
    89     {
       
    90     __VTPRINTENTER( "CVtCtlCallControlStub.ConstructL" )
       
    91     // initialize logging
       
    92     VTLOGINIT
       
    93     iContainer = CVtCtlSessionContainer::NewL( *this );
       
    94     __VTPRINTEXIT( "CVtCtlCallControlStub.ConstructL" )
       
    95     }
       
    96 
       
    97 // -----------------------------------------------------------------------------
       
    98 // CVtCtlCallControl::GetDuration
       
    99 // 
       
   100 // -----------------------------------------------------------------------------
       
   101 //
       
   102 TInt CVtCtlCallControl::GetDuration(
       
   103     TVtCtlSessionId ,
       
   104     TVtCtlDuration& aDuration )     
       
   105     {
       
   106     __VTPRINTENTER( "CVtCtlCallControlStub.GetDuration" )
       
   107     aDuration = 5;
       
   108     __VTPRINTEXIT( "CVtCtlCallControlStub.GetDuration" )
       
   109     return KErrNone;
       
   110     }
       
   111 
       
   112 // -----------------------------------------------------------------------------
       
   113 // CVtCtlCallControl::GetSessionInfoL
       
   114 // 
       
   115 // -----------------------------------------------------------------------------
       
   116 //
       
   117 void CVtCtlCallControl::GetSessionInfoL( 
       
   118     TVtCtlSessionId ,
       
   119     TDes8& aInfo )
       
   120     {
       
   121     __VTPRINTENTER( "CVtCtlCallControlStub.GetSessionInfoL" )
       
   122     
       
   123     TPckg<TVtCtlCSSessionInfoV1>& pckg = 
       
   124         reinterpret_cast<TPckg<TVtCtlCSSessionInfoV1>&>( aInfo );
       
   125     __VTPRINT( DEBUG_SESSION, "VtCtl:CallCtrl. 1" )
       
   126     TVtCtlCSSessionInfoV1& info = pckg();
       
   127     __VTPRINT( DEBUG_SESSION, "VtCtl:CallCtrl. 2" )
       
   128     info.iDirection = MVtCtlCallControl::EDirectionMobileOriginated;
       
   129     info.iDuration = KVtCtlStubDuration;
       
   130     info.iState = MVtCtlCallControl::EConnected;
       
   131     info.iPreviousState = MVtCtlCallControl::EAlerting;
       
   132     info.iTelNumber = KVtCtlStubTelNumber;
       
   133     __VTPRINTEXIT( "CVtCtlCallControlStub.GetSessionInfoL" )
       
   134     }
       
   135 
       
   136 
       
   137 // -----------------------------------------------------------------------------
       
   138 // CVtCtlCallControl::GetState
       
   139 // 
       
   140 // -----------------------------------------------------------------------------
       
   141 //
       
   142 MVtCtlCallControl::TVtCtlState CVtCtlCallControl::GetSessionState( 
       
   143     TVtCtlSessionId  ) const
       
   144     {
       
   145     __VTPRINTENTER( "CVtCtlCallControlStub.GetSessionState" )
       
   146     MVtCtlCallControl::TVtCtlState state = MVtCtlCallControl::EConnected;    
       
   147     __VTPRINTEXIT( "CVtCtlCallControlStub.GetSessionState" )
       
   148     return state;
       
   149     }
       
   150 
       
   151 // -----------------------------------------------------------------------------
       
   152 // CVtCtlCallControl::GetPreviousState
       
   153 // 
       
   154 // -----------------------------------------------------------------------------
       
   155 //
       
   156 MVtCtlCallControl::TVtCtlState CVtCtlCallControl::GetPreviousPreviousState(
       
   157     TVtCtlSessionId  ) const
       
   158     {
       
   159     __VTPRINTENTER( "CVtCtlCallControlStub.GetPreviousPreviousState" )
       
   160     MVtCtlCallControl::TVtCtlState state = EAlerting;
       
   161     __VTPRINTEXIT( "CVtCtlCallControlStub.GetPreviousPreviousState" )
       
   162     return state;
       
   163     }
       
   164 
       
   165 
       
   166 // -----------------------------------------------------------------------------
       
   167 // CVtCtlCallControl::HandleCallStatusChangeL
       
   168 // Notifies
       
   169 // -----------------------------------------------------------------------------
       
   170 //
       
   171 void CVtCtlCallControl::HandleCallStatusChangeL(
       
   172     TVtCtlSessionId ,
       
   173     MVtCtlCallControl::TVtCtlState ,
       
   174     MVtCtlCallControl::TVtCtlState )
       
   175     {
       
   176     __VTPRINTENTER( "CVtCtlCallControlStub.HandleCallStatusChangeL" )
       
   177     __VTPRINTEXIT( "CVtCtlCallControlStub.HandleCallStatusChangeL" )
       
   178     }
       
   179 
       
   180 // -----------------------------------------------------------------------------
       
   181 // CVtCtlCallControl::ValidateDataExtensionL
       
   182 // Validates extension id of descriptor representation of data type.
       
   183 // -----------------------------------------------------------------------------
       
   184 //
       
   185 void CVtCtlCallControl::ValidateDataExtensionL(
       
   186             TDesC8& ,
       
   187             TInt  )
       
   188     {
       
   189     __VTPRINTENTER( "CVtCtlCallControlStub.ValidateDataExtensionL" )
       
   190     __VTPRINTEXIT( "CVtCtlCallControlStub.ValidateDataExtensionL" )
       
   191     }
       
   192 #pragma CTC ENDSKIP
       
   193 //  End of File  
       
   194