mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-24 19:02:51 +00:00
115 lines
4.8 KiB
Text
115 lines
4.8 KiB
Text
//
|
|
// Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
|
|
// Earlier copyrights 1998 - 2007 Jim Bublitz also apply
|
|
|
|
// Generated by twine
|
|
|
|
// This file is part of PyKDE4.
|
|
|
|
// PyKDE4 is free software; you can redistribute it and/or modify
|
|
// it under the terms of the GNU Lesser General Public License as
|
|
// published by the Free Software Foundation; either version 2.1 of
|
|
// the License, or (at your option) any later version.
|
|
|
|
// PyKDE4 is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
class KNotification : QObject
|
|
{
|
|
%TypeHeaderCode
|
|
#include <knotification.h>
|
|
%End
|
|
|
|
|
|
public:
|
|
typedef QPair<QString,QString> Context;
|
|
|
|
//ig typedef QList<KNotification::Context> ContextList;
|
|
|
|
|
|
enum NotificationFlag
|
|
{
|
|
RaiseWidgetOnActivation,
|
|
CloseOnTimeout,
|
|
Persistent,
|
|
CloseWhenWidgetActivated,
|
|
Persistant,
|
|
DefaultEvent
|
|
};
|
|
|
|
typedef QFlags<KNotification::NotificationFlag> NotificationFlags;
|
|
|
|
|
|
enum StandardEvent
|
|
{
|
|
Notification,
|
|
Warning,
|
|
Error,
|
|
Catastrophe
|
|
};
|
|
|
|
explicit KNotification (const QString& eventId, QWidget* widget = 0, const KNotification::NotificationFlags& flags = KNotification::CloseOnTimeout);
|
|
QWidget* widget () const;
|
|
void setWidget (QWidget* widget);
|
|
QString eventId () const;
|
|
QString title () const;
|
|
void setTitle (const QString& title);
|
|
QString text () const;
|
|
void setText (const QString& text);
|
|
QPixmap pixmap () const;
|
|
void setPixmap (const QPixmap& pix);
|
|
QStringList actions () const;
|
|
void setActions (const QStringList& actions);
|
|
KNotification::ContextList contexts () const;
|
|
void setContexts (const KNotification::ContextList& contexts);
|
|
void addContext (const KNotification::Context& context);
|
|
void addContext (const QString& context_key, const QString& context_value);
|
|
KNotification::NotificationFlags flags () const;
|
|
void setFlags (const KNotification::NotificationFlags& flags);
|
|
void setComponentData (const KComponentData& componentData);
|
|
|
|
signals:
|
|
void activated ();
|
|
void activated (unsigned int action);
|
|
void action1Activated ();
|
|
void action2Activated ();
|
|
void action3Activated ();
|
|
void closed ();
|
|
void ignored ();
|
|
|
|
public:
|
|
void activate (unsigned int action = 0);
|
|
void close ();
|
|
void raiseWidget ();
|
|
void ref ();
|
|
void deref ();
|
|
void sendEvent ();
|
|
void update ();
|
|
|
|
protected:
|
|
virtual bool eventFilter (QObject* watched, QEvent* event);
|
|
|
|
public:
|
|
static KNotification* event (const QString& eventId, const QString& text = QString(), const QPixmap& pixmap = QPixmap(), QWidget* widget = 0, const KNotification::NotificationFlags& flags = KNotification::CloseOnTimeout, const KComponentData& componentData = KComponentData());
|
|
static KNotification* event (KNotification::StandardEvent eventId, const QString& text = QString(), const QPixmap& pixmap = QPixmap(), QWidget* widget = 0, const KNotification::NotificationFlags& flags = KNotification::CloseOnTimeout);
|
|
static void beep (const QString& reason = QString(), QWidget* widget = 0);
|
|
|
|
//force
|
|
typedef QList<QPair<QString,QString>> ContextList;
|
|
|
|
|
|
//end
|
|
~KNotification ();
|
|
explicit KNotification (const QString& eventId, const KNotification::NotificationFlags& flags, QObject* parent /TransferThis/ = NULL);
|
|
static KNotification* event (const QString& eventId, const QString& title, const QString& text, const QPixmap& pixmap = QPixmap(), QWidget* widget = 0, const KNotification::NotificationFlags& flags = KNotification::CloseOnTimeout, const KComponentData& componentData = KComponentData());
|
|
static KNotification* event (KNotification::StandardEvent eventId, const QString& title, const QString& text, const QPixmap& pixmap = QPixmap(), QWidget* widget = 0, const KNotification::NotificationFlags& flags = KNotification::CloseOnTimeout);
|
|
};
|
|
// KNotification
|
|
|
|
|