phoneapp/phoneuiutils/src/tcbacommandmapping.cpp
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Class holds mapping between CBA and custom commands.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "tcbacommandmapping.h"
       
    20 
       
    21 /** Uninitialized command identifier. */
       
    22 const TInt KUninitializedCommmandId = -1;
       
    23 
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // TCbaCommandMapping::TCbaCommandMapping
       
    28 // C++ default constructor for null object creation.
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 TCbaCommandMapping::TCbaCommandMapping()
       
    32     : 
       
    33     iCbaCommandId( KUninitializedCommmandId ), 
       
    34     iCustomCommandId( KUninitializedCommmandId ) 
       
    35     {}
       
    36 
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // TCbaCommandMapping::TCbaCommandMapping
       
    40 // Overloaded C++ constructor.
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 TCbaCommandMapping::TCbaCommandMapping( 
       
    44         TInt aCbaCommandId, TInt aCustomCommandId )
       
    45     : 
       
    46     iCbaCommandId( aCbaCommandId ), iCustomCommandId( aCustomCommandId ) 
       
    47     {}
       
    48 
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // TCbaCommandMapping::CbaCommandId
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 TInt TCbaCommandMapping::CbaCommandId() const 
       
    55     { 
       
    56     return iCbaCommandId; 
       
    57     }
       
    58 
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // TCbaCommandMapping::CustomCommandId
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 TInt TCbaCommandMapping::CustomCommandId() const 
       
    65     { 
       
    66     return iCustomCommandId; 
       
    67     }
       
    68 
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // TCbaCommandMapping::operator==
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 TBool TCbaCommandMapping::operator==( 
       
    75         const TCbaCommandMapping& aMapping ) const
       
    76     {
       
    77     return ( iCbaCommandId == aMapping.CbaCommandId() &&
       
    78              iCustomCommandId == aMapping.CustomCommandId() );
       
    79     }
       
    80 
       
    81 // end of file