2 KNode, the KDE newsreader
3 Copyright (c) 1999-2005 the KNode authors.
4 See file AUTHORS for details
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 You should have received a copy of the GNU General Public License
11 along with this program; if not, write to the Free Software Foundation,
12 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
15 #ifndef KNHEADERVIEW_H
16 #define KNHEADERVIEW_H
18 #include <QMouseEvent>
22 #include <k3listview.h>
23 #include <kmime/kmime_dateformatter.h>
28 /** Information shared by all items in a list view */
31 // Popup ids for toggle-able columns
50 showAttachment( false ),
51 showImportant( false ),
54 showWatchedIgnored( false ),
58 showReceiver( false ),
72 watchedIgnoredCol( -1 ),
77 orderOfArrival( false ),
79 showCryptoIcons( false ),
80 showAttachmentIcon( false )
91 QColor colCloseToQuota
;
98 bool showWatchedIgnored
;
116 int watchedIgnoredCol
;
123 bool showCryptoIcons
;
124 bool showAttachmentIcon
;
127 /** Header view, displays the article listing of the currently selected
128 * news group or folder.
130 class KNHeaderView
: public K3ListView
{
134 friend class KNHdrViewItem
;
137 KNHeaderView( QWidget
*parent
);
140 void setActive( Q3ListViewItem
*item
);
143 void ensureItemVisibleWithMargin( const Q3ListViewItem
*i
);
145 virtual void setSorting( int column
, bool ascending
= true );
146 bool sortByThreadChangeDate() const { return mSortByThreadChangeDate
; }
147 void setSortByThreadChangeDate( bool b
) { mSortByThreadChangeDate
= b
; }
149 bool nextUnreadArticle();
150 bool nextUnreadThread();
155 const KPaintInfo
* paintInfo() const { return &mPaintInfo
; }
158 void itemSelected( Q3ListViewItem
* );
159 void doubleClick( Q3ListViewItem
* );
160 void sortingChanged( int );
165 void incCurrentArticle();
166 void decCurrentArticle();
167 void selectCurrentArticle();
169 void toggleColumn( int column
, int mode
= -1 );
170 void prepareForGroup();
171 void prepareForFolder();
174 void activeRemoved() { mActiveItem
= 0; }
176 * Reimplemented to avoid that KListview reloads the alternate
177 * background on palette changes.
179 virtual bool event( QEvent
*e
);
180 void contentsMousePressEvent( QMouseEvent
*e
);
181 void contentsMouseDoubleClickEvent( QMouseEvent
*e
);
182 void keyPressEvent( QKeyEvent
*e
);
183 bool eventFilter( QObject
*, QEvent
* );
184 virtual Q3DragObject
* dragObject();
189 bool mSortByThreadChangeDate
;
191 KNHdrViewItem
*mActiveItem
;
192 KPaintInfo mPaintInfo
;
193 KMime::DateFormatter mDateFormatter
;
199 void slotCenterDelayed();
200 void slotSizeChanged( int, int, int );
205 class KNHeaderViewToolTip
: public QToolTip
{
208 KNHeaderViewToolTip( KNHeaderView
*parent
);
211 void maybeTip( const QPoint
&p
);
214 KNHeaderView
*listView
;