Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

applauncher.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of the Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 
00021 #ifndef APP_LAUNCHER_H
00022 #define APP_LAUNCHER_H
00023 
00024 #include <qtopia/global.h>
00025 #include <qobject.h>
00026 #include <qmap.h>
00027 #ifdef Q_OS_WIN32
00028 #include <qtopia/qprocess.h>
00029 #include <qlist.h>
00030 #endif
00031 
00032 class QMessageBox;
00033 
00034 class AppLauncher : public QObject
00035 {
00036     Q_OBJECT
00037 public:
00038     AppLauncher(QObject *parent = 0, const char *name = 0);
00039     ~AppLauncher();
00040 
00041     bool isRunning(const QString &app);
00042     const QMap<int,QString> &runningApplications() { return runningApps; }
00043 
00044     static const int RAISE_TIMEOUT_MS;
00045 
00046 signals:
00047     void launched(int pid, const QString &app);
00048     void terminated(int pid, const QString &app);
00049     void connected(const QString &app);
00050 
00051 protected slots:
00052     void sigStopped(int sigPid, int sigStatus);
00053     void received(const QCString& msg, const QByteArray& data);
00054     void newQcopChannel(const QString& channel);
00055     void removedQcopChannel(const QString& channel);
00056     void createQuickLauncher();
00057     void processExited();
00058 
00059 protected:
00060     bool event(QEvent *);
00061     void timerEvent( QTimerEvent * );
00062 
00063 private:
00064     static void signalHandler(int sig);
00065     bool executeBuiltin(const QString &c, const QString &document);
00066     bool execute(const QString &c, const QString &document, bool noRaise = FALSE);
00067     void kill( int pid );
00068     int pidForName( const QString & );
00069 
00070 private:
00071     QMap<int,QString> runningApps;
00072     QMap<QString,int> waitingHeartbeat;
00073 #ifdef Q_OS_WIN32
00074     QList<QProcess> runningAppsProc;
00075 #endif
00076     int qlPid;
00077     bool qlReady;
00078     QMessageBox *appKillerBox;
00079     QString appKillerName;
00080 };
00081 
00082 #endif
00083 

Generated on Sat Nov 5 16:15:29 2005 for OPIE by  doxygen 1.4.2