summaryrefslogtreecommitdiffstats
path: root/src/kvilib/tal/kvi_tal_listbox_qt3.h
blob: 339ef913321148e3aeca3abb3294f6908e76df7e (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#ifndef _KVI_TAL_LISTBOX_QT3_H_
#define _KVI_TAL_LISTBOX_QT3_H_

//=============================================================================
//
//   File : kvi_tal_listbox_qt3.h
//   Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
//
//   This file is part of the KVirc irc client distribution
//   Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
//
//   This program is FREE software. You can redistribute it and/or
//   modify it under the terms of the GNU General Public License
//   as published by the Free Software Foundation; either version 2
//   of the License, or (at your opinion) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//=============================================================================

#include "kvi_settings.h"
#include "kvi_qstring.h"
#include <tqlistbox.h>

class KviTalListBoxItem;

class KVILIB_API KviTalListBox : public TQListBox
{
	TQ_OBJECT
  
public:
	KviTalListBox(TQWidget * pParent,TQt::WFlags f = 0);
	virtual ~KviTalListBox() {};
public:
	KviTalListBoxItem * firstItem() const { return (KviTalListBoxItem *)TQListBox::firstItem(); };
	KviTalListBoxItem * selectedItem() const { return (KviTalListBoxItem *)TQListBox::selectedItem(); };
	KviTalListBoxItem * item(int iIndex) const { return (KviTalListBoxItem *)TQListBox::item(iIndex); };
signals:
	void highlighted(KviTalListBoxItem *);
	void selected(KviTalListBoxItem *);
	void selectionChanged(KviTalListBoxItem * item);
	void currentChanged(KviTalListBoxItem * item);
	void clicked(KviTalListBoxItem * item);
	void clicked(KviTalListBoxItem * item,const TQPoint & pnt);
	void pressed(KviTalListBoxItem * item);
	void pressed(KviTalListBoxItem * item,const TQPoint & pnt);
	void doubleClicked(KviTalListBoxItem * item);
	void returnPressed(KviTalListBoxItem * item);
	void rightButtonClicked(KviTalListBoxItem *, const TQPoint &);
	void rightButtonPressed(KviTalListBoxItem *, const TQPoint &);
	void mouseButtonPressed(int button,KviTalListBoxItem * item,const TQPoint & pos);
	void mouseButtonClicked(int button,KviTalListBoxItem * item,const TQPoint & pos);
	void contextMenuRequested(KviTalListBoxItem * item,const TQPoint & pos);
	void onItem(KviTalListBoxItem * i);
protected slots:
	void redirect_highlighted(TQListBoxItem *item);
	void redirect_selected(TQListBoxItem *item);
	void redirect_selectionChanged(TQListBoxItem * item);
	void redirect_currentChanged(TQListBoxItem * item);
	void redirect_clicked(TQListBoxItem * item);
	void redirect_clicked(TQListBoxItem * item,const TQPoint & pnt);
	void redirect_pressed(TQListBoxItem * item);
	void redirect_pressed(TQListBoxItem * item,const TQPoint & pnt);
	void redirect_doubleClicked(TQListBoxItem * item);
	void redirect_returnPressed(TQListBoxItem * item);
	void redirect_rightButtonClicked(TQListBoxItem * item, const TQPoint &pnt);
	void redirect_rightButtonPressed(TQListBoxItem * item, const TQPoint &pnt);
	void redirect_mouseButtonPressed(int button,TQListBoxItem * item,const TQPoint & pos);
	void redirect_mouseButtonClicked(int button,TQListBoxItem * item,const TQPoint & pos);
	void redirect_contextMenuRequested(TQListBoxItem * item,const TQPoint & pos);
	void redirect_onItem(TQListBoxItem * i);
};

class KVILIB_API KviTalListBoxItem : public TQListBoxItem
{
public:
	KviTalListBoxItem()
	: TQListBoxItem() {};
	KviTalListBoxItem(KviTalListBox * pParent)
	: TQListBoxItem(pParent) {};
	KviTalListBoxItem(KviTalListBox * pParent,KviTalListBoxItem * pAfter)
	: TQListBoxItem(pParent,pAfter) {};
	virtual ~KviTalListBoxItem() {};
public:
	KviTalListBoxItem * next() const { return (KviTalListBoxItem *)TQListBoxItem::next(); };
	KviTalListBoxItem * prev() const { return (KviTalListBoxItem *)TQListBoxItem::prev(); };
	KviTalListBox * listBox() const { return (KviTalListBox *)TQListBoxItem::listBox(); };
	virtual int height(const KviTalListBox *) const { return 0; };
	int height(const TQListBox *lb) const { return height((KviTalListBox *)lb); };
	virtual int width(const KviTalListBox *) const { return 0; };
	int width(const TQListBox *lb) const { return width((KviTalListBox *)lb); };
};

class KVILIB_API KviTalListBoxText : public KviTalListBoxItem
{
public:
    KviTalListBoxText( KviTalListBox* listbox, const TQString & text=TQString() );
    KviTalListBoxText( const TQString & text=TQString() );
    KviTalListBoxText( KviTalListBox* listbox, const TQString & text, KviTalListBoxItem *after );
   ~KviTalListBoxText();

    int	 height( const KviTalListBox * ) const;
    int	 width( const KviTalListBox * )  const;

    int rtti() const;
    static int RTTI;

protected:
    virtual void  paint( TQPainter * );

private:	// Disabled copy constructor and operator=
#if defined(TQ_DISABLE_COPY)
    KviTalListBoxText( const KviTalListBoxText & );
    KviTalListBoxText &operator=( const KviTalListBoxText & );
#endif
};


class KVILIB_API KviTalListBoxPixmap : public KviTalListBoxItem
{
public:
    KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap & );
    KviTalListBoxPixmap( const TQPixmap & );
    KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap & pix, KviTalListBoxItem *after );
    KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap &, const TQString& );
    KviTalListBoxPixmap( const TQPixmap &, const TQString& );
    KviTalListBoxPixmap( KviTalListBox* listbox, const TQPixmap & pix, const TQString&, KviTalListBoxItem *after );
   ~KviTalListBoxPixmap();

    const TQPixmap *pixmap() const { return &pm; }

    int	 height( const KviTalListBox * ) const;
    int	 width( const KviTalListBox * )  const;

    int rtti() const;
    static int RTTI;

protected:
    virtual void paint( TQPainter * );

private:
    TQPixmap pm;
private:	// Disabled copy constructor and operator=
#if defined(TQ_DISABLE_COPY)
    KviTalListBoxPixmap( const KviTalListBoxPixmap & );
    KviTalListBoxPixmap &operator=( const KviTalListBoxPixmap & );
#endif
};


#endif // _KVI_TAL_LISTBOX_QT3_H_