summaryrefslogtreecommitdiffstats
path: root/malloryclient/mallorybutton.h
blob: 69c21d913915c4c5e6815f7e1dc1f2aa2dbb7be2 (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
//
// C++ Interface: mallorybutton
//
// Description:
//
//
// Author: Remi Villatel <maxilys@tele2.fr>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef MALLORYBUTTON_H
#define MALLORYBUTTON_H

#include <tqbutton.h>

#include "malloryclient.h"
#include "enums.h"

class MalloryClient;

class MalloryButton : public TQButton
{
TQ_OBJECT
public:
	MalloryButton(MalloryClient *parent = 0, const char *name = 0, const TQString &tip=NULL, ButtonType type = (ButtonType)0);
	~MalloryButton();

	void setTipText(const TQString &tip);

	void setOnAllDesktops(bool oad)	{ isOnAllDesktops = oad; repaint(false); }
	void setMaximized(bool max) { isMaximized = max; repaint(false); }
	TQSize sizeHint() const;
	int lastMousePress() const { return m_lastMouse; }
	void reset() { repaint(false); }
	MalloryClient* client() { return m_client; }

private:
	void enterEvent(TQEvent *e);
	void leaveEvent(TQEvent *e);
	void mousePressEvent(TQMouseEvent *e);
	void mouseReleaseEvent(TQMouseEvent *e);
	void drawButton(TQPainter *painter);

	MalloryClient *m_client;
	int m_lastMouse;
	ButtonType m_type;
	bool hover;
	bool isOnAllDesktops, isMaximized;
};

#endif