summaryrefslogtreecommitdiffstats
path: root/src/daemon/NotifyWidget.h
blob: 08a2f9e17f967380111f674f2ee3e9542fb6c050 (plain)
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
/*
 * NotifyWidget.h
 *
 * Copyright (C) 2021  Emanoil Kotsev <[email protected]>
 *
 *
 *  This file is part of kdbusnotification.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.
 *
 * 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#ifndef SRC_DAEMON_NOTIFYWIDGET_H_
#define SRC_DAEMON_NOTIFYWIDGET_H_

#include <tqlabel.h>
#include <tqtextedit.h>
#include <tqdbusvariant.h>

class NotificationsService;

class NotifyWidget: public TQLabel
{
    TQ_OBJECT

public:
    NotifyWidget(TQWidget *parent=0, const char *name=0, NotificationsService *ns=0, TQ_INT32 id=0 );
    virtual ~NotifyWidget();

    void setAutoMask(bool b);

    bool setIcon(const TQString& icon);
    void setActions(const TQStringList& actions);
    void setHints(const TQMap< TQString, TQT_DBusVariant >& hints);
    void setTimeout(TQ_INT32 t);

protected:
    void mousePressEvent( TQMouseEvent *);

private slots:
    void timeout();
    void fadeAway();

private:
    NotificationsService *notificationService;
    TQPoint mPosition;
    TQString mName;
    TQ_INT32 mId;
    TQString mIcon;
    TQStringList mActions;
    TQMap< TQString, TQT_DBusVariant > mHints;

};

#endif /* SRC_DAEMON_NOTIFYWIDGET_H_ */