diff -r 000000000000 -r e686773b3f54 phonebookui/Phonebook2/NamesListExtension/inc/CPbk2NameslistUiControlExtension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phonebookui/Phonebook2/NamesListExtension/inc/CPbk2NameslistUiControlExtension.h Tue Feb 02 10:12:17 2010 +0200 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Phonebook 2 Nameslist UI control UI extension. +* +*/ + + +#ifndef CPBK2NAMESLISTUICONTROLEXTENSION_H +#define CPBK2NAMESLISTUICONTROLEXTENSION_H + +// INCLUDES +#include +#include +#include +#include "MPbk2EcePresenceEngineObserver.h" +#include +#include +#include +#include "mpbk2mycardobserver.h" +#include "cpbk2mycard.h" + +// FORWARD DECLARATIONS +class CPbk2UIExtensionLoader; +class CVPbkContactManager; +class MVPbkContactLink; +class CPbk2EcePresenceEngine; +class CPbk2IconArray; + + +// CLASS DECLARATION + +/** + * Phonebook 2 contact UI control UI extension and extension to extension. + */ +NONSHARABLE_CLASS(CPbk2NameslistUiControlExtension) : + public CBase, + public MPbk2ContactUiControlExtension, + public MPbk2ContactUiControlExtension2, + public MPbk2EcePresenceEngineObserver, + public MPbk2ContactUiControlDoubleListboxExtension, + public MSpbContentProviderObserver, + public MPbk2MyCardObserver + { + public: // Constructors and destructor + + /** + * Creates a new instance of this class. + * + * @param aContactManager Virtual Phonebook contact manager. + * @param aStatusProvider Statusprovider + * @param aMyCard + * @return A new instance of this class. + */ + static CPbk2NameslistUiControlExtension* NewL( + CVPbkContactManager& aContactManager, + CSpbContentProvider& aStatusProvider, + CPbk2MyCard* aMyCard ); + + /** + * Destructor. + */ + ~CPbk2NameslistUiControlExtension(); + + private: // new functions + /* + * Creates icon of the bitmap and adds it ot Pbk2IconArray + */ + void AddThumbnailToIconArrayL( ); + + private: // Construction & destruction + CPbk2NameslistUiControlExtension( CVPbkContactManager& aContactManager, + CSpbContentProvider& aStatusProvider, + CPbk2MyCard* aMyCard ); + void ConstructL(); + + public: // From UiExtensionManager's MPbk2ContactUiControlExtension + void DoRelease(); + const TArray GetDynamicIconsL( + const MVPbkViewContact* aContactHandle ); + void SetContactUiControlUpdate( + MPbk2ContactUiControlUpdate* aContactUpdator ); + TAny* ContactUiControlExtensionExtension( TUid aExtensionUid ); + + public: // From UiExtensionManager's MPbk2ContactUiControlExtension2 + void SetIconArray(CPbk2IconArray& aIconArray); + + private: // From MPbk2ContactUiControlDoubleListboxExtension + void FormatDataL( + const MVPbkViewContact& aViewContact, + MPbk2DoubleListboxDataElement& aDataElement ); + void SetCommandItemUpdater( + MPbk2CommandItemUpdater* aCommandUpdater ); + + private: // From MSpbContentProviderObserver + void ContentUpdated( + MVPbkContactLink& aLink, + MSpbContentProviderObserver::TSpbContentEvent aEvent ); + + private: // From MPbk2EcePresenceEngineObserver + void ContactPresenceChanged( const MVPbkContactLink& aLink ); + + private: // From MPbk2MyCardObserver + void MyCardEvent( TMyCardStatusEvent aEvent ); + + private: // Data + /// Ref: Virtual Phonebook contact manager + CVPbkContactManager& iContactManager; + /// Own: Dummy array + RArray iDummyArray; + + /// Ref: observer for contact data changes + MPbk2ContactUiControlUpdate* iContactUpdator; + + /// Not own. observer for command item changes + MPbk2CommandItemUpdater* iCommandUpdater; + + CPbk2IconArray* iIconArray; // does not own + CPbk2EcePresenceEngine* iPresenceEngine; + + ///REF: content provider + CSpbContentProvider& iContentProvider; + // Ref: + CPbk2MyCard* iMyCard; + // Ref: my card thumbnail bitmap + CFbsBitmap* iBitmap; + // Current thumbnail icon id + TPbk2IconId iIconId; + // Ref: thumbnail on array + CGulIcon* iThumbIcon; + }; + +#endif // CPBK2NAMESLISTUICONTROLEXTENSION_H + +// End of File