vtuis/videotelui/src/commands/cvtuicmdbase.cpp
branchRCL_3
changeset 35 779871d1e4f4
parent 0 ed9695c8bcbe
equal deleted inserted replaced
34:f15ac8e65a02 35:779871d1e4f4
       
     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:  UI command bases class implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "cvtuicmdbase.h"
       
    20 
       
    21 // ======== LOCAL FUNCTIONS ========
       
    22 
       
    23 // ---------------------------------------------------------------------------
       
    24 // FindCVtUiCmdBaseById
       
    25 // ---------------------------------------------------------------------------
       
    26 //
       
    27 TInt FindCVtUiCmdBaseById( const CVtUiCmdBase& aC1, const CVtUiCmdBase& aC2 )
       
    28     {
       
    29     return ( aC1.CommandId() - aC2.CommandId() );
       
    30     }
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // FindCVtUiCmdBaseByKey
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 TInt FindCVtUiCmdBaseByKey( const TInt* aKey, const CVtUiCmdBase& aC )
       
    37     {
       
    38     return ( *aKey - aC.CommandId() );
       
    39     }
       
    40 
       
    41 // ======== MEMBER FUNCTIONS ========
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // CVtUiCmdBase::CommandId
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 TInt CVtUiCmdBase::CommandId() const
       
    48     {
       
    49     return iCommandId;
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // CVtUiCmdBase::LinearOrder
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 TLinearOrder< CVtUiCmdBase > CVtUiCmdBase::LinearOrder()
       
    57     {
       
    58     return TLinearOrder< CVtUiCmdBase >( ::FindCVtUiCmdBaseById );
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // CVtUiCmdBase::LinearOrder
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 CVtUiCmdBase::TKeyOrder CVtUiCmdBase::KeyOrder()
       
    66     {
       
    67     return ::FindCVtUiCmdBaseByKey;
       
    68     }
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // CVtUiCmdBase::CVtUiCmdBase
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 CVtUiCmdBase::CVtUiCmdBase( TInt aCommandId ) : iCommandId( aCommandId )
       
    75     {
       
    76     }