forked from h3r3x3/XLCloudClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosd.h
79 lines (63 loc) · 1.49 KB
/
osd.h
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
#ifndef OSD_H
#define OSD_H
#include <QWidget>
#include <QPainter>
#include <QDebug>
#include <QMouseEvent>
#include <QApplication>
#include <QPaintEvent>
#include <QTimer>
#include <QMenu>
#include <QDesktopWidget>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QContextMenuEvent>
#include <QSettings>
class OSD : public QWidget
{
Q_OBJECT
public:
explicit OSD(QWidget *parent = 0);
~OSD();
/*!
* \brief Add a new speed data
* \param speed
*/
void add (const int & speed);
/*!
* \brief Task is suspended!
*/
void clear ();
/*!
* \brief Set maximum speed indicator
* \param maxSpeed
*/
void setMaxSpeedIndicator (const int & maxSpeed);
void setText (const QString & text);
QMenu *osd_menu;
protected:
void dragEnterEvent(QDragEnterEvent *e);
void paintEvent(QPaintEvent *);
void mousePressEvent( QMouseEvent* e );
void mouseReleaseEvent( QMouseEvent* );
void mouseMoveEvent( QMouseEvent* );
void contextMenuEvent(QContextMenuEvent *e);
void mouseDoubleClickEvent(QMouseEvent *);
signals:
void doubleClicked ();
void requestDownload (const QString & url);
private:
bool m_dragging;
QString m_text;
QPoint m_dragOffset;
int m_screen;
QPoint m_position;
bool osd_interr;
static const int s_outerMargin = 15;
QPoint fixupPosition( const QPoint& p );
size_t osd_idx;
int osd_maxSpeed;
int osd_data [15];
public slots:
};
#endif // OSD_H