summaryrefslogtreecommitdiffstats
path: root/ksirc/ahistlineedit.h
blob: a273791fb42166ca43be32249d41353d9cfb8eb1 (plain)
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
#ifndef AHISTLINEEDIT_H
#define AHISTLINEEDIT_H

#include <qtextedit.h>
#include <qstringlist.h>
#include <qsize.h>

class aHistLineEdit : public QTextEdit
{
Q_OBJECT
public:
    aHistLineEdit(QWidget *parent = 0, const char *name = 0);

    int cursorPosition () const;
    void setCursorPosition(int);

    QString text() const;

signals:
    // Don't use returnPressed from the textEdit
    void gotReturnPressed();
    void gotFocus();
    void lostFocus();
    void pasteText(const QString&);
    void notTab();
    void resized();

public slots:
    virtual void paste();
    virtual void slotMaybeResize();

protected:
    bool processKeyEvent( QKeyEvent * );
    virtual void keyPressEvent ( QKeyEvent * );
    virtual void focusInEvent ( QFocusEvent * );
    virtual void focusOutEvent ( QFocusEvent * );
//    virtual void mousePressEvent ( QMouseEvent * );

    virtual bool eventFilter( QObject *o, QEvent *e );

    virtual void paintEvent ( QPaintEvent * );

private:

    void doEnterKey();

    QStringList hist;
    QStringList::Iterator current;
    void ColourPickerPopUp();
    int m_height;

    bool m_drawrect;

};

#endif