|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HSARRANGESTATE_H |
|
19 #define HSARRANGESTATE_H |
|
20 |
|
21 #include <QState> |
|
22 #include <QVariant> |
|
23 #include <hsmenuservice.h> |
|
24 #include <QAbstractItemModel> |
|
25 |
|
26 #include "hsmenustates_global.h" |
|
27 HS_STATES_TEST_CLASS(MenuStatesTest) |
|
28 |
|
29 class HbListWidget; |
|
30 class HsMenuItemModel; |
|
31 class HbDialog; |
|
32 class HbAction; |
|
33 |
|
34 class HsArrangeState: public QState |
|
35 { |
|
36 Q_OBJECT |
|
37 |
|
38 // Friend classes |
|
39 HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest) |
|
40 |
|
41 public: |
|
42 |
|
43 HsArrangeState(QState *parent = 0); |
|
44 |
|
45 virtual ~HsArrangeState(); |
|
46 |
|
47 protected: |
|
48 |
|
49 void onEntry(QEvent *event); |
|
50 |
|
51 private slots: |
|
52 |
|
53 void stateExited(); |
|
54 |
|
55 void arrangeDialogFinished(HbAction* finishedAction); |
|
56 |
|
57 signals: |
|
58 void exit(); |
|
59 |
|
60 private: |
|
61 |
|
62 void construct(); |
|
63 |
|
64 void fulfillEntriesList(HbListWidget& listWidget); |
|
65 |
|
66 void getArrangedEntriesIds(const HbListWidget& listWidget); |
|
67 |
|
68 void save(const HbListWidget& listWidget); |
|
69 |
|
70 private: |
|
71 |
|
72 HbDialog *mDialog; |
|
73 |
|
74 HbListWidget *mEntriesList; |
|
75 |
|
76 HsMenuItemModel *mItemModel; |
|
77 |
|
78 int mTopItemId; |
|
79 |
|
80 int mCollectionId; |
|
81 |
|
82 QModelIndex mTopModelIndex; |
|
83 |
|
84 QList<int> mCollItemIdList; |
|
85 |
|
86 QList<int> mArrangedCollItemIdList; |
|
87 |
|
88 QObjectList mObjectList; |
|
89 |
|
90 }; |
|
91 |
|
92 #endif /* HSARRANGESTATE_H */ |