/usr/include/KF5/KNotifications/knotifyconfig.h is in libkf5notifications-dev 5.44.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | /*
Copyright (C) 2005-2009 by Olivier Goffart <ogoffart at kde.org>
This library 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) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KNOTIFYCONFIG_H
#define KNOTIFYCONFIG_H
#include <ksharedconfig.h>
#include <QPair>
#include <QPixmap>
#include <QObject> //for Wid
#include "knotifications_export.h"
typedef QList< QPair<QString,QString> > ContextList;
/**
* @class KNotifyImage knotifyconfig.h KNotifyConfig
*
* An image with lazy loading from the byte array
*/
class KNOTIFICATIONS_EXPORT KNotifyImage
{
public:
KNotifyImage() : dirty(false) {}
KNotifyImage(const QByteArray &data) : source(data), dirty(true) {}
QImage toImage();
bool isNull() {
return dirty ? source.isEmpty() : image.isNull();
}
QByteArray data() const {
return source;
}
private:
QByteArray source;
QImage image;
bool dirty;
};
/**
* @class KNotifyConfig knotifyconfig.h KNotifyConfig
*
* Represent the configuration for an event
* @author Olivier Goffart <ogoffart@kde.org>
*/
class KNOTIFICATIONS_EXPORT KNotifyConfig
{
public:
KNotifyConfig(const QString &appname, const ContextList &_contexts , const QString &_eventid);
~KNotifyConfig();
KNotifyConfig *copy() const;
/**
* @return entry from the knotifyrc file
*
* This will return the configuration from the user for the given key.
* It first look into the user config file, and then in the global config file.
*
* return a null string if the entry doesn't exist
*/
QString readEntry(const QString &entry , bool path = false);
/**
* the pixmap to put on the notification
*/
KNotifyImage image;
/**
* the name of the application that triggered the notification
*/
QString appname;
/**
* @internal
*/
KSharedConfig::Ptr eventsfile,configfile;
ContextList contexts;
/**
* the name of the notification
*/
QString eventid;
/**
* reparse the cached configs. to be used when the config may have changed
*/
static void reparseConfiguration();
static void reparseSingleConfiguration(const QString &app);
};
#endif
|