ui/viewmanagement/statehandler/inc/glxstatemanager.h
changeset 54 0f0f3f26f787
parent 45 863223ea6961
child 65 ccee5c4b0de4
--- a/ui/viewmanagement/statehandler/inc/glxstatemanager.h	Fri Jul 23 20:41:04 2010 +0530
+++ b/ui/viewmanagement/statehandler/inc/glxstatemanager.h	Fri Aug 06 20:44:25 2010 +0530
@@ -25,6 +25,7 @@
 #include <QList>
 #include <glxbasestate.h>
 #include <qmap.h>
+#include <QModelIndex>
 
 class GlxState;
 class GlxViewManager;
@@ -40,178 +41,236 @@
 #define GLX_STATEMANAGER_EXPORT Q_DECL_IMPORT
 #endif
 
+/**
+ * Class Description
+ * class to create and manage different states and view navigation 
+ */
+
 class GLX_STATEMANAGER_EXPORT GlxStateManager : public QObject
 {
     Q_OBJECT
 	friend class TestGlxStateManager;
 	
 public :
-    /*
+    /**
      * Constructor
      */
     GlxStateManager();
     
-    /*
+    /**
      * Destructor
      */
     virtual ~GlxStateManager();
-    
-    /*
-     * Fuction to launch the application from some external world
+
+    /**
+     * launchFetcher() - launch image fetcher
+     */
+	void launchFetcher();    
+
+	/**
+     * launchFromExternal() - Fuction to launch the application from some external world
      */
     void launchFromExternal();
     
-    /*
-     * Clean the all externel data
+    /**
+     * cleanupExternal() - Clean the all externel data
      */
     void cleanupExternal();
     
-    /*
-     *  Move the views to the multiple item selection state
+    /**
+     *  enterMarkingMode() - Move the views to the multiple item selection state
      */
     void enterMarkingMode();
     
-    /*
-     * Exit from the multiselection state
+    /**
+     * exitMarkingMode() - Exit from the multiselection state
      */
     void exitMarkingMode();
     
-    /*
-     * Execute the commant on multiple selected item
+    /**
+     * executeCommand() - Execute the commant on multiple selected item.
+     * @param - command Id to execute.
      */
-    bool executeCommand(qint32 commandId);
+    bool executeCommand( qint32 commandId );
     
-    /*
-     *  when application goes into background or come back to foreground
+    /**
+     *  eventFilter() - when application goes into background or come back to foreground
      *  set and reset the background thumbnail generation property
+     *  @param QObject
+     *  @param QEvent
      */
-    bool eventFilter(QObject *obj, QEvent *ev);    
+    bool eventFilter( QObject *obj, QEvent *ev );    
 
 signals :
-    /*
-     * Send the user activities ( command ) to the external world
+    /**
+     * externalCommand() - Send the user activities ( command ) to the external world
+     * @param - command Id to execute.
      */
-    void externalCommand(int cmdId);
+    void externalCommand( int cmdId );
     
-    /*
-     * TO send the signal to initialise the rest of items
+    /**
+     * setupItemsSignal() - TO send the signal to initialise the non critical resoruce
      * which is not created in the launch sequence
      */
     void setupItemsSignal();
+
+    /**
+     * gridItemSelected() - signal to send current model and selected index for fetcher service
+     * @param - selected item model index
+     * @param - model
+     */
+    void gridItemSelected( const QModelIndex &,QAbstractItemModel & );   
     
 public slots:
-    /*
-     * To launch the application
+    /**
+     * launchApplication() - To launch the application
      */
     void launchApplication();
     
-    /*
-     * To handle the user action, view switching etc
+    /**
+     * actionTriggered() - To handle the user action, view switching etc
+     * @param - user action ID.
      */
-    void actionTriggered(qint32 id);
+    void actionTriggered( qint32 id );
     
-    /*
-     * To create the items which is not created in the aluch sequence
+    /**
+     * setupItems() -To create the items which is not created in the aluch sequence
      */
     void setupItems();
     
-    /*
-     * call back function to monitor the change in thumbnail manager
+    /**
+     * updateTNProgress() - call back function to monitor the change in thumbnail manager
+     * @param - number of item left to generate the thumbnail
      */
-    void updateTNProgress( int count);
+    void updateTNProgress( int count );
+    
+    /**
+     * thumbnailPopulated() - call back to get the information that some initial page are loaded 
+     * into cache.
+     * It will vanish the progressbar dialog.
+     */
+    void thumbnailPopulated();
+    
+    /**
+     * saveData() - To save the activity data
+     */
     void saveData();
 
 public :
-    /*
-     * It will create a new state and replace the current state with new state in the stack.
+    /**
+     * changeState() - It will create a new state and replace the current state with new state in the stack.
      * It will use in the case of state switching.
      * use -1 if state does not have internal state
+     * @param - new state id.
+     * @param - internal or substate of new state.
      */    
-    void changeState(qint32 newStateId, int internalState );
+    void changeState( qint32 newStateId, int internalState );
     
-    /*
-     * Go back to previous state 
+    /**
+     * previousState() - Go back to previous state and if there is no state in the stack
+     * then exit the application. 
      */    
     void previousState();
 
-    /*
-     * Go back to a state in hierarchy and pop all the state upto that level.
+    /**
+     * goBack() - Go back to a state in hierarchy and pop all the state upto that level.
      * if state is not found, then all the state from the hierachy is removed and create a new state on level 0
      * This function will be use in the case when more then one back is required in single event.
+     * @param - new state id.
+     * @param - internal or substate of new state.
      */
-    void goBack(qint32 stateId, int internalState);
+    void goBack( qint32 stateId, int internalState );
        
-    /*
-     * Create a new state and current state should be pushed into stack.
+    /**
+     * nextState() - Create a new state and current state should be pushed into stack.
      * use -1 if state does not have internal state
+     * @param - new state id.
+     * @param - internal or substate of new state.
      */  
-    void nextState(qint32 newStateId, int internalState );
+    void nextState( qint32 newStateId, int internalState );
 
-    /*
-     * It will delete the current model
+    /**
+     * removeCurrentModel() - It will delete the current model
      */      
     void removeCurrentModel();
     
-    /*
-     * It will delete the all model used by state manager
+    /**
+     * cleanAllModel() - It will delete the all model used by state manager
      */
     void cleanAllModel();
     
-
 private:
 
-    /*
-     *  Launch the harvesting and TN generation progress bar dialog
+    /**
+     *  launchProgressDialog() - Launch the harvesting and TN generation progress bar dialog
      */
     void launchProgressDialog();
     
-    /*
-     * remove the harvesting and TN generation progress bar dialog
+    /**
+     * vanishProgressDialog() - create the grid view model and wait for loading of some initial page of data into 
+     * cache.
      */
     void vanishProgressDialog();
     
-    /*
-     * Factory function to create the state.
+    /**
+     * createState() - Factory function to create the state.
      */  
-    GlxState * createState(qint32 state);
+    GlxState * createState( qint32 state );
     
-    /*
-     * Factory function to create the model.
+    /**
+     * createModel() - Factory function to create the model.
+     * @param - state id of the state.
+     * @param -  state navigation direction
      */  	
-    void createModel(qint32 stateId, NavigationDir dir = NO_DIR);
+    void createModel( qint32 stateId, NavigationDir dir = NO_DIR );
 
-    /*
-     * Factory function to create the grid model.
+    /**
+     * createGridModel() - Factory function to create the grid model.
+     * @param -  internal state of grid state.
+     * @param - state navigation direction.
      */  	
-    void createGridModel(int internalState, NavigationDir dir = NO_DIR);
+    void createGridModel( int internalState, NavigationDir dir = NO_DIR );
 
-    /*
-     * To set the fullscreen context based on the currrent orientation
+    /**
+     * setFullScreenContext() - To set the fullscreen context based on the currrent orientation
      */    
     void setFullScreenContext();
     
-    /*
-     * Apllication event handler function
+    /**
+     * setFullScreenContext() - Apllication event handler function
+     * @param - event id
      */
-    void eventHandler(qint32 &id);
+    void eventHandler( qint32 &id );
     
-    /*
-     * A function to care the exit for application, in the case when application launch from internal and external
+    /**
+     * exitApplication() - A function to care the exit for application, in the case when application launch from internal and external
      */        
     void exitApplication();
 
-    /*Launch Application as an acitivyt.
+    /**
+     * launchActivity() -Launch Application as an activity.
      * Return Value @0 : If launching an activity fails
      *              @1 : If launch activity passes
      */
      bool launchActivity();
+
+     /**
+      * saveImage() - save current image if it is launched from private path.
+      */
+     void saveImage();
+     
 private:
     GlxViewManager      *mViewManager;
-    GlxMediaModel       *mAllMediaModel;        // for all grid
-    GlxMediaModel       *mAlbumGridMediaModel;  // for album grid 
-    GlxAlbumModel       *mAlbumMediaModel;      // for album list
-	GlxMediaModel       *mImageviewerMediaModel;// for image viewer 
-    QAbstractItemModel  *mCurrentModel;         // no owner ship
+    /// for all grid
+    GlxMediaModel       *mAllMediaModel;        
+    /// for album grid
+    GlxMediaModel       *mAlbumGridMediaModel;  
+    /// for album list
+    GlxAlbumModel       *mAlbumMediaModel;      
+    /// for image viewer
+	GlxMediaModel       *mImageviewerMediaModel;
+	/// no owner ship
+    QAbstractItemModel  *mCurrentModel;         
     GlxState            *mCurrentState;		
     GlxActionHandler    *mActionHandler;
     GlxTNObserver       *mTNObserver;