summaryrefslogtreecommitdiffstats
path: root/src/daemon/NotifyWidget.cpp
blob: 9fe506b639188377edea268164162fe820d29cb0 (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
66
67
68
69
70
71
72
73
74
75
76
/*
 * NotifyWidget.cpp
 *
 *  Created on: May 14, 2021
 *      Author: emanoil
 *
 * kdbusnotification Copyright (C) 2009 kdbusnotification development team
 *
 * 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
 */

#include <tqtimer.h>

#include "NotifyWidget.h"

NotifyWidget::NotifyWidget( TQWidget *parent, const char *name )
: TQLabel( parent, name , WStyle_Customize | WStyle_Splash), id(TQString(name))
{
    // TODO Auto-generated constructor stub
}

NotifyWidget::~NotifyWidget()
{
    // TODO Auto-generated destructor stub
}

void NotifyWidget::mousePressEvent( TQMouseEvent *e )
{
    this->close();
}

void NotifyWidget::timeout()
{
    this->close();
    //TODO emit NotificationClosed
}

void NotifyWidget::setAutoMask(bool b)
{
    if (b)
        setBackgroundMode( PaletteForeground );
    else
        setBackgroundMode( PaletteBackground );
    TQWidget::setAutoMask(b);
}

void NotifyWidget::setIcon(const TQString& icon) {
    mIcon = icon;
    // TODO handle icon
}

void NotifyWidget::setActions(const TQStringList& actions) {
    mActions = actions;
    // TODO handle actions
}

//void NotifyWidget::setHints(const TQMap< TQString, TQT_DBusVariant >& hints) {
//    mHints = hints;
//}

void NotifyWidget::setTimeout(TQ_INT32 t) {
    TQTimer::singleShot(t, this, TQT_SLOT(timeout()));
}

#include "NotifyWidget.moc"