.TH "KNotifyClient" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KNotifyClient \- This namespace provides a method for issuing events to a KNotifyServer call \fBKNotifyClient::event\fP('eventname'); to issue it.  

.PP
.SH SYNOPSIS
.br
.PP
.SS "Classes"

.in +1c
.ti -1c
.RI "class \fBInstance\fP"
.br
.RI "\fIMakes it possible to use \fBKNotifyClient\fP with a \fBKInstance\fP that is not the application. Enables \fBKNotifyClient\fP to use a different \fBKInstance\fP. \fP"
.in -1c
.SS "Enumerations"

.in +1c
.ti -1c
.RI "enum { \fBDefault\fP =  -1, \fBNone\fP =  0, \fBSound\fP =  1, \fBMessagebox\fP =  2, \fBLogfile\fP =  4, \fBStderr\fP =  8, \fBPassivePopup\fP =  16, \fBExecute\fP =  32, \fBTaskbar\fP =  64 }"
.br
.ti -1c
.RI "enum { \fBNotification\fP = 1, \fBWarning\fP = 2, \fBError\fP = 4, \fBCatastrophe\fP = 8 }"
.br
.ti -1c
.RI "enum \fBStandardEvent\fP { \fBcannotOpenFile\fP, \fBnotification\fP, \fBwarning\fP, \fBfatalError\fP, \fBcatastrophe\fP }"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "KDECORE_EXPORT bool \fBstartDaemon\fP ()"
.br
.ti -1c
.RI "KDECORE_EXPORT int \fBevent\fP (const \fBQString\fP &message, const \fBQString\fP &text=QString::null) KDE_DEPRECATED"
.br
.ti -1c
.RI "KDECORE_EXPORT int \fBevent\fP (\fBStandardEvent\fP event, const \fBQString\fP &text=QString::null) KDE_DEPRECATED"
.br
.ti -1c
.RI "KDECORE_EXPORT int \fBuserEvent\fP (const \fBQString\fP &text=QString::null, int present=Default, int level=Default, const \fBQString\fP &sound=QString::null, const \fBQString\fP &file=QString::null) KDE_DEPRECATED"
.br
.ti -1c
.RI "KDECORE_EXPORT int \fBevent\fP (int winId, const \fBQString\fP &message, const \fBQString\fP &text=QString::null)"
.br
.ti -1c
.RI "KDECORE_EXPORT int \fBevent\fP (int winId, \fBStandardEvent\fP event, const \fBQString\fP &text=QString::null)"
.br
.ti -1c
.RI "KDECORE_EXPORT int \fBuserEvent\fP (int winId, const \fBQString\fP &text=QString::null, int present=Default, int level=Default, const \fBQString\fP &sound=QString::null, const \fBQString\fP &file=QString::null)"
.br
.ti -1c
.RI "KDECORE_EXPORT void \fBbeep\fP (const \fBQString\fP &reason=QString::null)"
.br
.ti -1c
.RI "KDECORE_EXPORT int \fBgetPresentation\fP (const \fBQString\fP &eventname)"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBQString\fP \fBgetFile\fP (const \fBQString\fP &eventname, int present)"
.br
.ti -1c
.RI "KDECORE_EXPORT int \fBgetDefaultPresentation\fP (const \fBQString\fP &eventname)"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBQString\fP \fBgetDefaultFile\fP (const \fBQString\fP &eventname, int present)"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBKInstance\fP * \fBinstance\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
This namespace provides a method for issuing events to a KNotifyServer call \fBKNotifyClient::event\fP('eventname'); to issue it. 

On installation, there should be a file called $KDEDIR/share/apps/appname/eventsrc which contains the events.
.PP
The file looks like this: 
.PP
.nf
 [!Global!]
 IconName=Filename (e.g. kdesktop, without any extension)
 Comment=FriendlyNameOfApp

 [eventname]
 Name=FriendlyNameOfEvent
 Comment=Description Of Event
 default_sound=filetoplay.wav
 default_logfile=logfile.txt
 default_commandline=command
 default_presentation=1
  ...

.fi
.PP
 default_presentation contains these ORed events: None=0, Sound=1, Messagebox=2, Logfile=4, Stderr=8, PassivePopup=16, Execute=32, Taskbar=64
.PP
KNotify will search for sound files given with a relative path first in the application's sound directory (share/apps/Application Name/sounds), then in the \fBKDE\fP global sound directory (share/sounds).
.PP
You can also use the 'nopresentation' key, with any the presentations ORed. Those that are in that field will not appear in the kcontrol module. This was intended for software like KWin to not allow a window-opening that opens a window (e.g., allowing to disable KMessageBoxes from appearing) If the user edits the eventsrc file manually, it will appear. This only affects the KcmNotify.
.PP
You can also use the following events, which are system controlled and do not need to be placed in your eventsrc:
.PP
.PD 0
.IP "\(bu" 2
cannotopenfile 
.IP "\(bu" 2
notification 
.IP "\(bu" 2
warning 
.IP "\(bu" 2
fatalerror 
.IP "\(bu" 2
catastrophe 
.PP
.PP
The events can be configured in an application using \fBKNotifyDialog\fP, which is part of \fBKIO\fP.
.PP
\fBAuthor:\fP
.RS 4
Charles Samuels <charles@kde.org> 
.RE
.PP

