knotify.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KNOTIFY_H
00021 #define KNOTIFY_H
00022
00023 #include <qobject.h>
00024 #include <knotifyclient.h>
00025 #include <dcopobject.h>
00026
00027 #include <kdemm/simpleplayer.h>
00028
00029 class KNotifyPrivate;
00030 class KProcess;
00031
00032 class KNotify : public QObject, public DCOPObject
00033 {
00034 Q_OBJECT
00035 K_DCOP
00036
00037 public:
00038 KNotify( bool useArts );
00039 ~KNotify();
00040
00041 enum PlayingFinishedStatus
00042 {
00043 PlayedOK = 0,
00044 NoSoundFile,
00045 FileAlreadyPlaying,
00046 NoSoundSupport,
00047 PlayerBusy,
00048 Aborted,
00049 Unknown = 5000
00050 };
00051
00052 protected:
00053 k_dcop:
00054
00055 void notify(const QString &event, const QString &fromApp,
00056 const QString &text, QString sound, QString file,
00057 int present, int level);
00058
00059
00060 void notify(const QString &event, const QString &fromApp,
00061 const QString &text, QString sound, QString file,
00062 int present, int level, int winId);
00063
00064 void notify(const QString &event, const QString &fromApp,
00065 const QString &text, QString sound, QString file,
00066 int present, int level, int winId, int eventId);
00067
00068
00069 void reconfigure();
00070 void setVolume( int volume );
00071 void sessionReady();
00072
00073 private:
00074 bool notifyBySound(const QString &sound, const QString &appname, int eventId);
00075 bool notifyByMessagebox(const QString &text, int level, WId winId);
00076 bool notifyByLogfile(const QString &text, const QString &file);
00077 bool notifyByStderr(const QString &text);
00078 bool notifyByPassivePopup(const QString &text, const QString &appName,
00079 WId winId );
00080 bool notifyByExecute(const QString &command,
00081 const QString& event,
00082 const QString& fromApp,
00083 const QString& text,
00084 int winId,
00085 int eventId );
00086 bool notifyByTaskbar( WId winId );
00087
00088 void soundFinished( int eventId, PlayingFinishedStatus reason );
00089
00090 WId checkWinId( const QString& appName, WId senderWinId );
00091
00095 bool isGlobal(const QString &eventname);
00096
00097 private slots:
00098 void playTimeout();
00099 void slotPlayerProcessExited( KProcess *proc );
00100 void objectDeleter( KDE::Multimedia::SimplePlayer* );
00101
00102 signals:
00103 void deletePlayObject( KDE::Multimedia::SimplePlayer* );
00104
00105
00106 private:
00107 KNotifyPrivate* d;
00108 void loadConfig();
00109 };
00110
00111
00112 #endif
00113
This file is part of the documentation for arts Library Version 3.4.2.