ui/viewmanagement/viewmanager/inc/glxviewmanager.h
changeset 54 0f0f3f26f787
parent 45 863223ea6961
child 58 383b67fbdb11
equal deleted inserted replaced
52:a3a4c0de738e 54:0f0f3f26f787
    22 
    22 
    23 #include <QObject>
    23 #include <QObject>
    24 #include <QList>
    24 #include <QList>
    25 #include <hbeffect.h>
    25 #include <hbeffect.h>
    26 #include "glxuistd.h"
    26 #include "glxuistd.h"
       
    27 #include <QModelIndex>
    27 
    28 
    28 class GlxView;
    29 class GlxView;
    29 class HbMainWindow;
    30 class HbMainWindow;
    30 class QAbstractItemModel;
    31 class QAbstractItemModel;
    31 class HbAction;
    32 class HbAction;
    52     GLX_CAMERA_ACTION_ID   = 0x04,
    53     GLX_CAMERA_ACTION_ID   = 0x04,
    53     GLX_OVI_ACTION_ID      = 0x08,
    54     GLX_OVI_ACTION_ID      = 0x08,
    54     GLX_ALL_ID             = 0xFF
    55     GLX_ALL_ID             = 0xFF
    55 } glxToolBarActionIds;
    56 } glxToolBarActionIds;
    56 
    57 
       
    58 /**
       
    59  * view manager class
       
    60  */
    57 class GLX_VIEWMANAGER_EXPORT GlxViewManager : public QObject
    61 class GLX_VIEWMANAGER_EXPORT GlxViewManager : public QObject
    58 {
    62 {
    59 Q_OBJECT
    63 Q_OBJECT
    60 
    64 
    61 public :
    65 public :
       
    66     /**
       
    67      * Constructor
       
    68      */
    62     GlxViewManager();
    69     GlxViewManager();
       
    70     /**
       
    71      * Destructor
       
    72      */
    63     ~GlxViewManager();
    73     ~GlxViewManager();
       
    74 
    64     void setupItems( );
    75     void setupItems( );
       
    76 
       
    77     /**
       
    78      * launch application
       
    79      * @param id viewId
       
    80      * @param model model to be used for the view
       
    81      */
    65     void launchApplication(qint32 id, QAbstractItemModel *model);
    82     void launchApplication(qint32 id, QAbstractItemModel *model);
       
    83 
       
    84     /**
       
    85      * add back key action
       
    86      */
    66     void addBackSoftKeyAction();
    87     void addBackSoftKeyAction();
    67 /*
    88 
    68  * This will return the orientation of main window
    89     /**
    69  */    
    90      * This will return the orientation of main window
       
    91      */    
    70     Qt::Orientation orientation() const;
    92     Qt::Orientation orientation() const;
    71 /*
    93 
    72  * This will deactivate the current function
    94     /**
    73  * to be used only in cases where External launch was done
    95      * This will deactivate the current function
    74  */     
    96      * to be used only in cases where External launch was done
       
    97      */     
    75     void deactivateCurrentView();
    98     void deactivateCurrentView();
    76 /*
    99 
    77  *  To update the tool bar enable and disable icon
   100     /**
    78  *  id = This should be selected toolbar tab id
   101      *  To update the tool bar enable and disable icon
    79  */    
   102      *  id = This should be selected toolbar tab id
       
   103      */    
    80     void updateToolBarIcon(int id);
   104     void updateToolBarIcon(int id);
    81 /*
   105 
    82  * Enable the marking mode of the view to select multiple item
   106     /**
    83  */    
   107      * Enable the marking mode of the view to select multiple item
       
   108      */    
    84     void enterMarkingMode(qint32 viewId);
   109     void enterMarkingMode(qint32 viewId);
    85 /*
   110 
    86  * Enable the normal mode of the view
   111     /**
    87  */    
   112      * Enable the normal mode of the view
       
   113      */    
    88     void exitMarkingMode(qint32 viewId);
   114     void exitMarkingMode(qint32 viewId);
    89 /*
   115 
    90  * Pass the user action to the view
   116     /**
    91  */    
   117      * Pass the user action to the view
       
   118      */    
    92     void handleUserAction(qint32 viewId, qint32 commandId);
   119     void handleUserAction(qint32 viewId, qint32 commandId);
    93 /*
   120 
    94  *  Return the selection model to the user
   121     /**
    95  */    
   122      *  Return the selection model to the user
       
   123      */    
    96     QItemSelectionModel * getSelectionModel(qint32 viewId);
   124     QItemSelectionModel * getSelectionModel(qint32 viewId);
    97 /*
   125 
    98  * To set the model of current view
   126     /**
    99  */
   127      * To set the model of current view
       
   128      */
   100     void setModel( QAbstractItemModel *model );
   129     void setModel( QAbstractItemModel *model );
   101 	    
   130 	    
   102 signals :
   131 signals :
   103 /*
   132     /**
   104  *  emit the user action
   133      *  emit the user action
   105  */
   134      */
   106     void actionTriggered(qint32 id);
   135     void actionTriggered(qint32 id);
   107     void externalCommand(int cmdId);
   136     void externalCommand(int cmdId);
   108     void applicationReady();
   137     void applicationReady();
   109 
   138 
   110 public slots:
   139 public slots:
   111 /*
   140     /**
   112  *  This public slot is used to launch the view
   141      *  This public slot is used to launch the view
   113  */
   142      */
   114     void launchView (qint32 id, QAbstractItemModel *model);
   143     void launchView (qint32 id, QAbstractItemModel *model);
   115 /*
   144 
   116  *  It is over load slot and used to run the animation for view transition and launch the view
   145     /**
   117  */    
   146      *  It is over load slot and used to run the animation for view transition and launch the view
       
   147      */    
   118     void launchView (qint32 id, QAbstractItemModel *model, GlxEffect effect, GlxViewEffect viewEffect);
   148     void launchView (qint32 id, QAbstractItemModel *model, GlxEffect effect, GlxViewEffect viewEffect);
   119     
   149     
   120     void launchProgressDialog( int maxValue );
   150     void launchProgressDialog( int maxValue );
   121     void updateProgressDialog( int currentValue);
   151     void updateProgressDialog( int currentValue);
   122 /*
   152 
   123  *  It will removed and deleted the view.
   153     /**
   124  *  Currently It is not used so may be in future, It will be removed.
   154      *  It will removed and deleted the view.
   125  */    
   155      *  Currently It is not used so may be in future, It will be removed.
       
   156      */    
   126     void destroyView (qint32 id);
   157     void destroyView (qint32 id);
   127 /*
   158 
   128  *  It will pass the user action to the state manager
   159     /**
   129  */    
   160      *  It will pass the user action to the state manager
       
   161      */    
   130     void actionProcess(qint32 id);
   162     void actionProcess(qint32 id);
   131 /*
   163 
   132  *  It will pass the user selected menu action to state manager 
   164     /**
   133  *  check for depricated with actionProcess api
   165      *  It will pass the user selected menu action to state manager 
   134  */    
   166      *  check for depricated with actionProcess api
       
   167      */    
   135     void handleMenuAction(qint32 commandId);
   168     void handleMenuAction(qint32 commandId);
   136 /*
   169 
   137  *  It will pass the user action ( tool bar + back ) to state manager
   170     /**
   138  */    
   171      *  It will pass the user action ( tool bar + back ) to state manager
       
   172      */    
   139     void handleAction();
   173     void handleAction();
   140     void cancelTimer();
   174     void cancelTimer();
   141 /*
   175 
   142  *  This is slot used for the animation finished call back
   176     /**
   143  */    
   177      *  This is slot used for the animation finished call back
       
   178      */    
   144     void effectFinished( );
   179     void effectFinished( );
   145 /*
   180 
   146  *  This will open the item specifc Menu
   181     /**
   147  */    
   182      *  This will open the item specifc Menu
       
   183      */    
   148     void itemSpecificMenuTriggered(qint32,QPointF );
   184     void itemSpecificMenuTriggered(qint32,QPointF );
   149     
   185     
   150     void handleReadyView();
   186     void handleReadyView();
   151 protected:
   187 protected:
   152 	
   188 	
   154 
   190 
   155    void checkMarked();
   191    void checkMarked();
   156    void hideProgressDialog();
   192    void hideProgressDialog();
   157    
   193    
   158 private:
   194 private:
   159 /*
   195     /**
   160  * It will create and return the view
   196      * It will create and return the view
   161  */
   197      */
   162     GlxView * resolveView (qint32 id);
   198     GlxView * resolveView (qint32 id);
   163 /*
   199 
   164  *  It will find a view from the view list and return it
   200     /**
   165  */    
   201      *  It will find a view from the view list and return it
       
   202      */    
   166     GlxView * findView (qint32 id);
   203     GlxView * findView (qint32 id);
   167 /*
   204 
   168  *  It will deativate the current view
   205     /**
   169  */    
   206      *  It will deativate the current view
       
   207      */    
   170     void deActivateView();
   208     void deActivateView();
   171 /*
   209 
   172  *  It will activate and show the view
   210     /**
   173  */
   211      *  It will activate and show the view
       
   212      */
   174     void activateView();
   213     void activateView();
   175 /*
   214 
   176  *  It will create the grid and list view tool bar action
   215     /**
   177  */    
   216      *  It will create the grid and list view tool bar action
       
   217      */    
   178     void createActions();
   218     void createActions();
   179 /*
   219 
   180  *  It will create the marking mode toll bar action
   220     /**
   181  */    
   221      *  It will create the marking mode toll bar action
       
   222      */    
   182     void createMarkingModeActions(); 
   223     void createMarkingModeActions(); 
   183 /*
   224 
   184  *  It will create the grid and list view tool bar
   225     /**
   185  */    
   226      *  It will create the grid and list view tool bar
       
   227      */    
   186     void createToolBar();
   228     void createToolBar();
   187 /*
   229 
   188  *  It will create the marking mode tool bar
   230     /**
   189  */    
   231      *  It will create the marking mode tool bar
       
   232      */    
   190     void createMarkingModeToolBar();
   233     void createMarkingModeToolBar();
   191 /*
   234 
   192  *  It will add all the view manager related connection
   235     /**
   193  */    
   236      *  It will add all the view manager related connection
       
   237      */    
   194     void addConnection();
   238     void addConnection();
   195 /*
   239 
   196  *  It will remove all the view manager releted connection
   240     /**
   197  */    
   241      *  It will remove all the view manager releted connection
       
   242      */    
   198     void removeConnection();
   243     void removeConnection();
       
   244     
       
   245     /**
       
   246      * 
       
   247      */    
       
   248     int getSubState();
   199 
   249 
   200 private:
   250 private:
   201     QList<GlxView *> mViewList;  //It contains all the view created by it self.
   251     QList<GlxView *> mViewList;  //It contains all the view created by it self.
   202     HbMainWindow     *mMainWindow; //main window pointer, It have ownership only if 
   252     HbMainWindow     *mMainWindow; //main window pointer, It have ownership only if 
   203     HbAction         *mBackAction; // For back soft key
   253     HbAction         *mBackAction; // For back soft key