idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h
branchRCL_3
changeset 23 7be2816dbabd
parent 19 79311d856354
--- a/idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h	Tue Apr 27 16:26:12 2010 +0300
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h	Tue May 11 16:02:39 2010 +0300
@@ -22,6 +22,7 @@
 #define CXNWALLPAPERVIEW_H
 
 // System includes
+#include <e32base.h>
 #include <aknview.h>
 
 // User includes
@@ -30,10 +31,7 @@
 class CXnWallpaperContainer;
 class CXnAppUiAdapter;
 class CXnUiEngine;
-class TVwsViewId;
-class CPeriodic;
 class CXnSpBgCleaner;
-class CAknWaitDialog;
 
 // Constants
 const TUid KWallpaperViewUid = { 0x200286DB };
@@ -42,20 +40,14 @@
 
 /**
 *  Wallpaper view.
-*  Possible to define current Idle background image.
+*  Possible to select background image.
 *
 *  @since S60 v5.0
 */
 NONSHARABLE_CLASS( CXnWallpaperView ) : public CAknView 
     {
-    /** View states */
-    enum TViewState 
-        {
-        EIdle,
-        EImageSelection,
-        EViewDeactivation
-        };
 public:
+    // constructor and destructor
 
     /**
      * Two-phased constructor.
@@ -68,23 +60,30 @@
      */
     ~CXnWallpaperView();
 
+public:
+    // from CAknView
+    
     /**
-     * From CAknView.
-     * Returns view id.
-     * @return An unsigned integer (view id).
-     */
+     * @see CAknView
+     */      
     TUid Id() const;
 
 private:
+    // from CAknView
+    
+    /**
+     * @see CAknView
+     */      
+    void DoActivateL( const TVwsViewId& aPrevViewId,        
+        TUid aCustomMessageId, const TDesC8& aCustomMessage );
+            
+    /**
+     * @see CAknView
+     */      
+    void DoDeactivate();
 
-    /* From CAknView. */
-    void DoActivateL(
-        const TVwsViewId& aPrevViewId,
-        TUid aCustomMessageId,
-        const TDesC8& aCustomMessage );
-    
-    /* From CAknView. */
-    void DoDeactivate();
+private:
+    // private constructors
     
     /**
      * C++ default constructor.
@@ -96,27 +95,39 @@
      */
     void ConstructL();
 
-    /**
-     * Callback function to be used with CPeriodic.
-     */
-    static TInt TimerCallback( TAny *aPtr );
-    void DoHandleCallBackL();
-
+public:
+    // new functions
+    
     /**
-     * Show error dialog
+     * Returns selected wallpaper filename as parameter
      * 
-     * @param aResourceId Resource id to string to be displayed.
+     * @since S60 5.2
+     * @param aFileName Selected wallpaper filename
      */
-    static void ShowErrorDialogL( const TInt aResourceId );
+    void SelectedWallpaper( TFileName& aFileName ) const;
+    
+private:
+    // new functions
     
-private: // data
+    static TInt HandleCallback( TAny* aAny );
+    
+    void DoHandleCallbackL();
+         
+private: 
+    // data
 
     /**
      * Wallpaper container.
      * Own.
      */
     CXnWallpaperContainer* iContainer;
-        
+    
+    /**
+     * Image files
+     * Own.
+     */
+    CDesCArrayFlat* iFiles;
+    
     /**
      * UiEngine
      * Not owned.
@@ -133,22 +144,12 @@
      * Switch for multiple image selection.
      */
     TBool iMultiple;
-    
-    /**
-     * Previous view id
-     */
-    TVwsViewId iPreviousViewUid;
-
+        
     /**
-     * States of wallpaperview
-     */
-    TViewState iViewState;
-    
-    /**
-     * Periodic timer.
+     * Async callback.
      * Own.
      */
-    CPeriodic* iTimer;
+    CAsyncCallBack* iAsyncCb;
     
     /**
      * Resource file offset
@@ -159,13 +160,12 @@
      * Statuspane background cleaner. 
      * Own.
      */
-	CXnSpBgCleaner* iXnSpBgCleaner;
-    
-    /** 
-     * Wait dialog. 
-     * Own.
-     */
-	CAknWaitDialog* iWaitDialog;    
+	CXnSpBgCleaner* iSpBgCleaner;
+	
+	/**
+	 * Selected image filename
+	 */
+	TFileName iFileName;
     };
 
 #endif      // CXNWALLPAPERVIEW_H