phoneclientserver/phoneclient/Src/Ihf/RPhCltIhf.cpp
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     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:  IHF
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "RPhCltServer.h"
       
    22 #include "RPhCltIhf.h"
       
    23 
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // RPhCltIhf::RPhCltIhf
       
    29 // C++ default constructor can NOT contain any code, that
       
    30 // might leave.
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 EXPORT_C RPhCltIhf::RPhCltIhf( )
       
    34     : RSubSessionBase()
       
    35     {
       
    36     }
       
    37 
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // RPhCltIhf::Open
       
    41 // Connect to the  server - default number of message slots = 1
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 EXPORT_C TInt RPhCltIhf::Open( RPhCltServer& aServer, TInt /*aPriority*/ )
       
    45     {
       
    46     __ASSERT_ALWAYS( aServer.Handle() , 
       
    47         User::Panic( KPhClientPanicCategory , KErrBadHandle ) );
       
    48 
       
    49     return CreateSubSession( 
       
    50         aServer, 
       
    51         EPhoneServerIhfSubSessionOpen, 
       
    52         TIpcArgs() );
       
    53     }
       
    54 
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // RPhCltIhf::Close
       
    58 //
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 EXPORT_C void RPhCltIhf::Close()
       
    62     {    
       
    63     CloseSubSession( EPhoneServerIhfSubSessionClose );
       
    64     }
       
    65 
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // RPhCltIhf::SetIhfMode
       
    69 //
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 EXPORT_C TInt RPhCltIhf::SetIhfMode( TBool aMode, TBool aShowNote )
       
    73     {
       
    74     __ASSERT_ALWAYS( SubSessionHandle() , 
       
    75         User::Panic( KPhClientPanicCategory , KErrBadHandle ) );
       
    76 
       
    77     return SendReceive( 
       
    78         EPhoneServerIhfSubSessionSetMode, 
       
    79         TIpcArgs( 
       
    80             aMode,
       
    81             aShowNote ) );
       
    82     }
       
    83 
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // RPhCltIhf::SetIhfModeFromPhone
       
    87 //
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 EXPORT_C TInt RPhCltIhf::SetIhfModeFromPhone( TBool aMode, TBool aShowNote )
       
    91     {
       
    92     __ASSERT_ALWAYS( SubSessionHandle() , 
       
    93         User::Panic( KPhClientPanicCategory , KErrBadHandle ) );
       
    94     
       
    95     return SendReceive( 
       
    96         EPhoneServerIhfSubSessionSetModeFromPhone, 
       
    97         TIpcArgs( 
       
    98             aMode,
       
    99             aShowNote ) );
       
   100     }
       
   101 
       
   102 
       
   103 // End of File