summaryrefslogtreecommitdiffstats
path: root/krfb/krfb/trayicon.h
blob: 134f883dfb541d509d01cd785a20ddf189dedb77 (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
91
92
/***************************************************************************
                          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 <tqwidget.h>
#include <kpixmap.h>
#include <tdeaction.h>
#include <ksystemtray.h>
#include <kpassivepopup.h>

class KDialog;

class KPassivePopup2 : public KPassivePopup {
   	Q_OBJECT
  
public: 
        KPassivePopup2(TQWidget *parent);
        static KPassivePopup2 *message( const TQString &caption, const TQString &text,
					const TQPixmap &icon,
					TQWidget *parent);

signals:
	void hidden();

protected:
        /**
         * Reimplemented to detect hide events.
         */
        virtual void hideEvent( TQHideEvent *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(TQString host);
        void showDisconnectedMessage();
	void setDesktopControlSetting(bool);

protected:
	void mousePressEvent(TQMouseEvent *e);

private:

  	KPixmap trayIconOpen;
  	KPixmap trayIconClosed;
	Configuration *configuration;
	KDialog* aboutDialog;
	TDEActionCollection actionCollection;
  	TDEAction* manageInvitationsAction;
  	TDEAction* aboutAction;
	TDEToggleAction* enableControlAction;
	bool quitting;

private slots:
	void showAbout();
};

#endif