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

#include <textedit.h>
#include <tqstringlist.h>
#include <tqsize.h>

class aHistLineEdit : public TQTextEdit
{
Q_OBJECT
  TQ_OBJECT
public:
    aHistLineEdit(TQWidget *parent = 0, const char *name = 0);

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

    TQString text() const;

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

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

protected:
    bool processKeyEvent( TQKeyEvent * );
    virtual void keyPressEvent ( TQKeyEvent * );
    virtual void focusInEvent ( TQFocusEvent * );
    virtual void focusOutEvent ( TQFocusEvent * );
//    virtual void mousePressEvent ( TQMouseEvent * );

    virtual bool eventFilter( TQObject *o, TQEvent *e );

    virtual void paintEvent ( TQPaintEvent * );

private:

    void doEnterKey();

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

    bool m_drawrect;

};

#endif