kdecore Library API Documentation

knotifyclient.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2000 Charles Samuels <charles@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00016    Boston, MA 02111-1307, USA.
00017 */
00018 #ifndef _KNOTIFY_CLIENT
00019 #define _KNOTIFY_CLIENT
00020 #include <qstring.h>
00021 
00022 class KInstance;
00023 #undef None // X11 headers...
00024 
00073 namespace KNotifyClient
00074 {
00075     struct InstancePrivate;
00076         class InstanceStack;
00077 
00090     class Instance
00091     {
00092     public:
00098         Instance(KInstance *instance);
00103         ~Instance();
00109         bool useSystemBell() const;
00114         static KInstance *current();
00115 
00120         static Instance *currentInstance();
00121         
00122     private:
00123                 static InstanceStack *instances();
00124                 InstancePrivate *d;
00125                 static InstanceStack *s_instances;
00126     };
00127 
00128 
00132         enum {
00133                 Default = -1,
00134                 None = 0,
00135                 Sound = 1,
00136                 Messagebox = 2,
00137                 Logfile = 4,
00138                 Stderr = 8,
00139                 PassivePopup = 16, 
00140                 Execute = 32       
00141         };
00142 
00146         enum {
00147                 Notification=1,
00148                 Warning=2,
00149                 Error=4,
00150                 Catastrophe=8
00151         };
00152 
00156         enum StandardEvent {
00157                 cannotOpenFile,
00158                 notification,
00159                 warning,
00160                 fatalError,
00161                 catastrophe
00162         };
00163 
00171         bool startDaemon();
00172 
00173 //#ifndef KDE_NO_COMPAT
00181         bool event(const QString &message, const QString &text=QString::null);
00182 
00190         bool event( StandardEvent event, const QString& text=QString::null );
00191 
00202         bool userEvent(const QString &text=QString::null, int present=Default, int level=Default,
00203                               const QString &sound=QString::null, const QString &file=QString::null);
00204         
00205 //#endif
00206     
00222         bool event( int winId, const QString& message, 
00223                     const QString& text = QString::null );
00224     
00236         bool event( int winId, StandardEvent event,
00237                     const QString& text = QString::null );
00238     
00253         bool userEvent(int winId, const QString &text=QString::null, int present=Default, int level=Default,
00254                               const QString &sound=QString::null, const QString &file=QString::null);
00255         
00264         void beep(const QString& reason=QString::null);
00265 
00275         int getPresentation(const QString &eventname);
00276         
00285         QString getFile(const QString &eventname, int present);
00286         
00295         int getDefaultPresentation(const QString &eventname);
00296         
00306         QString getDefaultFile(const QString &eventname, int present);
00307 
00312         KInstance * instance();
00313 }
00314 
00315 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:46:43 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001