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

akregator

  • sources
  • kde-4.14
  • kdepim
  • akregator
  • src
articlelistview.h
Go to the documentation of this file.
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2004 Stanislav Karchebny <Stanislav.Karchebny@kdemail.net>
5  2005-2007 Frank Osterfeld <osterfeld@kde.org>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, permission is given to link this program
22  with any edition of Qt, and distribute the resulting executable,
23  without including the source code for Qt in the source distribution.
24 */
25 #ifndef AKREGATOR_ARTICLELISTVIEW_H
26 #define AKREGATOR_ARTICLELISTVIEW_H
27 
28 #include "akregator_export.h"
29 #include "abstractselectioncontroller.h"
30 
31 #include <QPointer>
32 #include <QSortFilterProxyModel>
33 #include <QTreeView>
34 
35 #ifndef Q_MOC_RUN
36 #include <boost/shared_ptr.hpp>
37 #endif
38 
39 class KUrl;
40 
41 class QContextMenuEvent;
42 class QPaintEvent;
43 template <class T> class QList;
44 
45 namespace Akregator {
46 
47 class Article;
48 
49 namespace Filters
50 {
51 }
52 
53 class AKREGATORPART_EXPORT FilterDeletedProxyModel : public QSortFilterProxyModel {
54  Q_OBJECT
55 public:
56 
57  explicit FilterDeletedProxyModel( QObject* parent = 0 );
58 
59 private:
60  //reimpl
61  bool filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const;
62 };
63 
64 class AKREGATORPART_EXPORT SortColorizeProxyModel : public QSortFilterProxyModel {
65  Q_OBJECT
66 public:
67 
68  explicit SortColorizeProxyModel( QObject* parent = 0 );
69 
70  //reimpl
71  QVariant data( const QModelIndex& index, int role=Qt::DisplayRole ) const;
72 
73  void setFilters( const std::vector<boost::shared_ptr<const Akregator::Filters::AbstractMatcher> >& );
74 
75 private:
76 
77  //reimpl
78  bool filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const;
79 
80  QIcon m_keepFlagIcon;
81  std::vector<boost::shared_ptr<const Akregator::Filters::AbstractMatcher> > m_matchers;
82 
83  QColor m_unreadColor;
84  QColor m_newColor;
85 };
86 
87 
88 class AKREGATORPART_EXPORT ArticleListView : public QTreeView, public ArticleLister
89 {
90  Q_OBJECT
91 
92 public:
93 
94  explicit ArticleListView( QWidget* parent = 0 );
95  ~ArticleListView();
96 
97  //impl ArticleLister
98  void setArticleModel( Akregator::ArticleModel* model );
99 
100  //impl ArticleLister
101  QItemSelectionModel* articleSelectionModel() const;
102 
103  //impl ArticleLister
104  const QAbstractItemView* itemView() const;
105 
106  //impl ArticleLister
107  QAbstractItemView* itemView();
108 
109  //impl ArticleLister
110  QPoint scrollBarPositions() const;
111 
112  //impl ArticleLister
113  void setScrollBarPositions( const QPoint& p );
114 
115  //impl ArticleLister
116  void setFilters( const std::vector<boost::shared_ptr<const Akregator::Filters::AbstractMatcher> >& );
117 
118  //impl ArticleLister
119  void forceFilterUpdate();
120 
121  void setIsAggregation( bool isAggregation );
122 
123  /* reimp */ void setModel( QAbstractItemModel* model );
124 
125 protected:
126  void mousePressEvent( QMouseEvent *ev );
127 
128 signals:
129  void signalMouseButtonPressed( int, const KUrl );
130 
131 public Q_SLOTS:
132 
133  void slotClear();
134 
135  void slotPreviousArticle();
136 
137  void slotNextArticle();
138 
139  void slotPreviousUnreadArticle();
140 
141  void slotNextUnreadArticle();
142 
143 Q_SIGNALS:
144 
145  void userActionTakingPlace();
146 
147 private:
148  void restoreHeaderState();
149  void saveHeaderSettings();
150  void loadHeaderSettings();
151 
152  //reimpl
153  void paintEvent( QPaintEvent* e );
154 
155  //reimpl
156  void contextMenuEvent( QContextMenuEvent* event );
157 
158  void selectIndex( const QModelIndex& index );
159 
160  void setFeedMode();
161  void setGroupMode();
162 
163 private Q_SLOTS:
164  void showHeaderMenu( const QPoint& pos );
165  void startResizingTitleColumn();
166  void finishResizingTitleColumn();
167 
168 private:
169 
170  enum ColumnMode { GroupMode, FeedMode };
171  ColumnMode m_columnMode;
172  QPointer<SortColorizeProxyModel> m_proxy;
173  std::vector<boost::shared_ptr<const Filters::AbstractMatcher> > m_matchers;
174  QByteArray m_feedHeaderState;
175  QByteArray m_groupHeaderState;
176 };
177 
178 } // namespace Akregator
179 
180 
181 #endif // AKREGATOR_ARTICLELISTVIEW_H
QModelIndex
QWidget
QAbstractItemView
QByteArray
QPointer
QPoint
QMouseEvent
Akregator::ArticleListView
Definition: articlelistview.h:88
QContextMenuEvent
QObject
Akregator::SortColorizeProxyModel
Definition: articlelistview.h:64
QList
Definition: article.h:41
QColor
Akregator::FilterDeletedProxyModel
Definition: articlelistview.h:53
Akregator::ArticleLister
Definition: abstractselectioncontroller.h:52
QSortFilterProxyModel
akregator_export.h
QTreeView
QAbstractItemModel
QPaintEvent
AKREGATORPART_EXPORT
#define AKREGATORPART_EXPORT
Definition: akregator_export.h:48
QItemSelectionModel
abstractselectioncontroller.h
Akregator::ArticleModel
Definition: articlemodel.h:46
QIcon
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akregator

Skip menu "akregator"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

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
  • pimprint

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