summaryrefslogtreecommitdiffstats
path: root/konversation/src/nictdelistview.h
blob: a7a2e8f6f61f7a8d06b95164a8e48727f1ccc7eb (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
/*
  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.
*/

/*
  Channel Nick List, including context menu
  begin:     Fre Jun 7 2002
  copyright: (C) 2002 by Dario Abatianni
  email:     eisfuchs@tigress.com
*/

#ifndef NICKLISTVIEW_H
#define NICKLISTVIEW_H

#include "channel.h"
#include "nicklisttooltip.h"
#include "images.h"
#include "common.h"

#include <klistview.h>


class TQPopupMenu;
class TQContextMenuEvent;
class TQTimer;

class NickListView : public TDEListView
{
    Q_OBJECT
  

        public:
        NickListView(TQWidget* parent, Channel *chan);
        ~NickListView();

        /** Call when the icons have been changed.
         */
        void refresh();
        void setWhatsThis();

        virtual void setSorting(int column, bool ascending);

    public slots:
        /** When this is called, resort is guaranteed to be called within a hard-coded time (a few seconds).
         *  This prevents lots of calls to resort.
         */
        void startResortTimer();

        /** Resort the listview.
         *  It is better to call startResortTimer() which will resort with a minimum of a
         *  1 second delay.
         */
        void resort();

        signals:
        /* Will be connected to Channel::popupCommand(int) */
        void popupCommand(int id);

    protected:
        void contextMenuEvent(TQContextMenuEvent* ce);
        virtual bool acceptDrag (TQDropEvent* event) const;
        void insertAssociationSubMenu();
        void updateActions();
        Konversation::KonversationNickListViewToolTip *m_tooltip;
        TQPopupMenu* popup;
        TQPopupMenu* modes;
        TQPopupMenu* kickban;
        TQPopupMenu* addressbook;
        Channel *channel;
        TQTimer *m_resortTimer;

        int m_column;
        bool m_ascending;
};
#endif