exec_notify.h 2.05 KB
Newer Older
1 2
/*
 * %kadu copyright begin%
Rafał Malinowski's avatar
Rafał Malinowski committed
3
 * Copyright 2009, 2010, 2011 Piotr Galiszewski (piotr.galiszewski@kadu.im)
4 5
 * Copyright 2009 Wojciech Treter (juzefwt@gmail.com)
 * Copyright 2008 Tomasz Rostański (rozteck@interia.pl)
Rafał Malinowski's avatar
Rafał Malinowski committed
6 7 8
 * Copyright 2008 Michał Podsiadlik (michal@kadu.net)
 * Copyright 2007, 2008, 2010, 2011 Rafał Malinowski (rafal.przemyslaw.malinowski@gmail.com)
 * Copyright 2011 Bartosz Brachaczek (b.brachaczek@gmail.com)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 * %kadu copyright end%
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program 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/>.
 */
24 25 26 27

#ifndef EXEC_NOTIFY_H
#define EXEC_NOTIFY_H

28
#include <QtCore/QMap>
Rafał Malinowski's avatar
Rafał Malinowski committed
29
#include <QtCore/QObject>
30 31
#include <QtCore/QStringList>

32 33 34 35
#include "gui/widgets/configuration/notifier-configuration-widget.h"

#include "notify/notifier.h"

36 37 38 39 40 41 42 43 44 45

class QLineEdit;

class ExecConfigurationWidget : public NotifierConfigurationWidget
{
	Q_OBJECT

	QString currentNotifyEvent;
	QMap<QString, QString> Commands;

46
	QLineEdit *commandLineEdit;
47 48

public:
49
	ExecConfigurationWidget(QWidget *parent = 0);
50 51 52 53 54 55 56 57 58 59 60
	virtual ~ExecConfigurationWidget();

	virtual void loadNotifyConfigurations() {}
	virtual void saveNotifyConfigurations();
	virtual void switchToEvent(const QString &event);
};

class ExecNotify : public Notifier
{
	Q_OBJECT

61 62
	void createDefaultConfiguration();

63 64
	void run(const QStringList &args);

65
public:
66
	ExecNotify(QObject *parent = 0);
67 68
	~ExecNotify();

69
	virtual NotifierConfigurationWidget *createConfigurationWidget(QWidget *parent = 0);
70 71 72 73 74
	virtual void notify(Notification *notification);

};

#endif // EXEC_NOTIFY_H