51
|
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 MEMSPYTHREADVIEW_H_
|
|
19 |
#define MEMSPYTHREADVIEW_H_
|
|
20 |
|
|
21 |
#include "memspylistview.h"
|
|
22 |
#include "enginewrapper.h"
|
|
23 |
|
|
24 |
class MemSpyThreadModel : public QAbstractListModel
|
|
25 |
{
|
|
26 |
public:
|
|
27 |
MemSpyThreadModel(EngineWrapper &engine, ProcessId threadId, QObject *parent = 0);
|
|
28 |
|
|
29 |
~MemSpyThreadModel();
|
|
30 |
|
|
31 |
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
32 |
|
|
33 |
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
|
34 |
|
|
35 |
void refresh();
|
|
36 |
|
|
37 |
private:
|
|
38 |
ProcessId mProcessId;
|
|
39 |
|
|
40 |
EngineWrapper& mEngine;
|
|
41 |
|
|
42 |
QList<MemSpyThread*> mThreads;
|
|
43 |
|
|
44 |
QMap<int, QString> mPriorityMap;
|
|
45 |
};
|
|
46 |
|
|
47 |
|
|
48 |
class MemSpyThreadView : public MemSpyListView
|
|
49 |
{
|
|
50 |
Q_OBJECT
|
|
51 |
|
|
52 |
public:
|
|
53 |
MemSpyThreadView(EngineWrapper &engine, ViewManager &viewManager);
|
|
54 |
~MemSpyThreadView();
|
|
55 |
|
|
56 |
public slots:
|
|
57 |
virtual void refresh();
|
|
58 |
|
|
59 |
protected:
|
|
60 |
void initialize(const QVariantMap& params);
|
|
61 |
|
|
62 |
protected:
|
|
63 |
virtual bool isRefreshable() const { return true; }
|
|
64 |
|
|
65 |
virtual bool isBreadCrumbVisible() const;
|
|
66 |
|
|
67 |
QString getBreadCrumbText() const;
|
|
68 |
|
|
69 |
HbMenu* createToolMenu();
|
|
70 |
|
|
71 |
private slots:
|
|
72 |
void itemClicked(const QModelIndex& index);
|
|
73 |
void catchLongPress(HbAbstractViewItem *item, const QPointF &coords);
|
|
74 |
void changePriority();
|
|
75 |
|
|
76 |
void kill();
|
|
77 |
void panic();
|
|
78 |
void terminate();
|
|
79 |
|
|
80 |
private:
|
|
81 |
HbMenu* mContextMenu;
|
|
82 |
HbMenu* mPriorityMenu;
|
|
83 |
ProcessId mProcessId;
|
|
84 |
ThreadId mThreadId;
|
|
85 |
QString mProcessName;
|
|
86 |
|
|
87 |
MemSpyThreadModel* mModel;
|
|
88 |
};
|
|
89 |
|
|
90 |
#endif /* MEMSPYTHREADVIEW_H_ */
|