.PP
.SH "Enumeration Type Documentation"
.PP 
.SS "anonymous enum"
.PP
Describes the notification method. 
.PP
\fBEnumeration values: \fP
.in +1c
.TP
\fB\fIPassivePopup \fP\fP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.TP
\fB\fIExecute \fP\fP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.TP
\fB\fITaskbar \fP\fP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 138 of file knotifyclient.h.
.SS "anonymous enum"
.PP
Describes the level of the error. 
.PP

.PP
Definition at line 153 of file knotifyclient.h.
.SS "enum \fBKNotifyClient::StandardEvent\fP"
.PP
default events you can use 
.PP
Definition at line 163 of file knotifyclient.h.
.SH "Function Documentation"
.PP 
.SS "bool KNotifyClient::startDaemon ()"
.PP
This starts the KNotify Daemon, if it's not already started. 
.PP
This will be useful for games that use sound effects. Run this at the start of the program, and there won't be a pause when it is first triggered. 
.PP
\fBReturns:\fP
.RS 4
true if daemon is running (always true at the moment) 
.RE
.PP

.PP
Definition at line 225 of file knotifyclient.cpp.
.PP
References KApplication::startServiceByDesktopName().
.SS "int KNotifyClient::event (const \fBQString\fP & message, const \fBQString\fP & text = \fCQString::null\fP)"
.PP
\fBDeprecated\fP
.RS 4
.RE
.PP
\fBParameters:\fP
.RS 4
\fImessage\fP The name of the event 
.br
\fItext\fP The text to put in a dialog box. This won't be shown if the user connected the event to sound, only. Can be QString::null. 
.RE
.PP
\fBReturns:\fP
.RS 4
a value > 0, unique for this event if successful, 0 otherwise
.RE
.PP

.PP
Definition at line 112 of file knotifyclient.cpp.
.PP
Referenced by beep(), and event().
.SS "int KNotifyClient::event (StandardEvent event, const \fBQString\fP & text = \fCQString::null\fP)"
.PP
\fBDeprecated\fP
.RS 4
Allows to easily emit standard events.
.RE
.PP
\fBParameters:\fP
.RS 4
\fIevent\fP The event you want to raise. 
.br
\fItext\fP The text explaining the event you raise. Can be QString::null. 
.RE
.PP
\fBReturns:\fP
.RS 4
a value > 0, unique for this event if successful, 0 otherwise
.RE
.PP

.PP
Definition at line 107 of file knotifyclient.cpp.
.PP
References event().
.SS "int KNotifyClient::userEvent (const \fBQString\fP & text = \fCQString::null\fP, int present = \fCDefault\fP, int level = \fCDefault\fP, const \fBQString\fP & sound = \fCQString::null\fP, const \fBQString\fP & file = \fCQString::null\fP)"
.PP
\fBDeprecated\fP
.RS 4
Will fire an event that's not registered.
.RE
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The error message text, if applicable 
.br
\fIpresent\fP The presentation method(s) of the event 
.br
\fIlevel\fP The error message level, defaulting to 'Default' 
.br
\fIsound\fP The sound file to play if selected with \fCpresent\fP 
.br
\fIfile\fP The log file to append the message to if selected with \fCpresent\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
a value > 0, unique for this event if successful, 0 otherwise
.RE
.PP

.PP
Definition at line 117 of file knotifyclient.cpp.
.PP
Referenced by KAudioPlayer::play().
.SS "int KNotifyClient::event (int winId, const \fBQString\fP & message, const \fBQString\fP & text = \fCQString::null\fP)"
.PP
This should be the most used method in here. 
.PP
Pass the origin-widget's winId() here so that a PassivePopup can be placed appropriately.
.PP
Call it by \fBKNotifyClient::event\fP(widget->winId(), 'EventName'); It will use \fBKApplication::kApplication\fP->dcopClient() to communicate to the server 
.PP
\fBParameters:\fP
.RS 4
\fIwinId\fP The winId() of the widget where the event originates 
.br
\fImessage\fP The name of the event 
.br
\fItext\fP The text to put in a dialog box. This won't be shown if the user connected the event to sound, only. Can be QString::null. 
.RE
.PP
\fBReturns:\fP
.RS 4
a value > 0, unique for this event if successful, 0 otherwise 
.RE
.PP
\fBSince:\fP
.RS 4
3.1.1
.RE
.PP

.PP
Definition at line 150 of file knotifyclient.cpp.
.SS "int KNotifyClient::event (int winId, StandardEvent event, const \fBQString\fP & text = \fCQString::null\fP)"
.PP
You should pass the origin-widget's winId() here so that a PassivePopup can be placed appropriately. 
.PP
\fBParameters:\fP
.RS 4
\fIwinId\fP The winId() of the widget where the event originates 
.br
\fIevent\fP The event you want to raise 
.br
\fItext\fP The text to put in a dialog box. This won't be shown if the user connected the event to sound, only. Can be QString::null. 
.RE
.PP
\fBReturns:\fP
.RS 4
a value > 0, unique for this event if successful, 0 otherwise 
.RE
.PP
\fBSince:\fP
.RS 4
3.1.1
.RE
.PP

