blob: 4e586efac4705e09fc1290ca95416fa99eac3a9b (
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/***************************************************************************
trayicon.h - description
-------------------
begin : Tue Dec 11 2001
copyright : (C) 2001-2002 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef TRAYICON_H
#define TRAYICON_H
#include "configuration.h"
#include <qwidget.h>
#include <kpixmap.h>
#include <kaction.h>
#include <ksystemtray.h>
#include <kpassivepopup.h>
class KDialog;
class KPassivePopup2 : public KPassivePopup {
Q_OBJECT
public:
KPassivePopup2(QWidget *parent);
static KPassivePopup2 *message( const QString &caption, const QString &text,
const QPixmap &icon,
QWidget *parent);
signals:
void hidden();
protected:
/**
* Reimplemented to detect hide events.
*/
virtual void hideEvent( QHideEvent *e );
};
/**
* Implements the trayicon.
* @author Tim Jansen
*/
class TrayIcon : public KSystemTray {
Q_OBJECT
public:
TrayIcon(KDialog*, Configuration*);
~TrayIcon();
signals:
void showManageInvitations();
void diconnectedMessageDisplayed();
void enableDesktopControl(bool);
public slots:
void prepareQuit();
void showConnectedMessage(QString host);
void showDisconnectedMessage();
void setDesktopControlSetting(bool);
protected:
void mousePressEvent(QMouseEvent *e);
private:
KPixmap trayIconOpen;
KPixmap trayIconClosed;
Configuration *configuration;
KDialog* aboutDialog;
KActionCollection actionCollection;
KAction* manageInvitationsAction;
KAction* aboutAction;
KToggleAction* enableControlAction;
bool quitting;
private slots:
void showAbout();
};
#endif
|