homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hsallcollectionsstate.h
changeset 46 23b5d6a29cce
parent 39 4e8ebe173323
child 51 4785f57bf3d4
equal deleted inserted replaced
39:4e8ebe173323 46:23b5d6a29cce
    19 #define HSALLCOLLECTIONSSTATE_H
    19 #define HSALLCOLLECTIONSSTATE_H
    20 
    20 
    21 #include <qstate.h>
    21 #include <qstate.h>
    22 #include <QModelIndex>
    22 #include <QModelIndex>
    23 #include <QPointF>
    23 #include <QPointF>
       
    24 #include <QPointer>
    24 
    25 
    25 #include "hsmenustates_global.h"
    26 #include "hsmenustates_global.h"
       
    27 #include "hsmenumodewrapper.h"
    26 #include "hsmenuservice.h"
    28 #include "hsmenuservice.h"
       
    29 #include "hsmenuview.h"
    27 
    30 
    28 HS_STATES_TEST_CLASS(MenuStatesTest)
    31 HS_STATES_TEST_CLASS(MenuStatesTest)
    29 
    32 
    30 class HbMenu;
    33 class HbMenu;
    31 class HsMenuView;
    34 class HsMenuViewBuilder;
    32 class HbAbstractViewItem;
    35 class HbAbstractViewItem;
    33 class HbAction;
    36 class HbAction;
    34 class HbMainWindow;
    37 class HbMainWindow;
    35 class HsMenuItemModel;
    38 class HsMenuItemModel;
    36 class HsMenuView;
    39 class HsMenuView;
    37 
    40 
    38 /**
       
    39  * @ingroup group_hsmenustateplugin
       
    40  * @brief All Collections State.
       
    41  *
       
    42  * Displays all collections present on the device.
       
    43  *
       
    44  * @see StateMachine
       
    45  *
       
    46  * @lib ?library
       
    47  * @since S60 ?S60_version
       
    48  */
       
    49 class HsAllCollectionsState: public QState
    41 class HsAllCollectionsState: public QState
    50 {
    42 {
    51     Q_OBJECT
    43     Q_OBJECT
    52 
       
    53     HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
    44     HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
    54 
       
    55 public:
    45 public:
    56 
    46     HsAllCollectionsState(HsMenuViewBuilder &menuViewBuilder,
    57     HsAllCollectionsState(HsMenuView &menuView, QState *parent = 0);
    47                           HsMenuModeWrapper &menuMode,
    58 
    48                           QState *parent = 0);
    59     ~HsAllCollectionsState();
    49     ~HsAllCollectionsState();
    60 
    50 protected:
    61 signals:
    51 signals:
    62 
       
    63     void sortOrderChanged(HsSortAttribute sortAttribute);
    52     void sortOrderChanged(HsSortAttribute sortAttribute);
       
    53     void toAppLibraryState();
    64 
    54 
    65 public slots:
    55 public slots:
    66 
       
    67     void scrollToBeginning();
    56     void scrollToBeginning();
    68 
       
    69 private slots:
    57 private slots:
    70 
       
    71     bool openTaskSwitcher();
    58     bool openTaskSwitcher();
    72 
       
    73     void listItemActivated(const QModelIndex &index);
    59     void listItemActivated(const QModelIndex &index);
    74 
       
    75     void addActivated(const QModelIndex &index);
    60     void addActivated(const QModelIndex &index);
    76 
    61     void listItemLongPressed(HbAbstractViewItem *item, const QPointF &coords);
    77     void listItemLongPressed(HbAbstractViewItem *item,
    62     void addLongPressed(HbAbstractViewItem *item, const QPointF &coords);
    78                              const QPointF &coords);
       
    79 
       
    80     void addLongPressed(HbAbstractViewItem *item,
       
    81                         const QPointF &coords);
       
    82 
       
    83     void createNewCollection();
    63     void createNewCollection();
    84 
       
    85     void createArrangeCollection();
    64     void createArrangeCollection();
    86 
       
    87     void customMenuAction();
    65     void customMenuAction();
    88 
       
    89     void ascendingMenuAction();
    66     void ascendingMenuAction();
    90 
       
    91     void descendingMenuAction();
    67     void descendingMenuAction();
    92 
       
    93     void stateEntered();
    68     void stateEntered();
    94 
       
    95     void addModeEntered();
    69     void addModeEntered();
    96 
       
    97     void normalModeEntered();
    70     void normalModeEntered();
    98 
       
    99     void normalModeExited();
    71     void normalModeExited();
   100 
       
   101     void stateExited();
    72     void stateExited();
   102 
    73 	void contextMenuAction(HbAction *action);
   103 private:
    74 private:
   104 
       
   105     void construct();
    75     void construct();
   106 
       
   107     void setMenuOptions();
    76     void setMenuOptions();
   108 
       
   109 private:
    77 private:
   110 
    78     HbAction *mSecondarySoftkeyAction;
   111     /**
       
   112      * Sort order
       
   113      */
       
   114     HsSortAttribute mSortAttribute;
    79     HsSortAttribute mSortAttribute;
   115 
    80     HsMenuView mMenuView;
   116     /**
    81     HsMenuModeWrapper &mMenuMode;
   117      * The List View widget.
       
   118      */
       
   119     HsMenuView &mMenuView;
       
   120 
       
   121     /**
       
   122      * Item Model for the List.
       
   123      * Own.
       
   124      */
       
   125     HsMenuItemModel *mAllCollectionsModel;
    82     HsMenuItemModel *mAllCollectionsModel;
   126 
    83 	QModelIndex mContextModelIndex;
   127     QModelIndex mBookmark;
    84 	QPointer<HbMenu> mContextMenu;
   128 };
    85 };
   129 
    86 
   130 #endif // HSALLCOLLECTIONSSTATE_H
    87 #endif // HSALLCOLLECTIONSSTATE_H