homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h
branchRCL_3
changeset 82 5f0182e07bfb
equal deleted inserted replaced
79:f00a6757af32 82:5f0182e07bfb
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: Menu collection state.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef HSCOLLECTIONSTATE_H
       
    19 #define HSCOLLECTIONSTATE_H
       
    20 
       
    21 #include <QState>
       
    22 #include <QAbstractItemModel>
       
    23 
       
    24 #include "hsbaseviewstate.h"
       
    25 
       
    26 HS_STATES_TEST_CLASS(MenuStatesTest)
       
    27 
       
    28 class HbView;
       
    29 class HbAction;
       
    30 class HbMenu;
       
    31 class HbAbstractViewItem;
       
    32 class HsMenuItemModel;
       
    33 class HsMenuModeWrapper;
       
    34 class HsMenuViewBuilder;
       
    35 class HsMainWindow;
       
    36 
       
    37 class HsCollectionState: public HsBaseViewState
       
    38 {
       
    39     Q_OBJECT
       
    40     HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
       
    41 public:
       
    42     HsCollectionState(HsMenuViewBuilder &menuView,
       
    43                       HsMenuModeWrapper &menuMode,
       
    44                       HsMainWindow &mainWindow,
       
    45                       QState *parent = 0);
       
    46     ~HsCollectionState();
       
    47 protected:
       
    48     void onEntry(QEvent *event);
       
    49 signals:
       
    50     void sortOrderChanged(Hs::HsSortAttribute sortAttribute);
       
    51 private slots:
       
    52     void addAppsAction();
       
    53     void addCollectionShortcutToHomeScreenAction();
       
    54     void renameAction();
       
    55     void deleteAction();
       
    56     void updateLabel();
       
    57     void stateEntered();
       
    58 
       
    59     void stateExited();
       
    60     void latestOnTopMenuAction();
       
    61     void oldestOnTopMenuAction();
       
    62     void contextMenuAction(HbAction *action);
       
    63     void handleEmptyChange(bool empty);
       
    64     void lockSearchButton(bool lock);
       
    65     void createArrangeCollection();
       
    66 
       
    67 private:
       
    68     void construct();
       
    69     void constructMenu(bool isDynamic);
       
    70     void makeConnect();
       
    71     void makeDisconnect();
       
    72     void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags);
       
    73     void setMenuOptions();
       
    74 
       
    75 private:
       
    76     Hs::HsSortAttribute mSortAttribute;
       
    77     int mCollectionId;
       
    78     QString mCollectionType;
       
    79 };
       
    80 
       
    81 #endif // HSCOLLECTIONSTATE_H