summaryrefslogtreecommitdiffstats
path: root/src/gui/osd.h
blob: a8b78d308152221ea1753a405ad8535b42484b74 (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
#ifndef OSD_H
#define OSD_H
#include <QObject>
#include <QString>

// Must use forward declaration, otherwise build fails
// due to double QMetaTypeID<QAction*> definition (wtf).
// Hence I also cannot inherit from OSD_VIEWCLASS...
class QQuickView;
class QQuickItem;

class OSD : public QObject
{
	Q_OBJECT
public:
	OSD(QObject* parent = 0);
	~OSD();

	void setCaller(const QString& text);
	void setTime(const QString& timeText);
	void setMuted(bool muted);

	void move(int x, int y);
	void show();
	void hide();
	int width() const;
	int height() const;
	void setVisible(bool v) { if (v) show(); else hide(); }

private:
	void positionWindow();
public slots:
	void onHangupClicked();
	void onMuteClicked();
	void saveState();

signals:
	void hangupClicked();
	void muteClicked();

private:
	QQuickView* m_view;
	QQuickItem* m_caller;
	QQuickItem* m_time;
	QQuickItem* m_mute;
};

#endif // OSD_H