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;
|
71
|
37 |
class HsAddModeProxyModel;
|
62
|
38 |
|
|
39 |
HS_STATES_TEST_CLASS(MenuStatesTest)
|
|
40 |
|
|
41 |
class HsBaseViewState: public QState
|
|
42 |
{
|
|
43 |
Q_OBJECT
|
|
44 |
|
|
45 |
HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
|
|
46 |
|
|
47 |
public:
|
|
48 |
|
63
|
49 |
HsBaseViewState(HsMainWindow &mainWindow, QState *parent);
|
|
50 |
HsBaseViewState(HsMainWindow &mainWindow,
|
|
51 |
HsMenuModeWrapper& menuMode, QState *parent);
|
62
|
52 |
~HsBaseViewState();
|
63
|
53 |
void scrollToBeginning();
|
|
54 |
|
62
|
55 |
private slots:
|
|
56 |
|
63
|
57 |
virtual void openAppLibrary();
|
|
58 |
|
62
|
59 |
protected slots:
|
|
60 |
|
63
|
61 |
virtual void stateEntered();
|
|
62 |
virtual void stateExited();
|
|
63 |
virtual void addModeEntered();
|
71
|
64 |
virtual void addModeExited();
|
63
|
65 |
virtual void normalModeEntered();
|
|
66 |
virtual void normalModeExited();
|
|
67 |
virtual void launchItem(const QModelIndex &index);
|
|
68 |
virtual void openCollection(const QModelIndex &index);
|
|
69 |
virtual void showContextMenu(HbAbstractViewItem *item, const QPointF &coords);
|
|
70 |
virtual int checkSoftwareUpdates();
|
|
71 |
virtual bool openTaskSwitcher();
|
69
|
72 |
virtual void closeContextMenu();
|
81
|
73 |
virtual void addToHomeScreen(const int entryId);
|
|
74 |
virtual void contextMenuAction(HbAction *action);
|
|
75 |
virtual void addActivated(const QModelIndex &index);
|
86
|
76 |
virtual void addModeShowContextMenu(HbAbstractViewItem *item,
|
81
|
77 |
const QPointF &coords);
|
71
|
78 |
|
62
|
79 |
protected:
|
|
80 |
|
69
|
81 |
void initialize(HsMenuViewBuilder &menuViewBuilder, HsStateContext stateContext);
|
62
|
82 |
void createApplicationLaunchFailMessage(int errorCode,int itemId);
|
63
|
83 |
void defineTransitions();
|
|
84 |
|
62
|
85 |
private:
|
71
|
86 |
|
63
|
87 |
virtual void setContextMenuOptions(HbAbstractViewItem *item, EntryFlags flags) = 0;
|
|
88 |
virtual void setMenuOptions() = 0;
|
|
89 |
|
62
|
90 |
private:
|
|
91 |
|
69
|
92 |
QPointer<HbMessageBox> mApplicationLaunchFailMessage;
|
62
|
93 |
|
63
|
94 |
protected:
|
71
|
95 |
|
63
|
96 |
HsMenuItemModel *mModel;
|
|
97 |
QPointer<HbMenu> mContextMenu;
|
|
98 |
QModelIndex mContextModelIndex;
|
|
99 |
HbAction *mBackKeyAction;
|
|
100 |
QScopedPointer<HsMenuView> mMenuView;
|
|
101 |
HsMenuModeWrapper *mMenuMode;
|
|
102 |
HsMainWindow &mMainWindow;
|
71
|
103 |
HbMenu *mViewOptions;
|
62
|
104 |
};
|
|
105 |
|
|
106 |
|
|
107 |
#endif // HSBASEVIEWSTATE_H
|