phonebookui/Phonebook2/NamesListExtension/inc/CPbk2NameslistUiControlExtension.h
changeset 0 e686773b3f54
child 3 04ab22b956c2
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002-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 Nameslist UI control UI extension.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2NAMESLISTUICONTROLEXTENSION_H
       
    20 #define CPBK2NAMESLISTUICONTROLEXTENSION_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2ContactUiControlExtension.h>
       
    25 #include <MPbk2ContactUiControlExtension2.h>
       
    26 #include "MPbk2EcePresenceEngineObserver.h"
       
    27 #include <pbk2contactuicontroldoublelistboxextension.h>
       
    28 #include <spbcontentprovider.h>
       
    29 #include <TPbk2IconId.h>
       
    30 #include "mpbk2mycardobserver.h"
       
    31 #include "cpbk2mycard.h"
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CPbk2UIExtensionLoader;
       
    35 class CVPbkContactManager;
       
    36 class MVPbkContactLink;
       
    37 class CPbk2EcePresenceEngine;
       
    38 class CPbk2IconArray;
       
    39 
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44  * Phonebook 2 contact UI control UI extension and extension to extension.
       
    45  */
       
    46 NONSHARABLE_CLASS(CPbk2NameslistUiControlExtension) : 
       
    47         public CBase,
       
    48         public MPbk2ContactUiControlExtension,
       
    49         public MPbk2ContactUiControlExtension2,
       
    50         public MPbk2EcePresenceEngineObserver,
       
    51         public MPbk2ContactUiControlDoubleListboxExtension,
       
    52         public MSpbContentProviderObserver,
       
    53         public MPbk2MyCardObserver
       
    54     {
       
    55     public:  // Constructors and destructor
       
    56         
       
    57         /**
       
    58          * Creates a new instance of this class.
       
    59          *
       
    60          * @param aContactManager       Virtual Phonebook contact manager.
       
    61          * @param aStatusProvider		Statusprovider
       
    62          * @param aMyCard
       
    63          * @return  A new instance of this class.
       
    64          */
       
    65         static CPbk2NameslistUiControlExtension* NewL(
       
    66             CVPbkContactManager& aContactManager,
       
    67             CSpbContentProvider& aStatusProvider,
       
    68             CPbk2MyCard* aMyCard );
       
    69         
       
    70         /**
       
    71          * Destructor.
       
    72          */
       
    73         ~CPbk2NameslistUiControlExtension();
       
    74 
       
    75     private:	// new functions
       
    76         /*
       
    77          * Creates icon of the bitmap and adds it ot Pbk2IconArray
       
    78          */
       
    79         void AddThumbnailToIconArrayL( );
       
    80         
       
    81     private: // Construction & destruction
       
    82         CPbk2NameslistUiControlExtension( CVPbkContactManager& aContactManager,
       
    83 										  CSpbContentProvider& aStatusProvider,
       
    84 										  CPbk2MyCard* aMyCard );
       
    85         void ConstructL();
       
    86 
       
    87     public: // From UiExtensionManager's MPbk2ContactUiControlExtension
       
    88         void DoRelease();
       
    89         const TArray<TPbk2IconId> GetDynamicIconsL(
       
    90                 const MVPbkViewContact* aContactHandle );
       
    91         void SetContactUiControlUpdate(
       
    92                 MPbk2ContactUiControlUpdate* aContactUpdator );
       
    93         TAny* ContactUiControlExtensionExtension( TUid aExtensionUid );
       
    94                 
       
    95     public: // From UiExtensionManager's MPbk2ContactUiControlExtension2
       
    96         void SetIconArray(CPbk2IconArray& aIconArray);
       
    97 
       
    98     private: // From MPbk2ContactUiControlDoubleListboxExtension
       
    99         void FormatDataL(
       
   100                 const MVPbkViewContact& aViewContact, 
       
   101                 MPbk2DoubleListboxDataElement& aDataElement );
       
   102         void SetCommandItemUpdater(
       
   103             MPbk2CommandItemUpdater* aCommandUpdater );
       
   104         
       
   105     private:    // From MSpbContentProviderObserver
       
   106         void ContentUpdated(
       
   107             MVPbkContactLink& aLink, 
       
   108             MSpbContentProviderObserver::TSpbContentEvent aEvent );        
       
   109         
       
   110     private: // From MPbk2EcePresenceEngineObserver
       
   111         void ContactPresenceChanged( const MVPbkContactLink& aLink );
       
   112 
       
   113     private: // From MPbk2MyCardObserver
       
   114         void MyCardEvent( TMyCardStatusEvent aEvent );
       
   115         
       
   116     private: // Data
       
   117         /// Ref: Virtual Phonebook contact manager
       
   118         CVPbkContactManager& iContactManager;
       
   119         /// Own: Dummy array
       
   120         RArray<TPbk2IconId> iDummyArray;
       
   121 
       
   122         /// Ref: observer for contact data changes
       
   123         MPbk2ContactUiControlUpdate* iContactUpdator;
       
   124         
       
   125         /// Not own. observer for command item changes
       
   126         MPbk2CommandItemUpdater* iCommandUpdater;
       
   127 
       
   128         CPbk2IconArray* iIconArray; // does not own
       
   129         CPbk2EcePresenceEngine* iPresenceEngine;
       
   130         
       
   131         ///REF: content provider
       
   132         CSpbContentProvider& iContentProvider;
       
   133         // Ref:
       
   134         CPbk2MyCard* iMyCard;
       
   135         // Ref: my card thumbnail bitmap
       
   136         CFbsBitmap* iBitmap;
       
   137         // Current thumbnail icon id
       
   138         TPbk2IconId	iIconId;
       
   139         // Ref: thumbnail on array
       
   140         CGulIcon* 	iThumbIcon;
       
   141     };
       
   142 
       
   143 #endif // CPBK2NAMESLISTUICONTROLEXTENSION_H
       
   144            
       
   145 // End of File