1 /* 2 SPDX-License-Identifier: GPL-2.0-or-later 3 4 SPDX-FileCopyrightText: 2002 Dario Abatianni <eisfuchs@tigress.com> 5 SPDX-FileCopyrightText: 2007 Peter Simonsson <peter.simonsson@gmail.com> 6 */ 7 8 #ifndef NICK_H 9 #define NICK_H 10 11 #include "channelnick.h" 12 13 #include <QTreeWidgetItem> 14 15 class NickListView; 16 class Channel; 17 18 class Nick : public QTreeWidgetItem 19 { 20 public: 21 enum Columns { 22 NicknameColumn = 0, 23 HostmaskColumn = 1 24 }; 25 26 public: 27 Nick(NickListView *listView, Channel* channel, 28 const ChannelNickPtr& channelnick); 29 ~Nick() override; 30 31 ChannelNickPtr getChannelNick() const; 32 33 QVariant data(int column, int role) const override; 34 bool operator<(const QTreeWidgetItem& other) const override; 35 36 void refresh(); 37 void repositionMe(); 38 39 private: 40 QString calculateLabel1() const; 41 QString calculateLabel2() const; 42 43 int getSortingValue() const; 44 45 private: 46 ChannelNickPtr m_channelnickptr; 47 Channel* m_channel; 48 49 int m_flags; 50 51 Q_DISABLE_COPY(Nick) 52 }; 53 #endif 54