williamr@4: /* williamr@4: * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). williamr@4: * All rights reserved. williamr@4: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@4: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: * williamr@4: * Initial Contributors: williamr@4: * Nokia Corporation - initial contribution. williamr@4: * williamr@4: * Contributors: williamr@4: * williamr@4: * Description: Phonebook 2 icon identification. williamr@4: * williamr@4: */ williamr@4: williamr@4: williamr@4: #ifndef TPBK2ICONID_H williamr@4: #define TPBK2ICONID_H williamr@4: williamr@4: // INCLUDE FILES williamr@4: #include williamr@4: williamr@4: // FORWARD DECLARATIONS williamr@4: class TResourceReader; williamr@4: williamr@4: /** williamr@4: * Phonebook 2 icon identification. This class is responsible for williamr@4: * implementing a unique identifier for icons in the Phonebook williamr@4: * context. williamr@4: */ williamr@4: class TPbk2IconId williamr@4: { williamr@4: public: // Construction williamr@4: /** williamr@4: * Default C++ constructor. williamr@4: * Constructs a null icon id. williamr@4: */ williamr@4: IMPORT_C TPbk2IconId(); williamr@4: williamr@4: /** williamr@4: * Constructor that takes the owner uid and icon id. williamr@4: * williamr@4: * @param aOwnerUid The UID that specifies whose icon this is. williamr@4: * It's used the identify icons from different williamr@4: * components that are used in the same data williamr@4: * structure. The UID could be e.g a williamr@4: * Phonebook 2 UID for application defined williamr@4: * icons and ECom implementation UID for UI williamr@4: * extension icons. williamr@4: * @param aIconId The id of the icon under the owner. williamr@4: */ williamr@4: IMPORT_C TPbk2IconId( williamr@4: const TUid& aOwnerUid, williamr@4: TInt aIconId ); williamr@4: williamr@4: /** williamr@4: * Constructor that takes a resource reader that points to a williamr@4: * PHONEBOOK2_ICON_ID structure. williamr@4: * williamr@4: * @param aReader Resource reader to a PHONEBOOK2_ICON_ID williamr@4: * resource structure. williamr@4: */ williamr@4: IMPORT_C TPbk2IconId( williamr@4: TResourceReader& aReader ); williamr@4: williamr@4: public: // Interface williamr@4: williamr@4: /** williamr@4: * Comparison that returns ETrue if the icon ids are the same. williamr@4: * williamr@4: * @param aRhs An icon id to compare. williamr@4: * @return ETrue if the icon ids are the same. williamr@4: */ williamr@4: IMPORT_C TBool operator==( williamr@4: const TPbk2IconId& aRhs ) const; williamr@4: williamr@4: /** williamr@4: * Checks if passed uid is owner of this structure williamr@4: * williamr@4: * @param aUid Owner UID to check. williamr@4: * @return ETrue if UID is owner UID, EFalse otherwise. williamr@4: */ williamr@4: inline TBool IsOwner( const TUid& aUid ) const williamr@4: { return aUid == iOwnersUid; } williamr@4: williamr@4: private: // Data williamr@4: /// Own: The UID of icon owner williamr@4: TUid iOwnersUid; williamr@4: /// Own: The id of the icon under the owner williamr@4: TInt iIconId; williamr@4: /// Own: Spare data williamr@4: TInt32 iSpare1; williamr@4: /// Own: Spare data williamr@4: TInt32 iSpare2; williamr@4: }; williamr@4: williamr@4: #endif // TPBK2ICONID_H williamr@4: williamr@4: // End of File