-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtextview.h
94 lines (76 loc) · 2.17 KB
/
textview.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef __TEXT_VIEW_H__
#define __TEXT_VIEW_H__
/**
* Text viewer class.
* vim:ts=8:sw=2
*/
#include <qwidget.h>
#include "formatter.h"
#include "timestamp.h"
#include "baseview.h"
#include <qwmatrix.h>
#include <qpixmap.h>
#include <qtimer.h>
class TParser;
class AskDialog;
/**
* Text Viewing Class.
* Widget for text area. It will use Formatter for text draw.
*/
class TextView : public BaseView
{
Q_OBJECT
public slots:
void nextStep(); /* for autoscroll */
private:
void paintEvent(QPaintEvent *ev);
void resizeEvent(QResizeEvent *ev);
void cleanLineDB();
void updateSize();
void drawProgressBar(QRect &area, QPainter &dc);
void drawBattery(QRect &area, QPainter &dc);
void setParserAndLocation(TParser *ps, int para=0, int offset=0);
void getParagraph(int ¶, int &offset);
void setRotation(int deg);
void drawClock(QRect &area, QPainter &dc);
void setParagraph(int paragraph, int idx);
public:
void setSlideShowMode(int mode);
void loadConfig();
void setParagraph(int para);
int getParaCount();
bool getDocumentLocation(int ¶, int &offset);
bool hasDocument();
bool setDocument(QString filename, int parser_id, int encoding_id,
int para, int offset);
void resetDocument();
bool canSearch();
void search(QString key, int flags);
void nextPage();
void prevPage();
void rotateRight();
void rotateLeft();
int getRotation();
void mousePressEvent(QMouseEvent *ev);
void mouseReleaseEvent(QMouseEvent *ev);
void mouseMoveEvent(QMouseEvent *ev);
TextView(QWidget *parent=NULL, const char *name=NULL, WFlags f=0);
private:
Formatter m_fmt;
TParser *m_parser;
QFont m_font;
QColor m_fg;
QColor m_colors[9];
int m_margin;
int m_pb, m_pbHeight, m_pbLength;
QFont m_pbFont;
QColor m_pbColor1, m_pbColor2, m_pbText;
int m_rotation;
int m_pWidth, m_pHeight;
QWMatrix m_matrix;
QPixmap m_orgBuffer, m_rotBuffer;
bool m_rebuild;
QTimer m_timer;
int m_scrollDelay, m_scrollHeight;
};
#endif