idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h
branchRCL_3
changeset 23 7be2816dbabd
parent 18 d05a55b217df
equal deleted inserted replaced
19:79311d856354 23:7be2816dbabd
    26 
    26 
    27 // CLASS DECLARATION
    27 // CLASS DECLARATION
    28 class CXnViewManager;
    28 class CXnViewManager;
    29 class CXnViewData;
    29 class CXnViewData;
    30 class CAknsLayeredBackgroundControlContext;
    30 class CAknsLayeredBackgroundControlContext;
    31 class CXnOomSysHandler;
       
    32 
    31 
    33 namespace hspswrapper
    32 namespace hspswrapper
    34     {
    33     {
    35     class CHspsWrapper;
    34     class CHspsWrapper;
    36     }
    35     }
    72      * @since S60 5.0
    71      * @since S60 5.0
    73      * @param aFileName WallpaperImage image path and filename to be cached
    72      * @param aFileName WallpaperImage image path and filename to be cached
    74      * @param aViewData Page that owns the given wallpaper.
    73      * @param aViewData Page that owns the given wallpaper.
    75      * @return Error code.
    74      * @return Error code.
    76      */            
    75      */            
    77     TInt CacheWallpaperL( const TDesC& aFileName, CXnViewData& aViewData );
    76     TInt ConstructWallpaper( const TDesC& aFileName, CXnViewData& aViewData );
       
    77 
       
    78     /**
       
    79      * Shows wallpaper change dialog
       
    80      * 
       
    81      * @since S60 5.0
       
    82      */
       
    83     void SetWallpaperL();
    78 
    84 
    79     /**
    85     /**
    80      * Changes wallpaper image of the current page.
    86      * Changes wallpaper image of the current page.
    81      * 
    87      * 
    82      * @since S60 5.0
    88      * @since S60 5.0
    83      * @param aFileName WallpaperImage image path and filename
    89      * @param aFileName WallpaperImage image path and filename
    84      * @return Error code.
    90      * @return Whether wallpaper is succesfully set or not.
    85      */
    91      */
    86     TInt AddWallpaperL( const TDesC& aFileName );
    92     TBool SetWallpaper( const TDesC& aFileName );
    87 
    93 
    88     /**
    94     /**
    89      * Deletes wallpaper from the given page as well as from the cache.
    95      * Deletes wallpaper from the given page as well as from the cache.
    90      * 
    96      * 
    91      * @since S60 5.0
    97      * @since S60 5.0
    92      * @param aViewData Page where the wallpaper is to be destroyed.
    98      * @param aViewData Page where the wallpaper is to be destroyed.
    93      */            
    99      */            
    94     void DeleteWallpaper( CXnViewData& aViewData );
   100     void DeleteWallpaper( CXnViewData& aViewData );
    95 
   101 
    96     /**
   102     /**
       
   103      * Handles wallpaper changing in page change
       
   104      * 
       
   105      * @since S60 5.0
       
   106      * @param aOldView Old view
       
   107      * @param aNewView New view 
       
   108      * @param aDrawNow ETrue if appearance should be updated
       
   109      */
       
   110     void ChangeWallpaper( const CXnViewData& aOldView, 
       
   111         const CXnViewData& aNewView, TBool aDrawNow );
       
   112 
       
   113     /**
    97      * Returns wallpaper type.
   114      * Returns wallpaper type.
    98      *  
   115      *  
    99      * @since S60 5.0
   116      * @since S60 5.0
   100      */
   117      */
   101     CXnBackgroundManager::WppType WallpaperType();
   118     CXnBackgroundManager::WppType WallpaperType();
   102 
   119             
   103     /**
   120     /** 
   104      * Shows wallpaper change dialog
   121      * Store current wallpaper if needed by using
   105      * 
   122      * AknsWallpaperUtils::SetIdleWallpaper
   106      * @since S60 5.0
   123      */
   107      */
   124     void StoreWallpaperL();
   108     void SetWallpaperL();
       
   109 
       
   110     /**
       
   111      * Handles wallpaper changing in page change
       
   112      * 
       
   113      * @since S60 5.0
       
   114      * @param aOldView         Old view
       
   115      * @param aNewView         New view 
       
   116      */
       
   117     void WallpaperChanged( const CXnViewData& aOldView, 
       
   118         const CXnViewData& aNewView );
       
   119         
       
   120     /**
       
   121      * Draws wallpaper immediately, or once the window comes visible.
       
   122      * 
       
   123      * @since S60 5.0
       
   124      */
       
   125     void UpdateScreen();
       
   126 
   125 
   127 public: // Functions from base classes    
   126 public: // Functions from base classes    
   128 
   127 
   129     /**
   128     /**
   130      * @see CCoeControl
   129      * @see CCoeControl
   175     /**
   174     /**
   176      * By default Symbian 2nd phase constructor is private.
   175      * By default Symbian 2nd phase constructor is private.
   177      */
   176      */
   178     void ConstructL();
   177     void ConstructL();
   179 
   178 
       
   179     /**
       
   180      * Gets dublicate bitmap from AknsSrv cache and stores ot to view data.
       
   181      */
       
   182     void UpdateViewData( const TDesC& aFileName, CXnViewData& aViewData );
       
   183 
       
   184     /**
       
   185      * Stores current wallpaper to HSPS.
       
   186      */
   180     void SaveWallpaperL();
   187     void SaveWallpaperL();
   181     TInt SetSettingPropertyL( const TDesC8& aPluginId, const TDesC8& aItemId,
   188     TInt SetSettingPropertyL( const TDesC8& aPluginId, const TDesC8& aItemId,
   182         const TDesC8& aPropertyName, const TDesC8& aPropertyValue );
   189         const TDesC8& aPropertyName, const TDesC8& aPropertyValue );
       
   190 
       
   191     /**
       
   192      * Goes through all the views and updates wallpapers to the correct size.
       
   193      */
   183     void UpdateWallpapersL();
   194     void UpdateWallpapersL();
   184     void CleanCache();
   195     
   185     void RemoveWallpaperL( CXnViewData& aViewData );
   196     /**
   186     void RemoveWallpaperFromCache( const TDesC& aFileName, CXnViewData* aViewData = NULL );
   197      * Removes wallpaper from AknsSrv cache, 
       
   198      * if it is not used in other pages than the given (or active page).
       
   199      */
       
   200     void RemoveWallpaperFromCache( const TDesC& aFileName, 
       
   201         CXnViewData* aViewData = NULL );
       
   202     
       
   203     /**
       
   204      * Removes wallpapers that were loaded from MMC.
       
   205      */
       
   206     void RemovableDiskRemovedL();
       
   207 
       
   208     /**
       
   209      * Tries to restore wallpapers from MMC.
       
   210      */
   187     void RemovableDiskInsertedL();
   211     void RemovableDiskInsertedL();
       
   212     
       
   213     /**
       
   214      * Reads from cenrep wheteher page specific or common wallpaper is enabled 
       
   215      * and acts accordingly.
       
   216      */
   188     void CheckFeatureTypeL();
   217     void CheckFeatureTypeL();
   189     TInt AddPageSpecificWallpaperL( const TDesC& aFileName );
   218     
   190     TInt AddCommonWallpaperL( const TDesC& aFileName, TBool aSave = ETrue );
   219     /**
       
   220      * Set the given wallpaper to the active page.
       
   221      */
       
   222     void SetPageSpecificWallpaperL( const TDesC& aFileName );
       
   223 
       
   224     /**
       
   225      * Set the given wallpaper. 
       
   226      * aSave states whether to save change to HSPS or not.
       
   227      */
       
   228     void SetCommonWallpaperL( const TDesC& aFileName, TBool aSave = ETrue, 
       
   229         TBool aShowProgressBar = ETrue );
       
   230 
       
   231     /**
       
   232      * Called when wallpaper has been changed outside of Homescreen. 
       
   233      * aSave states whether to save change to HSPS or not.
       
   234      */
   191     void ReadWallpaperFromCenrepL();    
   235     void ReadWallpaperFromCenrepL();    
   192     void DrawEditModeBackgroundSkin() const;
   236 
   193     CXnOomSysHandler& OomSysHandler() const;
   237     /**
       
   238      * Helper functions for drawing
       
   239      */
       
   240     void DrawEditModeBackgroundSkin() const;    
   194     void DrawStatusPaneMask() const;    
   241     void DrawStatusPaneMask() const;    
   195 
   242     void UpdateStatuspaneMaskL();
   196     /**
       
   197      * Callback function to be used with CPeriodic.
       
   198      */
       
   199     static TInt TimerCallback( TAny *aPtr );
       
   200 
   243 
   201 private: // data
   244 private: // data
   202 
   245 
   203     /**
   246     /**
   204      * Provides needed services
   247      * Provides needed services
   247     /** 
   290     /** 
   248      * Internal wallpaper update in progress
   291      * Internal wallpaper update in progress
   249      */
   292      */
   250     TInt iIntUpdate;
   293     TInt iIntUpdate;
   251 
   294 
   252     /** 
   295     /**
   253      * True if screen needs to be drawn when view becomes visible.
   296      * Status pane bitmap. Drawn on top of a wallpaper in 
   254      */
   297      * the status pane area.
   255     TBool iScreenUpdateNeeded;
   298      * Own.
       
   299      */
       
   300     CFbsBitmap* iSpBitmap;
       
   301 
       
   302     /**
       
   303      * Pointer to status pane mask. Drawn on top of a wallpaper in 
       
   304      * the status pane area.
       
   305      * Own.
       
   306      */
       
   307     CFbsBitmap* iSpMask;
       
   308     
       
   309     /** 
       
   310      * Path of the wallpaper image, including filename. 
       
   311      * This is used only if same wallpaper 
       
   312      * is shared among all HS pages.
       
   313      * Own. 
       
   314      */  
       
   315     HBufC* iBgImagePath;    
   256 
   316 
   257     /** 
   317     /** 
   258      * Pointer to wallpaper image. This is used only if same wallpaper 
   318      * Pointer to wallpaper image. This is used only if same wallpaper 
   259      * is shared among all HS pages.
   319      * is shared among all HS pages.
   260      * Own. 
   320      * Own. 
   261      */   
   321      */   
   262     CFbsBitmap* iBgImage;
   322     CFbsBitmap* iBgImage;
   263     
   323 
   264     /**
   324     /*
   265      * Pointer to status pane mask. Drawn on top of a wallpaper in 
   325      * Flag to indicate wheter wallpaper information needs
   266      * the status pane area.
   326      * to be stored to AknsWallpaperUtils
   267      * Own.
   327      */
   268      */
   328     TBool iStoreWallpaper;
   269     CFbsBitmap* iSpMask;
       
   270     
       
   271     /** 
       
   272      * Path of the wallpaper image, including filename. 
       
   273      * This is used only if same wallpaper 
       
   274      * is shared among all HS pages.
       
   275      * Own. 
       
   276      */  
       
   277     HBufC* iBgImagePath;
       
   278 
       
   279     /**
       
   280      * Periodic timer.
       
   281      * Own.
       
   282      */
       
   283     CPeriodic* iTimer;
       
   284     
       
   285     /**
       
   286      * OOM system handler. 
       
   287      * Own.
       
   288      */
       
   289     CXnOomSysHandler* iOomSysHandler;
       
   290     
       
   291     };
   329     };
   292 
   330 
   293 #endif      // CXNBACKGROUNDMANAGER_H
   331 #endif      // CXNBACKGROUNDMANAGER_H
   294 
   332 
   295 // End of File
   333 // End of File