/*
  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 option) any later version.
*/

/*
  begin:     Fri Jan 25 2002
  copyright: (C) 2002 by Dario Abatianni
             (C) 2007 Peter Simonsson <peter.simonsson@gmail.com>
  email:     eisfuchs@tigress.com
*/

#ifndef NICK_H
#define NICK_H

#include <tqobject.h>
#include <tdelistview.h>

#include "channelnick.h"

class Nick : public TQObject, public TDEListViewItem
{
    TQ_OBJECT
  
    public:
        Nick(TDEListView *listView,
            const ChannelNickPtr& channelnick);
        ~Nick();

        ChannelNickPtr getChannelNick() const;
        int getSortingValue() const;

        virtual void paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align);
        virtual int compare(TQListViewItem* item,int col,bool ascending) const;

    public slots:
        void refresh();

    signals:
        void refreshed();

    protected:
        TQString calculateLabel1();
        TQString calculateLabel2();

    protected:
        ChannelNickPtr m_channelnickptr;

        TQString label;
        int m_height;
        int m_flags;
        bool m_away;
};
#endif
