idlehomescreen/widgetmanager/inc/wmwidgetdata.h
branchRCL_3
changeset 19 79311d856354
parent 18 d05a55b217df
equal deleted inserted replaced
18:d05a55b217df 19:79311d856354
    25 #include <e32base.h>
    25 #include <e32base.h>
    26 #include <f32file.h>
    26 #include <f32file.h>
    27 #include <bamdesca.h>
    27 #include <bamdesca.h>
    28 #include <hscontentinfo.h>
    28 #include <hscontentinfo.h>
    29 
    29 
    30 #include "wmimageconverter.h"
       
    31 
    30 
    32 // FORWARD DECLARATIONS
    31 // FORWARD DECLARATIONS
    33 class CDictionaryFileStore;
    32 class CDictionaryFileStore;
    34 class MWmWidgetDataObserver;
    33 class MWmWidgetDataObserver;
    35 class CFbsBitmap;
    34 class CFbsBitmap;
    36 class CHsContentInfo;
    35 class CHsContentInfo;
    37 class CWmPersistentWidgetOrder;
    36 class CWmPersistentWidgetOrder;
    38 class RWidgetRegistryClientSession;
    37 class RWidgetRegistryClientSession;
    39 class CWmResourceLoader;
    38 class CWmResourceLoader;
       
    39 class CWmImageConverter;
    40 
    40 
    41 // CLASS DECLARATION
    41 // CLASS DECLARATION
    42 /**
    42 /**
    43  * CWmWidgetData is a representation of a widget in CWmListBox. it
    43  * CWmWidgetData is a representation of a widget in CWmListBox. it
    44  * stores all data required for drawing the item in a list box, and
    44  * stores all data required for drawing the item in a list box, and
    45  * handling the list item.
    45  * handling the list item.
    46  */
    46  */
    47 NONSHARABLE_CLASS( CWmWidgetData )
    47 NONSHARABLE_CLASS( CWmWidgetData )
    48     : public CBase
    48     : public CBase
    49     , public MConverterObserver
       
    50     {
    49     {
    51 
    50 
    52 public: // types
    51 public: // types
    53 
    52 
    54     /** widget type */
    53     /** widget type */
   145             const CWmPersistentWidgetOrder* aPersistentWidgetOrder );
   144             const CWmPersistentWidgetOrder* aPersistentWidgetOrder );
   146     
   145     
   147     /**
   146     /**
   148      * Init logo re-creation
   147      * Init logo re-creation
   149      */
   148      */
   150     void ReCreateLogo( const TSize& aSize );
   149     void UpdateLogo( const TSize& aSize, TBool aReCreateLogo );
   151     
   150     
   152     /**
   151     /**
   153      * returns widget description
   152      * returns widget description
   154      */
   153      */
   155     const TDesC& Description() const;
   154     const TDesC& Description() const;
   229     void VisualizeUninstallL();
   228     void VisualizeUninstallL();
   230 	
   229 	
   231     /** stop uninstallation animation */
   230     /** stop uninstallation animation */
   232     void StopUninstallAnimation();
   231     void StopUninstallAnimation();
   233     
   232     
   234 protected: // from MConverterObserver
       
   235 
       
   236     /** image conversin completed */
       
   237     void NotifyCompletion( TInt aError );
       
   238 
       
   239 private: // new functions
   233 private: // new functions
   240     
   234     
   241     /** uninstall animation related*/
   235     /** uninstall animation related*/
   242     void PrepairAnimL();
   236     void PrepairAnimL();
   243     void DestroyAnimData();
   237     void DestroyAnimData();
   252     TUid UidFromString( const TDesC8& aUidString ) const;
   246     TUid UidFromString( const TDesC8& aUidString ) const;
   253     
   247     
   254     /** Logo icon string handling */
   248     /** Logo icon string handling */
   255     void HandleIconString( const TDesC& aIconStr );
   249     void HandleIconString( const TDesC& aIconStr );
   256     void FireDataChanged();
   250     void FireDataChanged();
   257     static TInt TimeoutTick( TAny* aPtr );
       
   258 
   251 
   259 private: // data members
   252 private: // data members
   260     
   253     
   261     /* reference to resource loader */
   254     /* reference to resource loader */
   262     CWmResourceLoader& iWmResourceLoader;
   255     CWmResourceLoader& iWmResourceLoader;
   263     
   256     
       
   257     /* observes this widget representation (NOT OWNED) */
       
   258     MWmWidgetDataObserver* iObserver;
       
   259 
       
   260     /** the widget logo bitmap */
       
   261     CFbsBitmap*         iLogoImage;
       
   262 
       
   263     /** the widget logo mask */
       
   264     CFbsBitmap*         iLogoImageMask;
       
   265 
       
   266     /** The CHsContentInfo that corresponds to this list row */
       
   267     CHsContentInfo*     iHsContentInfo;
       
   268 
       
   269     /** type of the widget */
       
   270     TWidgetType         iWidgetType;
       
   271     
       
   272     /** type of the wrt widget */    
       
   273     TWrtType            iWrtType;
       
   274 
       
   275     /** persistent order of widgets (used in sorting) */
       
   276     const CWmPersistentWidgetOrder* iPersistentWidgetOrder;
       
   277     
       
   278     /** "0\t" + widget name for listbox*/
       
   279     HBufC*              iMdcaPoint;
       
   280     
       
   281     /** wrt widget publisher uid */
       
   282     TUid                iPublisherUid;
       
   283     
       
   284     /** size of logo rect in list item */
       
   285     TSize               iLogoSize;
       
   286     
       
   287     /** validity of the widget - used during list refresh */
       
   288     TBool               iValid;
       
   289 
       
   290     /* Array of uninstall animation bitmaps*/
       
   291     RArray<CFbsBitmap*> iUninstallAnimIcons;
       
   292     
       
   293     /** timer for updating animation */
       
   294     CPeriodic*          iAnimationTimer;
       
   295         
       
   296     /* uninstall animation index */
       
   297     TInt                iAnimationIndex;
       
   298 
       
   299     /** uninstallation switch */
       
   300     TBool               iAsyncUninstalling;
       
   301         
   264     /* the image converter utility */
   302     /* the image converter utility */
   265     CWmImageConverter*    iImageConverter;
   303     CWmImageConverter*    iImageConverter;
   266 
       
   267     /* observes this widget representation (NOT OWNED) */
       
   268     MWmWidgetDataObserver* iObserver;
       
   269 
       
   270     /** the widget logo bitmap */
       
   271     CFbsBitmap*         iLogoImage;
       
   272 
       
   273     /** the widget logo mask */
       
   274     CFbsBitmap*         iLogoImageMask;
       
   275 
       
   276     /** The CHsContentInfo that corresponds to this list row */
       
   277     CHsContentInfo*     iHsContentInfo;
       
   278 
       
   279     /** type of the widget */
       
   280     TWidgetType         iWidgetType;
       
   281     
       
   282     /** type of the wrt widget */    
       
   283     TWrtType            iWrtType;
       
   284 
       
   285     /** persistent order of widgets (used in sorting) */
       
   286     const CWmPersistentWidgetOrder* iPersistentWidgetOrder;
       
   287     
       
   288     /** "0\t" + widget name for listbox*/
       
   289     HBufC*              iMdcaPoint;
       
   290     
       
   291     /** wrt widget publisher uid */
       
   292     TUid                iPublisherUid;
       
   293     
       
   294     /** size of logo rect in list item */
       
   295     TSize               iLogoSize;
       
   296     
       
   297     /** validity of the widget - used during list refresh */
       
   298     TBool               iValid;
       
   299 
       
   300     /* Array of uninstall animation bitmaps*/
       
   301     RArray<CFbsBitmap*> iUninstallAnimIcons;
       
   302     
       
   303     /** timer for updating animation */
       
   304     CPeriodic*          iAnimationTimer;
       
   305     
       
   306     /** timer for canceling image convertion */
       
   307     CPeriodic*          iTimeoutTimer;
       
   308     
       
   309     /* uninstall animation index */
       
   310     TInt                iAnimationIndex;
       
   311 
       
   312     /** uninstallation switch */
       
   313     TBool               iAsyncUninstalling;
       
   314     
       
   315     /** logo changed switch */
       
   316     TBool               iFireLogoChanged;
       
   317 
       
   318     /**
       
   319      * ActiveSchedulerWait used to wait while logo image
       
   320      * is being prepaired.
       
   321      */
       
   322     CActiveSchedulerWait* iWait;
       
   323     
       
   324     /**
       
   325      * Holds widget name. Used for restoring widget name 
       
   326      * if error has occurred during uninstallation.
       
   327      */
       
   328     HBufC* iWidgetName;
       
   329     };
   304     };
   330 
   305 
   331 
   306 
   332 /**
   307 /**
   333  * Pointer array of widget data objects.
   308  * Pointer array of widget data objects.