epoc32/include/app/TPbk2IconId.h
branchSymbian3
changeset 4 837f303aceeb
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Phonebook 2 icon identification.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TPBK2ICONID_H
       
    20 #define TPBK2ICONID_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <e32std.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class TResourceReader;
       
    27 
       
    28 /**
       
    29  * Phonebook 2 icon identification. This class is responsible for
       
    30  * implementing a unique identifier for icons in the Phonebook
       
    31  * context.
       
    32  */
       
    33 class TPbk2IconId
       
    34     {
       
    35     public: // Construction
       
    36         /**
       
    37          * Default C++ constructor.
       
    38          * Constructs a null icon id.
       
    39          */
       
    40         IMPORT_C TPbk2IconId();
       
    41 
       
    42         /**
       
    43          * Constructor that takes the owner uid and icon id.
       
    44          *
       
    45          * @param aOwnerUid     The UID that specifies whose icon this is.
       
    46          *                      It's used the identify icons from different
       
    47          *                      components that are used in the same data
       
    48          *                      structure. The UID could be e.g a
       
    49          *                      Phonebook 2 UID for application defined
       
    50          *                      icons and ECom implementation UID for UI
       
    51          *                      extension icons.
       
    52          * @param aIconId       The id of the icon under the owner.
       
    53          */
       
    54         IMPORT_C TPbk2IconId(
       
    55                 const TUid& aOwnerUid,
       
    56                 TInt aIconId );
       
    57 
       
    58         /**
       
    59          * Constructor that takes a resource reader that points to a
       
    60          * PHONEBOOK2_ICON_ID structure.
       
    61          *
       
    62          * @param aReader   Resource reader to a PHONEBOOK2_ICON_ID
       
    63          *                  resource structure.
       
    64          */
       
    65         IMPORT_C TPbk2IconId(
       
    66                     TResourceReader& aReader );
       
    67 
       
    68     public: // Interface
       
    69 
       
    70         /**
       
    71          * Comparison that returns ETrue if the icon ids are the same.
       
    72          *
       
    73          * @param aRhs      An icon id to compare.
       
    74          * @return  ETrue if the icon ids are the same.
       
    75          */
       
    76         IMPORT_C TBool operator==(
       
    77                 const TPbk2IconId& aRhs ) const;
       
    78 
       
    79         /**
       
    80          * Checks if passed uid is owner of this structure
       
    81          *
       
    82          * @param aUid Owner UID to check.
       
    83          * @return ETrue if UID is owner UID, EFalse otherwise.
       
    84          */
       
    85         inline TBool IsOwner( const TUid& aUid ) const
       
    86                 { return aUid == iOwnersUid; }
       
    87 
       
    88     private: // Data
       
    89         /// Own: The UID of icon owner
       
    90         TUid iOwnersUid;
       
    91         /// Own: The id of the icon under the owner
       
    92         TInt iIconId;
       
    93         /// Own: Spare data
       
    94         TInt32 iSpare1;
       
    95         /// Own: Spare data
       
    96         TInt32 iSpare2;
       
    97     };
       
    98 
       
    99 #endif // TPBK2ICONID_H
       
   100 
       
   101 // End of File