diff options
Diffstat (limited to 'utils/wpseditor/gui/src/numberedtextview.h')
-rw-r--r-- | utils/wpseditor/gui/src/numberedtextview.h | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/utils/wpseditor/gui/src/numberedtextview.h b/utils/wpseditor/gui/src/numberedtextview.h deleted file mode 100644 index 2a0d1de068..0000000000 --- a/utils/wpseditor/gui/src/numberedtextview.h +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | /* This file is part of the KDE libraries | ||
2 | Copyright (C) 2005, 2006 KJSEmbed Authors | ||
3 | See included AUTHORS file. | ||
4 | |||
5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Library General Public | ||
7 | License as published by the Free Software Foundation; either | ||
8 | version 2 of the License, or (at your option) any later version. | ||
9 | |||
10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Library General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Library General Public License | ||
16 | along with this library; see the file COPYING.LIB. If not, write to | ||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | |||
20 | -------------------------------------------------------------------------------------- | ||
21 | Imported into the WPS editor and simplified by Dominik Wenger | ||
22 | |||
23 | */ | ||
24 | |||
25 | |||
26 | #ifndef NUMBERED_TEXT_VIEW_H | ||
27 | #define NUMBERED_TEXT_VIEW_H | ||
28 | |||
29 | #include <QFrame> | ||
30 | #include <QPixmap> | ||
31 | #include <QTextCursor> | ||
32 | |||
33 | class QTextEdit; | ||
34 | class QHBoxLayout; | ||
35 | |||
36 | // Shows the Line numbers | ||
37 | class NumberBar : public QWidget | ||
38 | { | ||
39 | Q_OBJECT | ||
40 | |||
41 | public: | ||
42 | NumberBar( QWidget *parent ); | ||
43 | ~NumberBar(); | ||
44 | |||
45 | void markLine( int lineno ); | ||
46 | |||
47 | void setTextEdit( QTextEdit *edit ); | ||
48 | void paintEvent( QPaintEvent *ev ); | ||
49 | |||
50 | private: | ||
51 | QTextEdit *edit; | ||
52 | QPixmap markerIcon; | ||
53 | int markedLine; | ||
54 | QRect markedRect; | ||
55 | }; | ||
56 | |||
57 | // Shows a QTextEdit with Line numbers | ||
58 | class NumberedTextView : public QFrame | ||
59 | { | ||
60 | Q_OBJECT | ||
61 | |||
62 | public: | ||
63 | NumberedTextView( QWidget *parent = 0 ); | ||
64 | ~NumberedTextView(); | ||
65 | |||
66 | /** Returns the QTextEdit of the main view. */ | ||
67 | QTextEdit *textEdit() const { return view; } | ||
68 | |||
69 | /* marks the line with a icon */ | ||
70 | void markLine( int lineno ); | ||
71 | |||
72 | void scrolltoLine( int lineno ); | ||
73 | |||
74 | private slots: | ||
75 | void textChanged( int pos, int removed, int added ); | ||
76 | |||
77 | private: | ||
78 | QTextEdit *view; | ||
79 | NumberBar *numbers; | ||
80 | QHBoxLayout *box; | ||
81 | QTextCursor highlight; | ||
82 | int markedLine; | ||
83 | }; | ||
84 | |||
85 | |||
86 | #endif // NUMBERED_TEXT_VIEW_H | ||
87 | |||