55
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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 |
|
|
19 |
#ifndef MAINVIEW_H
|
|
20 |
#define MAINVIEW_H
|
|
21 |
|
|
22 |
#include "loadgenlistitem.h"
|
|
23 |
#include "loadgenloaditem.h"
|
|
24 |
#include <hbview.h>
|
|
25 |
|
|
26 |
class EngineWrapper;
|
|
27 |
class HbMainWindow;
|
|
28 |
class HbApplication;
|
|
29 |
class HbAction;
|
|
30 |
class HbLabel;
|
|
31 |
class HbProgressNote;
|
|
32 |
class HbListView;
|
|
33 |
class HbAbstractViewItem;
|
|
34 |
|
|
35 |
class QStandardItemModel;
|
|
36 |
class QSignalMapper;
|
|
37 |
class QPointF;
|
|
38 |
class LoadGenListItem;
|
|
39 |
class LoadGenLoadItem;
|
|
40 |
|
|
41 |
class MainView : public HbView
|
|
42 |
{
|
|
43 |
Q_OBJECT
|
|
44 |
|
|
45 |
public:
|
|
46 |
|
|
47 |
MainView(HbMainWindow &mainWindow);
|
|
48 |
~MainView();
|
|
49 |
void init(HbApplication &app);
|
|
50 |
int currentItemIndex();
|
|
51 |
void setCurrentItemIndex(int index);
|
|
52 |
void clearListSelection();
|
|
53 |
void setLoadListData(QStringList& items);
|
|
54 |
QList<int> listSelectionIndexes();
|
|
55 |
|
|
56 |
private:
|
|
57 |
void createMenu(HbApplication &app);
|
|
58 |
void loadListIinit();
|
|
59 |
bool showItemActionPopup(int &index);
|
|
60 |
void loadListDelete();
|
|
61 |
bool stopLoad(bool stopAll /*, int selectedLoad = 0*/);
|
|
62 |
|
|
63 |
private slots:
|
|
64 |
void handleLoadListEvent(HbAbstractViewItem */*listViewItem*/, const QPointF &/*coords*/);
|
|
65 |
void ItemActionPopupClosed(HbAction* action );
|
|
66 |
void loadActionPopupClosed( HbAction* action );
|
|
67 |
void showAboutPopup();
|
|
68 |
void stopAllLoads();
|
|
69 |
void updateMenu();
|
|
70 |
void launchPerfMon();
|
|
71 |
void suspendAllLoads();
|
|
72 |
void resumeAllLoads();
|
|
73 |
void activated( const QModelIndex& );
|
|
74 |
void LoadEdit();
|
|
75 |
void NewLoad();
|
|
76 |
|
|
77 |
/**
|
|
78 |
* calls engine wrapper to complete service request, specified by cmd.
|
|
79 |
*/
|
|
80 |
void executeMenuCommand(int cmd);
|
|
81 |
|
|
82 |
private:
|
|
83 |
HbMainWindow &mMainWindow;
|
|
84 |
EngineWrapper *mEngineWrapper;
|
|
85 |
HbListView *mListView;
|
|
86 |
QStandardItemModel *mListModel;
|
|
87 |
QSignalMapper *mSm;
|
|
88 |
bool mIsLoadListEmpty;
|
|
89 |
LoadGenListItem* mListItem;
|
|
90 |
LoadGenLoadItem* mLoadItem;
|
|
91 |
|
|
92 |
HbAction *mActionAbout;
|
|
93 |
HbMenu *mLoadSubMenu1;
|
|
94 |
HbMenu *mLoadSubMenu2;
|
|
95 |
HbAction *mActionExit;
|
|
96 |
HbAction *mStopAll;
|
|
97 |
HbAction *mSuspendAll;
|
|
98 |
HbAction *mResumeAll;
|
|
99 |
HbAction *mActionPerfMon;
|
|
100 |
HbAction *mCpuLoadAction;
|
|
101 |
HbAction *mMemoryEatLoadAction;
|
|
102 |
HbAction *mPhoneCallLoadAction;
|
|
103 |
HbAction *mMessagesLoadAction;
|
|
104 |
HbAction *mNetConnLoadAction;
|
|
105 |
HbAction *mAppsLoadAction;
|
|
106 |
HbAction *mKeyPressLoadAction;
|
|
107 |
HbAction *mPhotoCapturesLoadAction;
|
|
108 |
HbAction *mBtActionsLoadAction;
|
|
109 |
HbAction *mPointerEventsLoadAction;
|
|
110 |
|
|
111 |
QList<bool> mListItemExpanded;
|
|
112 |
int mPrevExpandedItem;
|
|
113 |
};
|
|
114 |
|
|
115 |
#endif // MAINVIEW_H
|