File: textvw.h

package info (click to toggle)
kdbg 1.2.4-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,504 kB
  • ctags: 1,945
  • sloc: cpp: 15,961; sh: 8,183; makefile: 481; perl: 71; ansic: 16
file content (54 lines) | stat: -rw-r--r-- 1,460 bytes parent folder | download
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
// $Id: textvw.h,v 1.9.2.1 2001/12/28 21:10:28 jsixt Exp $

// Copyright by Johannes Sixt
// This file is under GPL, the GNU General Public Licence

#ifndef TEXTVW_H
#define TEXTVW_H

#include "tableview.h"
#include "valarray.h"

class KTextView : public TableView
{
    Q_OBJECT
public:
    KTextView(QWidget* parent = 0, const char* name = 0, WFlags f = 0);
    ~KTextView();
    void insertLine(const QString& text);
    void replaceLine(int line, const QString& text);
    virtual void setCursorPosition(int row, int col);
    virtual void cursorPosition(int* row, int* col);
protected:
    virtual int cellWidth(int col) const;
    virtual int cellHeight(int row) const;
    virtual void paintCell(QPainter* p, int row, int col);
    virtual void activateLine(int row);
    virtual int textCol() const;
    virtual bool updateCellSize(const QString& text);
    virtual void setupPainter(QPainter* p);

signals:
    void lineChanged();

public slots:
    void setTabWidth(int numChars);

    // event handling
protected:
    virtual void keyPressEvent(QKeyEvent* ev);
    virtual void mousePressEvent(QMouseEvent* ev);
    virtual void focusInEvent(QFocusEvent* ev);
    virtual void focusOutEvent(QFocusEvent* ev);

    void paletteChange(const QPalette& oldPal);

    int m_width;
    int m_height;			/* line height */
    int m_tabWidth;			/* in pixels */

    ValArray<QString> m_texts;
    int m_curRow;			/* cursor position */
};

#endif // TEXTVW_H