• 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
knotifyconfig.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2005-2009 by Olivier Goffart <ogoffart at kde.org>
3 
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2, or (at your option)
8  any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 
19  */
20 
21 #ifndef KNOTIFYCONFIG_H
22 #define KNOTIFYCONFIG_H
23 
24 #include <ksharedconfig.h>
25 
26 #include <QPair>
27 #include <QPixmap>
28 #include <QObject> //for Wid
29 
30 #include "knotify_export.h"
31 
32 typedef QList< QPair<QString,QString> > ContextList;
33 
37 class KNOTIFY_EXPORT KNotifyImage
38 {
39  public:
40  KNotifyImage() : dirty(false) {}
41  KNotifyImage(const QByteArray &data) : source(data), dirty(true) {}
42  QImage toImage();
43  bool isNull() {
44  return dirty ? source.isEmpty() : image.isNull();
45  }
46  QByteArray data() const {
47  return source;
48  }
49  private:
50  QByteArray source;
51  QImage image;
52  bool dirty;
53 };
54 
55 
60 class KNOTIFY_EXPORT KNotifyConfig
61 {
62  public:
63  KNotifyConfig(const QString &appname, const ContextList &_contexts , const QString &_eventid);
64  ~KNotifyConfig();
65 
66  KNotifyConfig *copy() const;
67 
76  QString readEntry(const QString& entry , bool path=false);
77 
81  QString title;
85  QString text;
89  KNotifyImage image;
95  int timeout;
100  WId winId;
104  QStringList actions;
105 
109  QString appname;
110 
114  KSharedConfig::Ptr eventsfile,configfile;
115  ContextList contexts;
116 
120  QString eventid;
121 
125  static void reparseConfiguration();
126 };
127 
128 #endif
KNotifyConfig::eventsfile
KSharedConfig::Ptr eventsfile
Definition: knotifyconfig.h:114
QByteArray
KNotifyConfig::contexts
ContextList contexts
Definition: knotifyconfig.h:115
KNotifyImage::isNull
bool isNull()
Definition: knotifyconfig.h:43
KNotifyImage::KNotifyImage
KNotifyImage()
Definition: knotifyconfig.h:40
KNotifyConfig::timeout
int timeout
How long the notification should be presented (in seconds).
Definition: knotifyconfig.h:95
KNotifyImage::KNotifyImage
KNotifyImage(const QByteArray &data)
Definition: knotifyconfig.h:41
KNotifyImage::data
QByteArray data() const
Definition: knotifyconfig.h:46
KNotifyConfig::text
QString text
the text of the notification
Definition: knotifyconfig.h:85
KNotifyConfig::title
QString title
the title of the notification
Definition: knotifyconfig.h:81
KNotifyImage
An image with lazy loading from the byte array.
Definition: knotifyconfig.h:37
KNotifyConfig::eventid
QString eventid
the name of the notification
Definition: knotifyconfig.h:120
QString
QList
KNotifyConfig::actions
QStringList actions
the user-readable list of action.
Definition: knotifyconfig.h:104
QStringList
ContextList
QList< QPair< QString, QString > > ContextList
Definition: knotifyconfig.h:32
QImage
KNotifyConfig::winId
WId winId
The windowsID of the window that initiated the notification (it is a window in the client) ...
Definition: knotifyconfig.h:100
KNotifyConfig::image
KNotifyImage image
the pixmap to put on the notification
Definition: knotifyconfig.h:89
knotify_export.h
KNotifyConfig::appname
QString appname
the name of the application that triggered the notification
Definition: knotifyconfig.h:109
KNotifyConfig
Represent the configuration for an event.
Definition: knotifyconfig.h:60
KNOTIFY_EXPORT
#define KNOTIFY_EXPORT
Definition: knotify_export.h:32
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