• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

KNotify

  • sources
  • kde-4.14
  • kde-runtime
  • knotify
notifybypopup.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2005-2006 by Olivier Goffart <ogoffart at kde.org>
3  Copyright (C) 2008 by Dmitry Suzdalev <dimsuz@gmail.com>
4 
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  */
21 
22 #ifndef NOTIFYBYPOPUP_H
23 #define NOTIFYBYPOPUP_H
24 
25 #include "knotifyplugin.h"
26 #include <QMap>
27 #include <QHash>
28 #include <QStringList>
29 #include <QXmlStreamEntityResolver>
30 
31 class KPassivePopup;
32 
33 class NotifyByPopup : public KNotifyPlugin
34 { Q_OBJECT
35  public:
36  NotifyByPopup(QObject *parent=0l);
37  virtual ~NotifyByPopup();
38 
39  virtual QString optionName() { return "Popup"; }
40  virtual void notify(int id , KNotifyConfig *config);
41  virtual void close( int id );
42  virtual void update(int id, KNotifyConfig *config);
43 
44  QStringList popupServerCapabilities();
45 
46  private:
47  QMap<int, KPassivePopup * > m_popups;
48  // the y coordinate of the next position popup should appears
49  int m_nextPosition;
50  int m_animationTimer;
51  void fillPopup(KPassivePopup *,int id,KNotifyConfig *config);
58  KNotifyConfig *ensurePopupCompatibility( const KNotifyConfig *config );
65  QString stripHtml( const QString &text );
74  bool sendNotificationDBus(int id, int replacesId, KNotifyConfig* config);
79  void closeNotificationDBus(int id);
83  bool m_dbusServiceExists;
89  QStringList m_dbusServiceCapabilities;
93  bool m_dbusServiceCapCacheDirty;
97  void getAppCaptionAndIconName(KNotifyConfig *config, QString *appCaption, QString *iconName);
98 
99  protected:
100  void timerEvent(QTimerEvent *event);
101 
102  private Q_SLOTS:
103  void slotPopupDestroyed();
104  void slotLinkClicked(const QString & );
105  // slot to catch appearance or dissapearance of Notifications DBus service
106  void slotServiceOwnerChanged(const QString &, const QString &, const QString &);
107  // slot which gets called when DBus signals that some notification action was invoked
108  void slotDBusNotificationActionInvoked(uint, const QString&);
109  // slot which gets called when DBus signals that some notification was closed
110  void slotDBusNotificationClosed(uint, uint);
111 
112  private:
116  QHash<int,uint> m_idMap;
117 
122  class HtmlEntityResolver : public QXmlStreamEntityResolver
123  {
124  QString resolveUndeclaredEntity( const QString &name );
125  };
126 };
127 
128 #endif
NotifyByPopup::~NotifyByPopup
virtual ~NotifyByPopup()
Definition: notifybypopup.cpp:101
QMap< int, KPassivePopup * >
KNotifyPlugin
abstract class for KNotify actions
Definition: knotifyplugin.h:44
QObject::event
virtual bool event(QEvent *e)
QTimerEvent
QObject::name
const char * name() const
knotifyplugin.h
QHash< int, uint >
QObject
NotifyByPopup::NotifyByPopup
NotifyByPopup(QObject *parent=0l)
Definition: notifybypopup.cpp:50
QString
QStringList
NotifyByPopup::update
virtual void update(int id, KNotifyConfig *config)
This function is called when the notification has changed (such as the text or the icon) ...
Definition: notifybypopup.cpp:235
NotifyByPopup::optionName
virtual QString optionName()
return the name of this plugin.
Definition: notifybypopup.h:39
NotifyByPopup
Definition: notifybypopup.h:33
NotifyByPopup::timerEvent
void timerEvent(QTimerEvent *event)
Definition: notifybypopup.cpp:184
NotifyByPopup::notify
virtual void notify(int id, KNotifyConfig *config)
This function is called when the notification is sent.
Definition: notifybypopup.cpp:107
NotifyByPopup::close
virtual void close(int id)
This function is called when the notification has been closed.
Definition: notifybypopup.cpp:225
NotifyByPopup::popupServerCapabilities
QStringList popupServerCapabilities()
Definition: notifybypopup.cpp:519
QObject::parent
QObject * parent() const
KNotifyConfig
Represent the configuration for an event.
Definition: knotifyconfig.h:60
QXmlStreamEntityResolver
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNotify

Skip menu "KNotify"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal