3 // Copyright by Johannes Sixt
4 // This file is under GPL, the GNU General Public Licence
12 class KTextView
: public TableView
16 KTextView(QWidget
* parent
= 0, const char* name
= 0, WFlags f
= 0);
18 void insertLine(const QString
& text
);
19 void replaceLine(int line
, const QString
& text
);
20 virtual void setCursorPosition(int row
, int col
);
21 virtual void cursorPosition(int* row
, int* col
);
22 void setText(const QString
& t
);
23 const QString
& text(int i
) const { return m_texts
[i
]; }
24 int paragraphs() const { return m_texts
.size(); }
25 void insertParagraph(const QString
& text
, int row
);
26 void removeParagraph(int row
);
27 int charAt(const QPoint
& p
, int* para
);
29 virtual int cellWidth(int col
) const;
30 virtual int cellHeight(int row
) const;
31 virtual void paintCell(QPainter
* p
, int row
, int col
);
32 virtual void activateLine(int row
);
33 virtual int textCol() const;
34 virtual bool updateCellSize(const QString
& text
);
35 virtual void setupPainter(QPainter
* p
);
41 void setTabWidth(int numChars
);
45 virtual void keyPressEvent(QKeyEvent
* ev
);
46 virtual void mousePressEvent(QMouseEvent
* ev
);
47 virtual void focusInEvent(QFocusEvent
* ev
);
48 virtual void focusOutEvent(QFocusEvent
* ev
);
50 void paletteChange(const QPalette
& oldPal
);
53 int m_height
; /* line height */
54 int m_tabWidth
; /* in pixels */
56 int m_curRow
; /* cursor position */
58 std::vector
<QString
> m_texts
;