summaryrefslogtreecommitdiffstats
path: root/ksirc/mditoplevel.h
blob: c0f1c010ee4d6b7d04870fff0fd171d30a9f00ab (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
71
72
73
74
75
#ifndef __mditoplevel_h__
#define __mditoplevel_h__

#include <tqptrlist.h>
#include <tqtabwidget.h>

#include <kmainwindow.h>

class KSTabWidget : public QTabWidget
{
    Q_OBJECT
public:
    KSTabWidget ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )
	: TQTabWidget(parent, name, f)
    {
    }

protected:
    virtual void mousePressEvent(TQMouseEvent *e);

signals:
    void showContexMenu(TQWidget *, const TQPoint &);

};

class QLabel;
class KPopupMenu;

class MDITopLevel : public KMainWindow
{
    Q_OBJECT
public:
    MDITopLevel(TQWidget *parent = 0, const char *name = 0);
    virtual ~MDITopLevel();

    void addWidget( TQWidget *widget, bool show );

    void removeWidget( TQWidget *widget );

    TQTabWidget *tabWidget() const { return m_tab; }
	void next();
	void previous();

    TQPtrList<TQWidget> &widgets() { return m_tabWidgets; }

    void hideWidget( TQWidget *widget );
    void showWidget( TQWidget *widget );

    virtual bool eventFilter( TQObject *obj, TQEvent *ev );
    bool closing() const { return m_closing; }

protected:
    void removeFromAddressedList( const TQWidget* w );
    virtual void closeEvent( TQCloseEvent *ev );

private slots:
    void slotWidgetDestroyed();
    void slotCurrentChanged( TQWidget *page );
    void slotMarkPageDirty( bool );
    void slotChangeChannelName( const TQString &, const TQString &newName );
    void slotShowContexMenu(TQWidget *, const TQPoint &);
    void slotCloseLastWid();

private:
    KSTabWidget *m_tab;
    KPopupMenu *m_pop;
    TQWidget *m_last_pop_wid;
    TQPtrList<TQWidget> m_tabWidgets;
    TQPtrList<TQWidget> m_addressed;
    TQPixmap m_dirtyIcon;
    TQPixmap m_addressedIcon;
    bool m_closing;
};

#endif