summaryrefslogtreecommitdiff
path: root/core/launcher/runningappbar.h
Unidiff
Diffstat (limited to 'core/launcher/runningappbar.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/runningappbar.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/core/launcher/runningappbar.h b/core/launcher/runningappbar.h
new file mode 100644
index 0000000..880bb69
--- a/dev/null
+++ b/core/launcher/runningappbar.h
@@ -0,0 +1,88 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21#ifndef RUNNING_APP_BAR_H
22#define RUNNING_APP_BAR_H
23
24#include <qframe.h>
25#include <qlist.h>
26#include <qtimer.h>
27
28class AppLnk;
29class AppLnkSet;
30class QCString;
31class QProcess;
32class QMessageBox;
33
34class RunningAppBar : public QFrame {
35 Q_OBJECT
36
37 public:
38 RunningAppBar(QWidget* parent);
39 ~RunningAppBar();
40
41 void addTask(const AppLnk& appLnk);
42 void removeTask(const AppLnk& appLnk);
43 void paintEvent(QPaintEvent* event);
44 void mousePressEvent(QMouseEvent*);
45 void mouseReleaseEvent(QMouseEvent*);
46 QSize sizeHint() const;
47
48 private slots:
49 void newQcopChannel(const QString& channel);
50 void removedQcopChannel(const QString& channel);
51 void received(const QCString& msg, const QByteArray& data);
52
53 private:
54 AppLnkSet* m_AppLnkSet;
55 QList<AppLnk> m_AppList;
56 int m_SelectedAppIndex;
57 int spacing;
58};
59
60/**
61 * Internal class that checks back in on the process when timerExpired is called
62 * to make sure the process is on top. If it's not it displays a dialog
63 * box asking permission to kill it.
64 */
65class AppMonitor : public QObject {
66 Q_OBJECT
67
68 public:
69 static const int RAISE_TIMEOUT_MS;
70
71 AppMonitor(const AppLnk& app, RunningAppBar& owner);
72 ~AppMonitor();
73
74 private slots:
75 void timerExpired();
76 void received(const QCString& msg, const QByteArray& data);
77 void psProcFinished();
78
79 private:
80 RunningAppBar& m_Owner;
81 const AppLnk& m_App;
82 QTimer m_Timer;
83 QProcess* m_PsProc;
84 QMessageBox* m_AppKillerBox;
85};
86
87#endif
88