62
|
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: Base for menu view states.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef HSBASEVIEWSTATE_H
|
|
19 |
#define HSBASEVIEWSTATE_H
|
|
20 |
|
63
|
21 |
#include <QState>
|
|
22 |
#include <QPointer>
|
|
23 |
#include <QModelIndex>
|
62
|
24 |
|
|
25 |
#include "hsmenustates_global.h"
|
|
26 |
#include "hsmenuservice.h"
|
|
27 |
#include "hsmenuview.h"
|
|
28 |
|
69
|
29 |
|
63
|
30 |
class HbMenu;
|
|
31 |
class HbAction;
|
62
|
32 |
class HbMessageBox;
|
63
|
33 |
class HbAbstractViewItem;
|
62
|
34 |
class CaNotifier;
|
63
|
35 |
class HsMenuModeWrapper;
|
|
36 |
class HsMainWindow;
|
62
|
37 |
|
|
38 |
HS_STATES_TEST_CLASS(MenuStatesTest)
|
|
39 |
|
|
40 |
class HsBaseViewState: public QState
|
|
41 |
{
|
|
42 |
Q_OBJECT
|
|
43 |
|
|
44 |
HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
|
|
45 |
|
|
46 |
public:
|
|
47 |
|
63
|
48 |
HsBaseViewState(HsMainWindow &mainWindow, QState *parent);
|
|
49 |
HsBaseViewState(HsMainWindow &mainWindow,
|
|
50 |
HsMenuModeWrapper& menuMode, QState *parent);
|
62
|
51 |
~HsBaseViewState();
|
63
|
52 |
void scrollToBeginning();
|
|
53 |
|
62
|
54 |
private slots:
|
|
55 |
|
63
|
56 |
virtual void openAppLibrary();
|
|
57 |
|
62
|
58 |
protected slots:
|
|
59 |
|
63
|
60 |
virtual void stateEntered();
|
|
61 |
virtual void stateExited();
|
|
62 |
virtual void addModeEntered();
|
|
63 |
virtual void normalModeEntered();
|
|
64 |
virtual void normalModeExited();
|
|
65 |
virtual void launchItem(const QModelIndex &index);
|
|
66 |
virtual void openCollection(const QModelIndex &index);
|
|
67 |
virtual void showContextMenu(HbAbstractViewItem *item, const QPointF &coords);
|
|
68 |
virtual int checkSoftwareUpdates();
|
|
69 |
virtual bool openTaskSwitcher();
|
69
|
70 |
virtual void closeContextMenu();
|
62
|
71 |
protected:
|
|
72 |
|
69
|
73 |
void initialize(HsMenuViewBuilder &menuViewBuilder, HsStateContext stateContext);
|
62
|
74 |
void createApplicationLaunchFailMessage(int errorCode,int itemId);
|
63
|
75 |
void defineTransitions();
|
|
76 |
|
62
|
77 |
private:
|
63
|
78 |
virtual void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags) = 0;
|
|
79 |
virtual void setMenuOptions() = 0;
|
|
80 |
|
|
81 |
|
62
|
82 |
private:
|
|
83 |
|
69
|
84 |
QPointer<HbMessageBox> mApplicationLaunchFailMessage;
|
62
|
85 |
|
63
|
86 |
protected:
|
|
87 |
HsMenuItemModel *mModel;
|
|
88 |
QPointer<HbMenu> mContextMenu;
|
|
89 |
QModelIndex mContextModelIndex;
|
|
90 |
HbAction *mBackKeyAction;
|
|
91 |
QScopedPointer<HsMenuView> mMenuView;
|
|
92 |
HsMenuModeWrapper *mMenuMode;
|
|
93 |
HsMainWindow &mMainWindow;
|
62
|
94 |
};
|
|
95 |
|
|
96 |
|
|
97 |
#endif // HSBASEVIEWSTATE_H
|