uiacceltk/hitchcock/Client/src/alfcontrolgroupsubsession.cpp
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2006 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:   Sub-session for control group
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "alfcontrolgroupsubsession.h"
       
    21 #include "alf/alfconstants.h"
       
    22 #include "alflogger.h"
       
    23 
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // Opens subsession
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 TInt RAlfControlGroupSubSession::Open( RAlfClient& aSession, TInt aId )
       
    31     {
       
    32     TAlfImplementationInformation info(EAlfControlGroupSubSessionOpen);
       
    33     TPckgC<TAlfImplementationInformation> infoBuf(info);
       
    34 
       
    35     return CreateSubSession( 
       
    36         aSession,
       
    37         EAlfCreateSubSession,
       
    38         TIpcArgs(&infoBuf, aId) );
       
    39     }
       
    40  
       
    41 // ---------------------------------------------------------------------------
       
    42 // Closes subsession
       
    43 // ---------------------------------------------------------------------------
       
    44 //   
       
    45 void RAlfControlGroupSubSession::Close()
       
    46     {
       
    47     CloseSubSession( EAlfCloseSubSession );
       
    48     }
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // Appends control
       
    52 // ---------------------------------------------------------------------------
       
    53 // 
       
    54 TInt RAlfControlGroupSubSession::Append( TInt aControlHandle )
       
    55     {
       
    56     TInt err =  SendReceive(
       
    57         EAlfDoSubSessionCmd, 
       
    58         TIpcArgs(EAlfControlGroupAppend, aControlHandle) );
       
    59     if ( err != KErrNone )
       
    60         {
       
    61         __ALFLOGSTRING1( "RAlfControlGroupSubSession::Append return error %d", err )
       
    62         }
       
    63     return err;
       
    64     }
       
    65     
       
    66 // ---------------------------------------------------------------------------
       
    67 // Removes a control
       
    68 // ---------------------------------------------------------------------------
       
    69 // 
       
    70 TInt RAlfControlGroupSubSession::Remove( TInt aControlHandle )
       
    71     {
       
    72     TInt err =  SendReceive(
       
    73         EAlfDoSubSessionCmd, 
       
    74         TIpcArgs(EAlfControlGroupRemove, aControlHandle) );
       
    75     if ( err != KErrNone )
       
    76         {
       
    77         __ALFLOGSTRING1( "RAlfControlGroupSubSession::Remove return error %d", err )
       
    78         }
       
    79     return err;
       
    80     }
       
    81     
       
    82 
       
    83 // ---------------------------------------------------------------------------
       
    84 // Enables transformation.
       
    85 // ---------------------------------------------------------------------------
       
    86 // 
       
    87 TInt RAlfControlGroupSubSession::EnableTransformation(
       
    88         TInt aTransformationHandle,
       
    89         TBool aIsTransformed )
       
    90     {
       
    91     TInt err = SendReceive(
       
    92         EAlfDoSubSessionCmd, 
       
    93         TIpcArgs( EAlfControlGroupEnableTransformation, aIsTransformed, aTransformationHandle) );
       
    94     if ( err != KErrNone )
       
    95         {
       
    96         __ALFLOGSTRING1( "RAlfControlGroupSubSession::EnableTransformation return error %d", err )
       
    97         }
       
    98     return err;
       
    99     }
       
   100