phoneclientserver/phoneclient/Src/ExtCall/RPhCltExtCall.cpp
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 2002-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:  Ext Call
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include    "rphcltserver.h" 
       
    22 #include    "rphcltextcall.h" 
       
    23 #include    "tphcltextphonedialdata.h" 
       
    24 #include    "phcltclientserver.h" 
       
    25 
       
    26 // ============================ MEMBER FUNCTIONS ===============================
       
    27 
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // RPhCltExtCall::RPhCltExtCall
       
    31 // C++ constructor can NOT contain any code, that
       
    32 // might leave.
       
    33 // -----------------------------------------------------------------------------
       
    34 //
       
    35 RPhCltExtCall::RPhCltExtCall() 
       
    36     : RSubSessionBase(), iArgs( TPhCltCallArgs() )
       
    37     {    
       
    38     }
       
    39 
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // RPhCltExtCall::Open
       
    43 // 
       
    44 // Creates a subsession, as part of the given session.
       
    45 // -----------------------------------------------------------------------------
       
    46 //
       
    47 TInt RPhCltExtCall::Open( RPhCltServer& aServer )
       
    48     {
       
    49     __ASSERT_ALWAYS( aServer.Handle(), User::Panic( 
       
    50         KPhClientPanicCategory, 
       
    51         EPhCltClientSidePanicNullHandle ) );
       
    52 
       
    53     return CreateSubSession( 
       
    54         aServer, 
       
    55         EPhoneServerExtCallSubSessionOpen, 
       
    56         TIpcArgs() );
       
    57     }
       
    58 
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // RPhCltExtCall::Close
       
    62 // 
       
    63 // Closes the subsession.
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 void RPhCltExtCall::Close()
       
    67     {
       
    68     CloseSubSession( EPhoneServerExtCallSubSessionClose );
       
    69     }
       
    70 
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // RPhCltExtCall::Dial
       
    74 // 
       
    75 // Sends a dial request to the server.
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 void RPhCltExtCall::Dial( 
       
    79     TRequestStatus& aStatus, 
       
    80     const TPhCltTelephoneNumber& aNumber,
       
    81     const TPhCltNameBuffer& aName,
       
    82     const TInt aWindowGroupId,
       
    83     const TInt aRedial,
       
    84     const TPhCltContactId aContactId,
       
    85     const TBool aAllowNumberShowing )    
       
    86     {
       
    87     __ASSERT_ALWAYS( SubSessionHandle(), User::Panic( 
       
    88         KPhClientPanicCategory,
       
    89         EPhCltClientSidePanicNullHandle ) );
       
    90 
       
    91     // Populate a temporary arguments package
       
    92     TPhCltExtPhoneDialData args( aName, aNumber, aContactId, aWindowGroupId );
       
    93     args.SetRedial( aRedial );
       
    94     args.SetShowNumber( aAllowNumberShowing );
       
    95     
       
    96     // Do the dial
       
    97     Dial( aStatus, args );
       
    98     }
       
    99 
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // RPhCltExtCall::Dial
       
   103 // 
       
   104 // Sends a dial request to the server.
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 void RPhCltExtCall::Dial( 
       
   108     TRequestStatus& aStatus, 
       
   109     const TPhCltExtPhoneDialData& aData )
       
   110     {
       
   111     __ASSERT_ALWAYS( SubSessionHandle(), User::Panic( KPhClientPanicCategory,
       
   112         EPhCltClientSidePanicNullHandle ) );
       
   113     
       
   114     // Save the arguments
       
   115     TPhCltCallArgs args;
       
   116     aData.AsIPCStruct( args );
       
   117     iArgs() = args;
       
   118 
       
   119     // Request the dial
       
   120     SendReceive( 
       
   121         EPhoneServerExtCallSubSessionMakeCall, 
       
   122         TIpcArgs( &iArgs ), 
       
   123         aStatus );
       
   124     }
       
   125 
       
   126 
       
   127 // -----------------------------------------------------------------------------
       
   128 // RPhCltExtCall::CancelDial
       
   129 // 
       
   130 // Cancels the pending dial request.
       
   131 // -----------------------------------------------------------------------------
       
   132 //
       
   133 void RPhCltExtCall::CancelDial() const
       
   134     {
       
   135     __ASSERT_ALWAYS( const_cast< RPhCltExtCall* >( this )->SubSessionHandle(), 
       
   136         User::Panic( 
       
   137             KPhClientPanicCategory, EPhCltClientSidePanicNullHandle ) );
       
   138 
       
   139     SendReceive( 
       
   140         EPhoneServerExtCallSubSessionMakeCallCancel, 
       
   141         TIpcArgs() );
       
   142     }
       
   143 
       
   144 
       
   145 //  End of File