20 #ifndef KNOTIFICATION_H 21 #define KNOTIFICATION_H 26 #include <QtGui/QPixmap> 27 #include <QtCore/QObject> 28 #include <QtCore/QPair> 214 RaiseWidgetOnActivation=0x01,
238 CloseWhenWidgetActivated=0x04,
242 Persistant = Persistent,
251 Q_DECLARE_FLAGS(NotificationFlags , NotificationFlag)
273 explicit KNotification(
const QString & eventId ,
QWidget *widget=0L,
const NotificationFlags &flags=CloseOnTimeout);
298 explicit KNotification(
const QString & eventId ,
const NotificationFlags &flags,
QObject *parent = NULL );
319 void setWidget(
QWidget *widget);
325 QString eventId()
const;
332 QString title()
const;
341 void setTitle(
const QString &title);
347 QString text()
const ;
357 void setText(
const QString &text);
363 QPixmap pixmap()
const;
368 void setPixmap(
const QPixmap &pix);
373 QStringList actions()
const;
379 void setActions(
const QStringList& actions);
384 ContextList contexts()
const;
390 void setContexts(
const ContextList &contexts);
395 void addContext(
const Context & context);
401 void addContext(
const QString & context_key,
const QString & context_value );
406 NotificationFlags flags()
const;
412 void setFlags(
const NotificationFlags &flags);
429 void activated(
unsigned int action);
434 void action1Activated();
439 void action2Activated();
444 void action3Activated();
461 void activate(
unsigned int action=0);
504 void slotReceivedId(
int);
505 void slotReceivedIdError(
const QDBusError&);
515 virtual bool eventFilter(
QObject * watched, QEvent * event );
544 static KNotification *event(
const QString &eventId ,
const QString &title,
const QString &text,
545 const QPixmap &pixmap = QPixmap(),
QWidget *widget = 0L,
546 const NotificationFlags &flags = CloseOnTimeout,
563 static KNotification *event(
const QString &eventId ,
const QString &text = QString(),
564 const QPixmap &pixmap = QPixmap(),
QWidget *widget = 0L,
565 const NotificationFlags &flags = CloseOnTimeout,
581 static KNotification *event( StandardEvent eventId ,
const QString& text=QString(),
582 const QPixmap& pixmap=QPixmap(),
QWidget *widget=0L,
583 const NotificationFlags& flags=CloseOnTimeout);
600 static KNotification *event( StandardEvent eventId ,
const QString& title,
const QString& text,
601 const QPixmap& pixmap=QPixmap(),
QWidget *widget=0L,
602 const NotificationFlags& flags=CloseOnTimeout);
610 static void beep(
const QString& reason = QString() ,
QWidget *widget=0L);
613 using QObject::event;
616 Q_DECLARE_OPERATORS_FOR_FLAGS(KNotification::NotificationFlags)
QPair< QString, QString > Context
Sometimes the user may want different notifications for the same event, depending the source of the e...
QList< Context > ContextList
StandardEvent
default events you can use in the event function
KNotification is used to notify the user of an event.
void setFlags(CrashFlags flags)
Set options to determine how the default crash handler should behave.
KAction * close(const QObject *recvr, const char *slot, QObject *parent)
Close the current document.