| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_ABSTRACTSNIPPINGAREAINFOTEXT_H |
| 21 |
#define KSNIP_ABSTRACTSNIPPINGAREAINFOTEXT_H |
| 22 |
|
| 23 |
#include <QObject> |
| 24 |
#include <QPainter> |
| 25 |
|
| 26 |
class AbstractSnippingAreaInfoText : public QObject |
| 27 |
{ |
| 28 |
Q_OBJECT |
| 29 |
public: |
| 30 |
explicit AbstractSnippingAreaInfoText(QObject *parent); |
| 31 |
~AbstractSnippingAreaInfoText() override; |
| 32 |
virtual void paint(QPainter *painter); |
| 33 |
virtual void handleMouseMove(const QPointF &pos); |
| 34 |
virtual void activate(const QRectF &snippingAreaGeometry); |
| 35 |
virtual void deactivate(); |
| 36 |
|
| 37 |
protected: |
| 38 |
virtual void updateInfoText() = 0; |
| 39 |
void setInfoText(const QStringList &infoTextLines); |
| 40 |
|
| 41 |
private: |
| 42 |
QPen *mRectPen; |
| 43 |
QBrush *mRectBrush; |
| 44 |
QString mInfoText; |
| 45 |
QSize *mBaseInfoTextRectSize; |
| 46 |
QPointF mCurrentMousePos; |
| 47 |
bool mIsActive; |
| 48 |
QRectF mSnippingAreaGeometry; |
| 49 |
QPoint mRectOffset; |
| 50 |
}; |
| 51 |
|
| 52 |
|
| 53 |
#endif |