forked from unruhschuh/MrWriter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
markdownselection.h
50 lines (37 loc) · 873 Bytes
/
markdownselection.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
#ifndef MARKDOWNSELECTION_H
#define MARKDOWNSELECTION_H
#include<QPainter>
#include<QRect>
#include<QString>
#include<QTextDocument>
#include<tuple>
#include "page.h"
namespace MrDoc {
class MarkdownSelection {
public:
enum class GrabZone{
None,
Move,
Top,
Bottom,
Left,
Right,
TopLeft,
TopRight,
BottomLeft,
BottomRight
};
MarkdownSelection(std::tuple<QRectF, QString> markdown);
void setPageNum(int pageNum);
int pageNum() const;
const QString& text() const;
const QRectF& boundingRect() const;
void moveTo(QPointF newPos, QPointF delta, int pageNum);
void paint(QPainter& painter, qreal zoom);
GrabZone grabZone(QPointF pagePos);
private:
std::tuple<QRectF, QString> m_markdown;
int m_pageNum;
};
}
#endif // MARKDOWNSELECTION_H