• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

knode

  • sources
  • kde-4.12
  • kdepim
  • knode
headerview.h
Go to the documentation of this file.
1 /*
2  KNode, the KDE newsreader
3  Copyright (c) 1999-2005 the KNode authors.
4  See file AUTHORS for details
5 
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
13 */
14 
15 #ifndef KNHEADERVIEW_H
16 #define KNHEADERVIEW_H
17 
18 #include <QMouseEvent>
19 #include <QKeyEvent>
20 #include <QEvent>
21 
22 #include <k3listview.h>
23 #include <kmime/kmime_dateformatter.h>
24 
25 class KMenu;
26 class KNHdrViewItem;
27 
29 struct KPaintInfo {
30 
31  // Popup ids for toggle-able columns
32  enum ColumnIds {
33  COL_SIZE,
34  COL_ATTACHMENT,
35  COL_IMPORTANT,
36  COL_TOACT,
37  COL_SPAM_HAM,
38  COL_WATCHED_IGNORED,
39  COL_STATUS,
40  COL_SIGNED,
41  COL_CRYPTO,
42  COL_RECEIVER,
43  COL_SCORE
44  };
45 
46  KPaintInfo() :
47  pixmapOn( false ),
48 
49  showSize( false ),
50  showAttachment( false ),
51  showImportant( false ),
52  showToAct( false ),
53  showSpamHam( false ),
54  showWatchedIgnored( false ),
55  showStatus( false ),
56  showSigned( false ),
57  showCrypto( false ),
58  showReceiver( false ),
59  showScore( false ),
60 
61  scoreCol( -1 ),
62  flagCol( -1 ),
63  senderCol( -1 ),
64  receiverCol( -1 ),
65  subCol( -1 ),
66  dateCol( -1 ),
67  sizeCol( -1 ),
68  attachmentCol( -1 ),
69  importantCol( -1 ),
70  toActCol( -1 ),
71  spamHamCol( -1 ),
72  watchedIgnoredCol( -1 ),
73  statusCol( -1 ),
74  signedCol( -1 ),
75  cryptoCol( -1 ),
76 
77  orderOfArrival( false ),
78  status( false ),
79  showCryptoIcons( false ),
80  showAttachmentIcon( false )
81  {}
82 
83  bool pixmapOn;
84  QPixmap pixmap;
85  QColor colFore;
86  QColor colBack;
87  QColor colNew;
88  QColor colUnread;
89  QColor colFlag;
90  QColor colToAct;
91  QColor colCloseToQuota;
92 
93  bool showSize;
94  bool showAttachment;
95  bool showImportant;
96  bool showToAct;
97  bool showSpamHam;
98  bool showWatchedIgnored;
99  bool showStatus;
100  bool showSigned;
101  bool showCrypto;
102  bool showReceiver;
103  bool showScore;
104 
105  int scoreCol;
106  int flagCol;
107  int senderCol;
108  int receiverCol;
109  int subCol;
110  int dateCol;
111  int sizeCol;
112  int attachmentCol;
113  int importantCol;
114  int toActCol;
115  int spamHamCol;
116  int watchedIgnoredCol;
117  int statusCol;
118  int signedCol;
119  int cryptoCol;
120 
121  bool orderOfArrival;
122  bool status;
123  bool showCryptoIcons;
124  bool showAttachmentIcon;
125 };
126 
130 class KNHeaderView : public K3ListView {
131 
132  Q_OBJECT
133 
134  friend class KNHdrViewItem;
135 
136  public:
137  explicit KNHeaderView( QWidget *parent );
138  ~KNHeaderView();
139 
140  void setActive( Q3ListViewItem *item );
141  void clear();
142 
143  void ensureItemVisibleWithMargin( const Q3ListViewItem *i );
144 
145  virtual void setSorting( int column, bool ascending = true );
146  bool sortByThreadChangeDate() const { return mSortByThreadChangeDate; }
147  void setSortByThreadChangeDate( bool b ) { mSortByThreadChangeDate = b; }
148 
149  bool nextUnreadArticle();
150  bool nextUnreadThread();
151 
152  void readConfig();
153  void writeConfig();
154 
155  const KPaintInfo* paintInfo() const { return &mPaintInfo; }
156 
157  signals:
158  void itemSelected( Q3ListViewItem* );
159  void doubleClick( Q3ListViewItem* );
160  void sortingChanged( int );
161 
162  public slots:
163  void nextArticle();
164  void prevArticle();
165  void incCurrentArticle();
166  void decCurrentArticle();
167  void selectCurrentArticle();
168 
169  void toggleColumn( int column, int mode = -1 );
170  void prepareForGroup();
171  void prepareForFolder();
172 
173  protected:
174  void activeRemoved() { mActiveItem = 0; }
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();
185 
186  private:
187  int mSortCol;
188  bool mSortAsc;
189  bool mSortByThreadChangeDate;
190  int mDelayedCenter;
191  KNHdrViewItem *mActiveItem;
192  KPaintInfo mPaintInfo;
193  KMime::DateFormatter mDateFormatter;
194  KMenu *mPopup;
195  bool mShowingFolder;
196  bool mInitDone;
197 
198  private slots:
199  void slotCenterDelayed();
200  void slotSizeChanged( int, int, int );
201 
202 };
203 
204 #if 0
205 class KNHeaderViewToolTip : public QToolTip {
206 
207  public:
208  KNHeaderViewToolTip( KNHeaderView *parent );
209 
210  protected:
211  void maybeTip( const QPoint &p );
212 
213  private:
214  KNHeaderView *listView;
215 
216 };
217 #endif
218 
219 #endif
KPaintInfo::colNew
QColor colNew
Definition: headerview.h:87
KPaintInfo::status
bool status
Definition: headerview.h:122
KPaintInfo::showAttachmentIcon
bool showAttachmentIcon
Definition: headerview.h:124
KPaintInfo::COL_RECEIVER
Definition: headerview.h:42
KNHeaderView
Header view, displays the article listing of the currently selected news group or folder...
Definition: headerview.h:130
KNHeaderView::prevArticle
void prevArticle()
Definition: headerview.cpp:250
KNHeaderView::event
virtual bool event(QEvent *e)
Reimplemented to avoid that KListview reloads the alternate background on palette changes...
Definition: headerview.cpp:448
KNHeaderView::toggleColumn
void toggleColumn(int column, int mode=-1)
Definition: headerview.cpp:388
KNHeaderView::readConfig
void readConfig()
Definition: headerview.cpp:104
KPaintInfo::orderOfArrival
bool orderOfArrival
Definition: headerview.h:121
KPaintInfo::ColumnIds
ColumnIds
Definition: headerview.h:32
KPaintInfo::showSpamHam
bool showSpamHam
Definition: headerview.h:97
KNHeaderView::dragObject
virtual Q3DragObject * dragObject()
Definition: headerview.cpp:522
KPaintInfo::senderCol
int senderCol
Definition: headerview.h:107
QWidget
KPaintInfo::showSize
bool showSize
Definition: headerview.h:93
KNHeaderView::KNHeaderView
KNHeaderView(QWidget *parent)
Definition: headerview.cpp:38
KPaintInfo::cryptoCol
int cryptoCol
Definition: headerview.h:119
KNHeaderView::ensureItemVisibleWithMargin
void ensureItemVisibleWithMargin(const Q3ListViewItem *i)
Definition: headerview.cpp:170
KNHeaderView::keyPressEvent
void keyPressEvent(QKeyEvent *e)
Definition: headerview.cpp:496
KPaintInfo::COL_CRYPTO
Definition: headerview.h:41
KNHeaderView::nextUnreadThread
bool nextUnreadThread()
Definition: headerview.cpp:341
KPaintInfo::showWatchedIgnored
bool showWatchedIgnored
Definition: headerview.h:98
KPaintInfo::sizeCol
int sizeCol
Definition: headerview.h:111
KPaintInfo::COL_SIGNED
Definition: headerview.h:40
KPaintInfo::spamHamCol
int spamHamCol
Definition: headerview.h:115
KNHeaderView::sortingChanged
void sortingChanged(int)
KPaintInfo::COL_SIZE
Definition: headerview.h:33
QObject
KPaintInfo::subCol
int subCol
Definition: headerview.h:109
KPaintInfo::showToAct
bool showToAct
Definition: headerview.h:96
KPaintInfo::pixmapOn
bool pixmapOn
Definition: headerview.h:83
KPaintInfo::colBack
QColor colBack
Definition: headerview.h:86
KNHeaderView::prepareForFolder
void prepareForFolder()
Definition: headerview.cpp:440
KPaintInfo::receiverCol
int receiverCol
Definition: headerview.h:108
KPaintInfo::showAttachment
bool showAttachment
Definition: headerview.h:94
KPaintInfo::showCrypto
bool showCrypto
Definition: headerview.h:101
KPaintInfo::pixmap
QPixmap pixmap
Definition: headerview.h:84
KPaintInfo::showStatus
bool showStatus
Definition: headerview.h:99
KNHeaderView::activeRemoved
void activeRemoved()
Definition: headerview.h:174
KPaintInfo::COL_TOACT
Definition: headerview.h:36
KPaintInfo::colCloseToQuota
QColor colCloseToQuota
Definition: headerview.h:91
KNHeaderView::decCurrentArticle
void decCurrentArticle()
Definition: headerview.cpp:275
KPaintInfo::showSigned
bool showSigned
Definition: headerview.h:100
KNHeaderView::incCurrentArticle
void incCurrentArticle()
Definition: headerview.cpp:263
KPaintInfo::colUnread
QColor colUnread
Definition: headerview.h:88
KPaintInfo::KPaintInfo
KPaintInfo()
Definition: headerview.h:46
KPaintInfo
Information shared by all items in a list view.
Definition: headerview.h:29
KPaintInfo::importantCol
int importantCol
Definition: headerview.h:113
KNHdrViewItem
Header view item.
Definition: knhdrviewitem.h:26
KPaintInfo::statusCol
int statusCol
Definition: headerview.h:117
KPaintInfo::colFlag
QColor colFlag
Definition: headerview.h:89
KPaintInfo::showScore
bool showScore
Definition: headerview.h:103
KNHeaderView::nextUnreadArticle
bool nextUnreadArticle()
Definition: headerview.cpp:295
KNHeaderView::contentsMouseDoubleClickEvent
void contentsMouseDoubleClickEvent(QMouseEvent *e)
Definition: headerview.cpp:482
KNHeaderView::writeConfig
void writeConfig()
Definition: headerview.cpp:129
K3ListView
KNHeaderView::nextArticle
void nextArticle()
Definition: headerview.cpp:229
KNHeaderView::~KNHeaderView
~KNHeaderView()
Definition: headerview.cpp:97
Q3ListViewItem
KNHeaderView::contentsMousePressEvent
void contentsMousePressEvent(QMouseEvent *e)
Definition: headerview.cpp:458
KNHeaderView::prepareForGroup
void prepareForGroup()
Definition: headerview.cpp:432
KPaintInfo::dateCol
int dateCol
Definition: headerview.h:110
KPaintInfo::attachmentCol
int attachmentCol
Definition: headerview.h:112
KNHeaderView::eventFilter
bool eventFilter(QObject *, QEvent *)
Definition: headerview.cpp:538
KPaintInfo::showImportant
bool showImportant
Definition: headerview.h:95
KPaintInfo::COL_STATUS
Definition: headerview.h:39
KNHeaderView::setSorting
virtual void setSorting(int column, bool ascending=true)
Definition: headerview.cpp:206
KNHeaderView::itemSelected
void itemSelected(Q3ListViewItem *)
KPaintInfo::COL_SPAM_HAM
Definition: headerview.h:37
KNHeaderView::setActive
void setActive(Q3ListViewItem *item)
Definition: headerview.cpp:141
KNHeaderView::clear
void clear()
Definition: headerview.cpp:163
KPaintInfo::COL_SCORE
Definition: headerview.h:43
KNHeaderView::paintInfo
const KPaintInfo * paintInfo() const
Definition: headerview.h:155
KPaintInfo::COL_IMPORTANT
Definition: headerview.h:35
KPaintInfo::flagCol
int flagCol
Definition: headerview.h:106
KPaintInfo::showReceiver
bool showReceiver
Definition: headerview.h:102
KPaintInfo::watchedIgnoredCol
int watchedIgnoredCol
Definition: headerview.h:116
KNHeaderView::selectCurrentArticle
void selectCurrentArticle()
Definition: headerview.cpp:288
KNHeaderView::doubleClick
void doubleClick(Q3ListViewItem *)
KPaintInfo::scoreCol
int scoreCol
Definition: headerview.h:105
KPaintInfo::toActCol
int toActCol
Definition: headerview.h:114
KPaintInfo::COL_WATCHED_IGNORED
Definition: headerview.h:38
KPaintInfo::colFore
QColor colFore
Definition: headerview.h:85
KNHeaderView::sortByThreadChangeDate
bool sortByThreadChangeDate() const
Definition: headerview.h:146
KPaintInfo::showCryptoIcons
bool showCryptoIcons
Definition: headerview.h:123
KPaintInfo::signedCol
int signedCol
Definition: headerview.h:118
KNHeaderView::setSortByThreadChangeDate
void setSortByThreadChangeDate(bool b)
Definition: headerview.h:147
KPaintInfo::colToAct
QColor colToAct
Definition: headerview.h:90
KPaintInfo::COL_ATTACHMENT
Definition: headerview.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

Skip menu "knode"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal