summaryrefslogtreecommitdiffstats
path: root/ksirc/topic.h
blob: 73191128d9a05fadf3a5037814d0dceaf072d069 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
/* This file is part of the KDE project
   Copyright (C) 2001 Simon Hausmann <hausmann@kde.org>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the Artistic License.
*/
#ifndef __topic_h__
#define __topic_h__

#include <kactivelabel.h>
#include <qtextedit.h>
#include <qlineedit.h>
#include <qpopupmenu.h>
#include <qguardedptr.h>

class KSircTopicEditor;

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

public slots:
    virtual void setText( const QString &);

signals:
    void topicChange( const QString &newTopic );

protected:
    virtual void contentsMouseDoubleClickEvent( QMouseEvent * );
    virtual void contentsMouseReleaseEvent( QMouseEvent * );
    virtual void fontChange(QFont &);

private slots:
    void setNewTopic();
    void slotEditResized();
    void doResize();

private:


    QGuardedPtr<KSircTopicEditor> m_editor;
    bool m_doEdit;
    int m_height;
    QString m_text;
};

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

signals:
    void resized();

public slots:
    virtual void slotMaybeResize();

protected:
    virtual void keyPressEvent( QKeyEvent *ev );
    virtual void focusOutEvent( QFocusEvent * );
    virtual QPopupMenu *createPopupMenu( const QPoint &pos );

private:
    QGuardedPtr<QPopupMenu> m_popup;
};

#endif