ui/viewmanagement/viewmanager/inc/glxviewmanager.h
changeset 72 0a8e959402e5
parent 71 27f2d7aec52a
equal deleted inserted replaced
71:27f2d7aec52a 72:0a8e959402e5
    65 public :
    65 public :
    66     /**
    66     /**
    67      * Constructor
    67      * Constructor
    68      */
    68      */
    69     GlxViewManager();
    69     GlxViewManager();
       
    70     
    70     /**
    71     /**
    71      * Destructor
    72      * Destructor
    72      */
    73      */
    73     ~GlxViewManager();
    74     ~GlxViewManager();
    74 
    75 
       
    76     /**
       
    77      * setupItems() - For initial setup of application after view is ready for drawing
       
    78      */
    75     void setupItems( );
    79     void setupItems( );
    76 
    80 
    77     /**
    81     /**
    78      * launch application
    82      * launchApplication() - Api to launch the photos application
    79      * @param id viewId
    83      * @param id viewId
    80      * @param model model to be used for the view
    84      * @param model model to be used for the view
    81      */
    85      */
    82     void launchApplication( qint32 id, QAbstractItemModel *model );
    86     void launchApplication( qint32 id, QAbstractItemModel *model );
    83 
    87 
    84     /**
    88     /**
    85      * add back key action
    89      * addBackSoftKeyAction() - add back key action
    86      */
    90      */
    87     void addBackSoftKeyAction();
    91     void addBackSoftKeyAction();
    88 
    92 
    89     /**
    93     /**
    90      * This will return the orientation of main window
    94      * orientation() - This will return the current orientation of device
    91      */    
    95      */    
    92     Qt::Orientation orientation() const;
    96     Qt::Orientation orientation() const;
    93 
    97     
    94     /**
    98     /**
    95      * This will deactivate the current function
    99      * This function is used to launch the view
       
   100      * @param view id
       
   101      * @param pointer of data model
       
   102      */
       
   103     void launchView ( qint32 id, QAbstractItemModel *model );
       
   104 
       
   105     /**
       
   106      * It is over load slot and used to run the animation for view transition and launch the view
       
   107      * @param view id
       
   108      * @param pointer of data model
       
   109      * @param 
       
   110      * @param View transtion id
       
   111      * @param to play the animation on which views
       
   112      */    
       
   113     void launchView ( qint32 id, QAbstractItemModel *model, GlxEffect effect, GlxViewEffect viewEffect );
       
   114     
       
   115     /**
       
   116      * launchProgressDialog() - To launch the refreshing media progress dialog
       
   117      * @param - number of item left to populate
       
   118      */
       
   119     void launchProgressDialog( int maxValue );
       
   120     
       
   121     /**
       
   122      * updateProgressDialog() - To update the refreshing media progress dialog value
       
   123      * @param - number of item left to populate
       
   124      */
       
   125     void updateProgressDialog( int currentValue );
       
   126 
       
   127     /**
       
   128      * deactivateCurrentView() - This will deactivate the current function
    96      * to be used only in cases where External launch was done
   129      * to be used only in cases where External launch was done
    97      */     
   130      */     
    98     void deactivateCurrentView();
   131     void deactivateCurrentView();
    99 
   132 
   100     /**
   133     /**
   101      *  To update the tool bar enable and disable icon
   134      *  updateToolBarIcon() -To update the tool bar enable and disable icon
   102      *  id = This should be selected toolbar tab id
   135      *  @parma This should be selected toolbar tab id
   103      */    
   136      */    
   104     void updateToolBarIcon( int id );
   137     void updateToolBarIcon( int id );
   105 
   138 	
   106     /**
   139     /**
   107      * Enable the marking mode of the view to select multiple item
   140      *  updateToolBarActionState() - To update the tool bar action check state
       
   141      *  @param This should be selected toolbar tab id
       
   142      *  @param action check state
       
   143      */        
       
   144     void updateToolBarActionState( int id, bool isChecked );	
       
   145 
       
   146     /**
       
   147      * enterMarkingMode() - Enable the marking mode of the view to select multiple item
       
   148      * @param view id
       
   149      * @parma command id
   108      */    
   150      */    
   109     void enterMarkingMode( qint32 viewId, qint32 commandId );
   151     void enterMarkingMode( qint32 viewId, qint32 commandId );
   110 
   152 
   111     /**
   153     /**
   112      * Enable the normal mode of the view
   154      * exitMarkingMode() - Enable the normal mode of the view
       
   155      * @param view id
   113      */    
   156      */    
   114     void exitMarkingMode( qint32 viewId );
   157     void exitMarkingMode( qint32 viewId );
   115 
   158 
   116     /**
   159     /**
   117      * Pass the user action to the view
   160      * handleUserAction() - Pass the user action to the view to process action
       
   161      * @param view id
       
   162      * @parma user action id ( command id )
   118      */    
   163      */    
   119     void handleUserAction( qint32 viewId, qint32 commandId );
   164     void handleUserAction( qint32 viewId, qint32 commandId );
   120 
   165 
   121     /**
   166     /**
   122      *  Return the selection model to the user
   167      *  getSelectionModel() Return the selection model to the user
       
   168      *  @param - view id of the current view
       
   169      *  @return - selection model of the view 
   123      */    
   170      */    
   124     QItemSelectionModel * getSelectionModel( qint32 viewId );
   171     QItemSelectionModel * getSelectionModel( qint32 viewId );
   125 
   172 
   126     /**
   173     /**
   127      * To set the model of current view
   174      * setModel() - To set the model of current view
       
   175      * @param model pointer
   128      */
   176      */
   129     void setModel( QAbstractItemModel *model );
   177     void setModel( QAbstractItemModel *model );
       
   178     
       
   179     /**
       
   180      * cancelViewTransitionEffect() - To cancel the current runing view transition
       
   181      */
       
   182     void cancelViewTransitionEffect();
   130 	    
   183 	    
   131 signals :
   184 signals :
   132     /**
   185     /**
   133      *  emit the user action
   186      * actionTriggered() - emit the signal of user action for state manager
       
   187      * @param action or command id
   134      */
   188      */
   135     void actionTriggered( qint32 id );
   189     void actionTriggered( qint32 id );
   136     void externalCommand( int cmdId );
       
   137 
   190 
   138 public slots:
   191 public slots:
   139     /**
   192     
   140      *  This public slot is used to launch the view
   193     /**
   141      */
   194      * destroyView() - It will removed and deleted the view form the view list.
   142     void launchView ( qint32 id, QAbstractItemModel *model );
   195      * Currently It is not used so may be in future, It will be removed.
   143 
   196      * @param - view id of view which is suppose to destroy
   144     /**
       
   145      *  It is over load slot and used to run the animation for view transition and launch the view
       
   146      */    
       
   147     void launchView ( qint32 id, QAbstractItemModel *model, GlxEffect effect, GlxViewEffect viewEffect );
       
   148     
       
   149     void launchProgressDialog( int maxValue );
       
   150     void updateProgressDialog( int currentValue );
       
   151 
       
   152     /**
       
   153      *  It will removed and deleted the view.
       
   154      *  Currently It is not used so may be in future, It will be removed.
       
   155      */    
   197      */    
   156     void destroyView ( qint32 id );
   198     void destroyView ( qint32 id );
   157 
   199 
   158     /**
   200     /**
   159      *  It will pass the user action to the state manager
   201      * actionProcess() - It will pass the user action to the state manager
       
   202      * @param action id to process
   160      */    
   203      */    
   161     void actionProcess( qint32 id );
   204     void actionProcess( qint32 id );
   162 
   205 
   163     /**
   206     /**
   164      *  It will pass the user selected menu action to state manager 
   207      *  handleAction() - It will pass the user action ( tool bar + back ) to state manager
   165      *  check for depricated with actionProcess api
       
   166      */    
       
   167     void handleMenuAction( qint32 commandId );
       
   168 
       
   169     /**
       
   170      *  It will pass the user action ( tool bar + back ) to state manager
       
   171      */    
   208      */    
   172     void handleAction();
   209     void handleAction();
   173     void cancelTimer();
   210 
   174 
   211     /**
   175     /**
   212      *  effectFinished() -This is slot used for the transition animation finished call back
   176      *  This is slot used for the animation finished call back
       
   177      */    
   213      */    
   178     void effectFinished( );
   214     void effectFinished( );
   179 
   215 
   180     /**
   216     /**
   181      *  This will open the item specifc Menu
   217      *  itemSpecificMenuTriggered() - This will open the item specifc Menu
       
   218      *  @parma - view id 
       
   219      *  @param - postion of the context menu
   182      */    
   220      */    
   183     void itemSpecificMenuTriggered( qint32, QPointF );
   221     void itemSpecificMenuTriggered( qint32, QPointF );
   184     
   222     
   185     void handleReadyView();
   223     void handleReadyView();
   186 	
   224 	
   187 private slots:
   225 private slots:
   188 
   226    /**
       
   227     * checkMarked() -  cheche the some item is marked or no item is marked
       
   228     */
   189    void checkMarked();
   229    void checkMarked();
       
   230    
       
   231    /**
       
   232     * hideProgressDialog() - put the application into background
       
   233     */
   190    void hideProgressDialog();
   234    void hideProgressDialog();
   191    
   235    
   192 private:
   236 private:
   193     /**
   237     /**
   194      * It will create and return the view
   238      * resolveView() - It will create and return the view
       
   239      * @parma - view id
       
   240      * @return the object of desired view or create the view if it is not created and return
   195      */
   241      */
   196     GlxView * resolveView ( qint32 id );
   242     GlxView * resolveView ( qint32 id );
   197 
   243 
   198     /**
   244     /**
   199      *  It will find a view from the view list and return it
   245      * findView() - It will find a view from the view list and return it
       
   246      * @parma - view id
       
   247      * @return the object of desired view or null
   200      */    
   248      */    
   201     GlxView * findView ( qint32 id );
   249     GlxView * findView ( qint32 id );
   202 
   250 
   203     /**
   251     /**
   204      *  It will deativate the current view
   252      * deActivateView() - It will deativate the current view
   205      */    
   253      */    
   206     void deActivateView();
   254     void deActivateView();
   207 
   255 
   208     /**
   256     /**
   209      *  It will activate and show the view
   257      *  It will activate and show the view
   210      */
   258      */
   211     void activateView();
   259     void activateView();
   212 
   260 
   213     /**
   261     /**
   214      *  It will create the grid and list view tool bar action
   262      * activateView() - It will create the grid and list view tool bar action
   215      */    
   263      */    
   216     void createActions();
   264     void createActions();
   217 
   265 
   218     /**
   266     /**
   219      *  It will create the marking mode toll bar action
   267      * createMarkingModeActions() - It will create the marking mode toll bar action
   220      */    
   268      */    
   221     void createMarkingModeActions(); 
   269     void createMarkingModeActions(); 
   222 
   270 
   223     /**
   271     /**
   224      *  It will create the grid and list view tool bar
   272      * createToolBar() - It will create the grid and list view tool bar
   225      */    
   273      */    
   226     void createToolBar();
   274     void createToolBar();
   227 
   275 
   228     /**
   276     /**
   229      *  It will create the marking mode tool bar
   277      * createMarkingModeToolBar() - It will create the marking mode tool bar
   230      */    
   278      */    
   231     void createMarkingModeToolBar();
   279     void createMarkingModeToolBar();
   232     
   280     
   233     /**
   281     /**
   234      * setMarkingToolBarAction() - set the toolbar action text
   282      * setMarkingToolBarAction() - set the toolbar action text
       
   283      * @parma command id
   235      */
   284      */
   236     void setMarkingToolBarAction( qint32 commandId );
   285     void setMarkingToolBarAction( qint32 commandId );
   237 
   286 
   238     /**
   287     /**
   239      *  It will add all the view manager related connection
   288      * addConnection() -  It will add all the view manager related connection
   240      */    
   289      */    
   241     void addConnection();
   290     void addConnection();
   242 
   291 
   243     /**
   292     /**
   244      *  It will remove all the view manager releted connection
   293      * removeConnection() - It will remove all the view manager releted connection
   245      */    
   294      */    
   246     void removeConnection();
   295     void removeConnection();
   247     
   296     
   248     /**
   297     /**
   249      * 
   298      * getSubState() - return the substate of state
   250      */    
   299      */    
   251     int getSubState();
   300     int getSubState();
   252 
   301 
   253 private:
   302 private:
   254     QList<GlxView *> mViewList;  //It contains all the view created by it self.
   303     QList<GlxView *>            mViewList;  //It contains all the view created by it self.
   255     HbMainWindow     *mMainWindow; //main window pointer, It have ownership only if 
   304     HbMainWindow                *mMainWindow; //main window pointer, It have ownership only if 
   256     HbAction         *mBackAction; // For back soft key
   305     HbAction                    *mBackAction; // For back soft key
   257     GlxMenuManager   *mMenuManager; //Pointer of menu manger to add the menu in the view 
   306     GlxMenuManager              *mMenuManager; //Pointer of menu manger to add the menu in the view 
   258     GlxEffectEngine  *mEffectEngine; //To run the animation in between view transition
   307     GlxEffectEngine             *mEffectEngine; //To run the animation in between view transition
   259     QList<HbAction *>  mActionList; //Tool bar action list
   308     QList<HbAction *>           mActionList; //Tool bar action list
   260     QList<HbAction *>  mMarkingActionList; //marking mode tool bar action list
   309     QList<HbAction *>           mMarkingActionList; //marking mode tool bar action list
   261     HbToolBar          *mViewToolBar; //view tool bar
   310     HbToolBar                   *mViewToolBar; //view tool bar
   262     HbToolBar          *mMarkingToolBar; //marking mode tool bar
   311     HbToolBar                   *mMarkingToolBar; //marking mode tool bar
   263     GlxView *mView;
   312     GlxView                     *mView;
   264     QAbstractItemModel *mModel; //no ownership
   313     QAbstractItemModel          *mModel; //no ownership
   265     QItemSelectionModel * mSelectionModel;
   314     QItemSelectionModel         *mSelectionModel;
   266     HbProgressDialog *mProgressDialog;
   315     HbProgressDialog            *mProgressDialog;
   267     GlxMainWindowEventFilter* mWindowEventFilter;
   316     GlxMainWindowEventFilter    *mWindowEventFilter;
   268 
   317     bool                        mIsViewTransitionRunning;
       
   318     GlxEffect                   mEffect;
       
   319     QList< QGraphicsItem * >    mItemList;
   269 };
   320 };
   270 
   321 
   271 
   322 
   272 #endif /* GLXVIEWMANAGER_H_ */
   323 #endif /* GLXVIEWMANAGER_H_ */