epoc32/include/app/TPbk2IconId.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/TPbk2IconId.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,101 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  Phonebook 2 icon identification.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef TPBK2ICONID_H
    1.23 +#define TPBK2ICONID_H
    1.24 +
    1.25 +// INCLUDE FILES
    1.26 +#include <e32std.h>
    1.27 +
    1.28 +// FORWARD DECLARATIONS
    1.29 +class TResourceReader;
    1.30 +
    1.31 +/**
    1.32 + * Phonebook 2 icon identification. This class is responsible for
    1.33 + * implementing a unique identifier for icons in the Phonebook
    1.34 + * context.
    1.35 + */
    1.36 +class TPbk2IconId
    1.37 +    {
    1.38 +    public: // Construction
    1.39 +        /**
    1.40 +         * Default C++ constructor.
    1.41 +         * Constructs a null icon id.
    1.42 +         */
    1.43 +        IMPORT_C TPbk2IconId();
    1.44 +
    1.45 +        /**
    1.46 +         * Constructor that takes the owner uid and icon id.
    1.47 +         *
    1.48 +         * @param aOwnerUid     The UID that specifies whose icon this is.
    1.49 +         *                      It's used the identify icons from different
    1.50 +         *                      components that are used in the same data
    1.51 +         *                      structure. The UID could be e.g a
    1.52 +         *                      Phonebook 2 UID for application defined
    1.53 +         *                      icons and ECom implementation UID for UI
    1.54 +         *                      extension icons.
    1.55 +         * @param aIconId       The id of the icon under the owner.
    1.56 +         */
    1.57 +        IMPORT_C TPbk2IconId(
    1.58 +                const TUid& aOwnerUid,
    1.59 +                TInt aIconId );
    1.60 +
    1.61 +        /**
    1.62 +         * Constructor that takes a resource reader that points to a
    1.63 +         * PHONEBOOK2_ICON_ID structure.
    1.64 +         *
    1.65 +         * @param aReader   Resource reader to a PHONEBOOK2_ICON_ID
    1.66 +         *                  resource structure.
    1.67 +         */
    1.68 +        IMPORT_C TPbk2IconId(
    1.69 +                    TResourceReader& aReader );
    1.70 +
    1.71 +    public: // Interface
    1.72 +
    1.73 +        /**
    1.74 +         * Comparison that returns ETrue if the icon ids are the same.
    1.75 +         *
    1.76 +         * @param aRhs      An icon id to compare.
    1.77 +         * @return  ETrue if the icon ids are the same.
    1.78 +         */
    1.79 +        IMPORT_C TBool operator==(
    1.80 +                const TPbk2IconId& aRhs ) const;
    1.81 +
    1.82 +        /**
    1.83 +         * Checks if passed uid is owner of this structure
    1.84 +         *
    1.85 +         * @param aUid Owner UID to check.
    1.86 +         * @return ETrue if UID is owner UID, EFalse otherwise.
    1.87 +         */
    1.88 +        inline TBool IsOwner( const TUid& aUid ) const
    1.89 +                { return aUid == iOwnersUid; }
    1.90 +
    1.91 +    private: // Data
    1.92 +        /// Own: The UID of icon owner
    1.93 +        TUid iOwnersUid;
    1.94 +        /// Own: The id of the icon under the owner
    1.95 +        TInt iIconId;
    1.96 +        /// Own: Spare data
    1.97 +        TInt32 iSpare1;
    1.98 +        /// Own: Spare data
    1.99 +        TInt32 iSpare2;
   1.100 +    };
   1.101 +
   1.102 +#endif // TPBK2ICONID_H
   1.103 +
   1.104 +// End of File