.PP
Definition at line 124 of file knotifyclient.cpp.
.PP
References QString::fromLatin1().
.SS "int KNotifyClient::userEvent (int winId, const \fBQString\fP & text = \fCQString::null\fP, int present = \fCDefault\fP, int level = \fCDefault\fP, const \fBQString\fP & sound = \fCQString::null\fP, const \fBQString\fP & file = \fCQString::null\fP)"
.PP
Will fire an event that's not registered. 
.PP
You should pass the origin-widget's winId() here so that a PassivePopup can be placed appropriately. 
.PP
\fBParameters:\fP
.RS 4
\fIwinId\fP The winId() of the originating widget 
.br
\fItext\fP The error message text, if applicable 
.br
\fIpresent\fP The presentation method(s) of the event 
.br
\fIlevel\fP The error message level, defaulting to 'Default' 
.br
\fIsound\fP The sound file to play if selected with \fCpresent\fP 
.br
\fIfile\fP The log file to append the message to if selected with \fCpresent\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
a value > 0, unique for this event if successful, 0 otherwise 
.RE
.PP
\fBSince:\fP
.RS 4
3.1.1
.RE
.PP

.PP
Definition at line 156 of file knotifyclient.cpp.
.SS "void KNotifyClient::beep (const \fBQString\fP & reason = \fCQString::null\fP)"
.PP
This is a simple substitution for \fBQApplication::beep()\fP. 
.PP
It simply calls 
.PP
.nf
 KNotifyClient::event( KNotifyClient::notification, reason );

.fi
.PP
 
.PP
\fBParameters:\fP
.RS 4
\fIreason\fP the reason, can be QString::null.
.RE
.PP

.PP
Definition at line 239 of file knotifyclient.cpp.
.PP
References DCOPClient::attach(), QApplication::beep(), event(), DCOPClient::isApplicationRegistered(), and DCOPClient::isAttached().
.SS "int KNotifyClient::getPresentation (const \fBQString\fP & eventname)"
.PP
Gets the presentation associated with a certain event name Remeber that they may be ORed: 
.PP
.nf
 if (present & KNotifyClient::Sound) { [Yes, sound is a default] }  

.fi
.PP
. 
.PP
\fBParameters:\fP
.RS 4
\fIeventname\fP the event name to check 
.RE
.PP
\fBReturns:\fP
.RS 4
the presentation methods
.RE
.PP

.PP
Definition at line 163 of file knotifyclient.cpp.
.PP
References KConfigBase::readNumEntry(), and KConfigBase::setGroup().
.SS "\fBQString\fP KNotifyClient::getFile (const \fBQString\fP & eventname, int present)"
.PP
Gets the default file associated with a certain event name The control panel module will list all the event names This has the potential for being slow. 
.PP
\fBParameters:\fP
.RS 4
\fIeventname\fP the name of the event 
.br
\fIpresent\fP the presentation method 
.RE
.PP
\fBReturns:\fP
.RS 4
the associated file. Can be QString::null if not found.
.RE
.PP

.PP
Definition at line 176 of file knotifyclient.cpp.
.PP
References KConfigBase::readPathEntry(), and KConfigBase::setGroup().
.SS "int KNotifyClient::getDefaultPresentation (const \fBQString\fP & eventname)"
.PP
Gets the default presentation for the event of this program. 
.PP
Remember that the Presentation may be ORed. Try this: 
.PP
.nf
 if (present & KNotifyClient::Sound) { [Yes, sound is a default] }

.fi
.PP
 
.PP
\fBReturns:\fP
.RS 4
the presentation methods
.RE
.PP

.PP
Definition at line 194 of file knotifyclient.cpp.
.PP
References KConfigBase::readNumEntry(), and KConfigBase::setGroup().
.SS "\fBQString\fP KNotifyClient::getDefaultFile (const \fBQString\fP & eventname, int present)"
.PP
Gets the default File for the event of this program. 
.PP
It gets it in relation to present. Some events don't apply to this function ('Message Box') Some do (Sound) 
.PP
\fBParameters:\fP
.RS 4
\fIeventname\fP the name of the event 
.br
\fIpresent\fP the presentation method 
.RE
.PP
\fBReturns:\fP
.RS 4
the default file. Can be QString::null if not found.
.RE
.PP

.PP
Definition at line 207 of file knotifyclient.cpp.
.PP
References KConfigBase::readPathEntry(), and KConfigBase::setGroup().
.SS "\fBKInstance\fP * KNotifyClient::instance ()"
.PP
Shortcut to \fBKNotifyClient::Instance::current()\fP :). 
.PP
\fBReturns:\fP
.RS 4
the current \fBKInstance\fP.
.RE
.PP

.PP
Definition at line 267 of file knotifyclient.cpp.
.PP
References KNotifyClient::Instance::current().
.PP
Referenced by KNotifyClient::Instance::Instance().
.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
