7 #include <QDragMoveEvent>
11 class nickListItem
: public Q3ListBoxItem
15 nickListItem(const nickListItem
&old
);
16 virtual ~nickListItem();
18 virtual int height ( const Q3ListBox
* ) const;
19 virtual int width ( const Q3ListBox
* ) const;
20 QString
text () const { return string
; }
21 const QPixmap
* pixmap () const;
23 bool op() const { return is_op
; }
24 bool voice() const { return is_voice
; }
25 bool away() const { return is_away
; }
26 bool ircOp() const { return is_ircop
; }
28 void setOp(bool _op
= FALSE
);
29 void setVoice(bool _voice
= FALSE
);
30 void setAway(bool _away
= FALSE
);
31 void setIrcOp(bool _ircop
= FALSE
);
33 void setText(const QString
&str
) { string
= str
; }
35 QString
nickPrefix() const;
37 void forceColour(const QColor
*col
);
39 nickListItem
&operator= ( const nickListItem
& nli
);
42 virtual void paint ( QPainter
* );
51 const QColor
*forcedCol
;
54 class aListBox
: public Q3ListBox
59 aListBox(QWidget
*parent
= 0, const char *name
= 0);
65 void inSort ( nickListItem
*);
66 void inSort ( QString text
, bool top
=FALSE
);
68 nickListItem
*item(int index
);
70 bool isTop(int index
);
72 int findNick(const QString
&str
);
76 bool needNickPrefix() const;
78 void setNickListDirty()
79 { m_nickListDirty
= true; }
81 unsigned short int nickPrefixWidth() const
82 { return m_nickPrefixWidth
; }
84 virtual void fontChange( const QFont
&f
);
86 static QString
nickPrefixOp() { return QString::fromLatin1( "o" ); }
87 static QString
nickPrefixVoice() { return QString::fromLatin1( "v" ); }
88 static QString
nickPrefixAway() { return QString::fromLatin1( "a" ); }
89 static QString
nickPrefixIrcOp() { return QString::fromLatin1( "O" ); }
92 void contextMenuRequested(int index
);
93 void selectedNick(const QString
&);
94 void urlsDropped( const QStringList
& urls
, const QString
& nick
);
95 void textDropped( const Q3ListBoxItem
*item
, const QString
& text
);
98 virtual int findSep();
99 virtual int searchFor(const QString
&nick
, bool &found
, bool top
);
100 virtual void dragMoveEvent( QDragMoveEvent
* );
101 virtual void dropEvent( QDropEvent
* );
104 void reEmitContextMenuRequest( Q3ListBoxItem
*item
);
107 void updateNeedNickPrefixFlag() const;
108 void updateNickPrefixWidth();
111 mutable bool m_nickListDirty
;
112 mutable bool m_needNickPrefix
;
113 int m_nickPrefixWidth
;