author | harlekin <harlekin> | 2002-09-09 18:21:06 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-09 18:21:06 (UTC) |
commit | c9442bf567252553da8ce216de1e64cbf70db3bd (patch) (unidiff) | |
tree | 8eedf088cc2ad2608287a5e6c94ad05587fa9dc0 /core/launcher/runningappbar.h | |
parent | 3044db24e632adbcf5dbbf1874944d54cee7c8e3 (diff) | |
download | opie-c9442bf567252553da8ce216de1e64cbf70db3bd.zip opie-c9442bf567252553da8ce216de1e64cbf70db3bd.tar.gz opie-c9442bf567252553da8ce216de1e64cbf70db3bd.tar.bz2 |
mrulist is dead, long live runningappbar, hopefully
-rw-r--r-- | core/launcher/runningappbar.h | 88 |
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 | |||
28 | class AppLnk; | ||
29 | class AppLnkSet; | ||
30 | class QCString; | ||
31 | class QProcess; | ||
32 | class QMessageBox; | ||
33 | |||
34 | class 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 | */ | ||
65 | class 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 | |||