|
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 private slots: |
|
70 void itemClicked(const QModelIndex& index); |
|
71 void catchLongPress(HbAbstractViewItem *item, const QPointF &coords); |
|
72 void changePriority(); |
|
73 |
|
74 private: |
|
75 HbMenu* mContextMenu; |
|
76 HbMenu* mPriorityMenu; |
|
77 ThreadId mThreadId; |
|
78 QString mProcessName; |
|
79 |
|
80 MemSpyThreadModel* mModel; |
|
81 }; |
|
82 |
|
83 #endif /* MEMSPYTHREADVIEW_H_ */ |