summaryrefslogtreecommitdiffstats
path: root/src/gui/osd.h
diff options
context:
space:
mode:
authorLubos Dolezel <lubos@dolezel.info>2015-06-08 23:53:43 +0200
committerLubos Dolezel <lubos@dolezel.info>2015-06-08 23:54:33 +0200
commita12e6ec5597528fe77cbbdd9ac42308c3147f7d5 (patch)
treeddd98b192a0624c9f53dd55542ae0ab2bc90defd /src/gui/osd.h
parentb777beb72c0b5877039da813c29a76b472a40842 (diff)
downloadtwinkle-a12e6ec5597528fe77cbbdd9ac42308c3147f7d5.tar
twinkle-a12e6ec5597528fe77cbbdd9ac42308c3147f7d5.tar.gz
twinkle-a12e6ec5597528fe77cbbdd9ac42308c3147f7d5.tar.lz
twinkle-a12e6ec5597528fe77cbbdd9ac42308c3147f7d5.tar.xz
twinkle-a12e6ec5597528fe77cbbdd9ac42308c3147f7d5.zip
Added OSD with mute and hangup buttons (resolves #10)
Diffstat (limited to 'src/gui/osd.h')
-rw-r--r--src/gui/osd.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/gui/osd.h b/src/gui/osd.h
new file mode 100644
index 0000000..3d26468
--- /dev/null
+++ b/src/gui/osd.h
@@ -0,0 +1,52 @@
+#ifndef OSD_H
+#define OSD_H
+#include <QObject>
+#include <QString>
+#if 0 //QT_VERSION >= 0x050000
+# define OSD_VIEWCLASS QQuickView
+# define QML_ITEMTYPE QQuickItem
+#else
+# define OSD_VIEWCLASS QDeclarativeView
+# define QML_ITEMTYPE QDeclarativeItem
+#endif
+
+// Must use forward declaration, otherwise build fails
+// due to double QMetaTypeID<QAction*> definition (wtf).
+// Hence I also cannot inherit from OSD_VIEWCLASS...
+class OSD_VIEWCLASS;
+class QML_ITEMTYPE;
+
+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(); }
+
+public slots:
+ void onHangupClicked();
+ void onMuteClicked();
+
+signals:
+ void hangupClicked();
+ void muteClicked();
+
+private:
+ OSD_VIEWCLASS* m_view;
+ QML_ITEMTYPE* m_caller;
+ QML_ITEMTYPE* m_time;
+ QML_ITEMTYPE* m_mute;
+};
+
+#endif // OSD_H