1 /* This file is part of the KDE libraries
2 Copyright (C) 2005, 2006 KJSEmbed Authors
3 See included AUTHORS file.
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.
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.
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.
20 --------------------------------------------------------------------------------------
21 Imported into the WPS editor and simplified by Dominik Wenger
26 #ifndef NUMBERED_TEXT_VIEW_H
27 #define NUMBERED_TEXT_VIEW_H
31 #include <QTextCursor>
36 // Shows the Line numbers
37 class NumberBar
: public QWidget
42 NumberBar( QWidget
*parent
);
45 void markLine( int lineno
);
47 void setTextEdit( QTextEdit
*edit
);
48 void paintEvent( QPaintEvent
*ev
);
57 // Shows a QTextEdit with Line numbers
58 class NumberedTextView
: public QFrame
63 NumberedTextView( QWidget
*parent
= 0 );
66 /** Returns the QTextEdit of the main view. */
67 QTextEdit
*textEdit() const { return view
; }
69 /* marks the line with a icon */
70 void markLine( int lineno
);
72 void scrolltoLine( int lineno
);
75 void textChanged( int pos
, int removed
, int added
);
81 QTextCursor highlight
;
86 #endif // NUMBERED_TEXT_VIEW_H