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

akregator

  • sources
  • kde-4.12
  • 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 #include <boost/shared_ptr.hpp>
36 
37 class KUrl;
38 class KMenu;
39 
40 class QContextMenuEvent;
41 class QPaintEvent;
42 class QKeyEvent;
43 template <class T> class QList;
44 
45 namespace Akregator {
46 
47 class Article;
48 class FilterColumnsProxyModel;
49 
50 namespace Filters
51 {
52  class ArticleMatcher;
53 }
54 
55 class AKREGATORPART_EXPORT FilterDeletedProxyModel : public QSortFilterProxyModel {
56  Q_OBJECT
57 public:
58 
59  explicit FilterDeletedProxyModel( QObject* parent = 0 );
60 
61 private:
62  //reimpl
63  bool filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const;
64 };
65 
66 class AKREGATORPART_EXPORT SortColorizeProxyModel : public QSortFilterProxyModel {
67  Q_OBJECT
68 public:
69 
70  explicit SortColorizeProxyModel( QObject* parent = 0 );
71 
72  //reimpl
73  QVariant data( const QModelIndex& index, int role=Qt::DisplayRole ) const;
74 
75  void setFilters( const std::vector<boost::shared_ptr<const Akregator::Filters::AbstractMatcher> >& );
76 
77 private:
78 
79  //reimpl
80  bool filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const;
81 
82  QIcon m_keepFlagIcon;
83  std::vector<boost::shared_ptr<const Akregator::Filters::AbstractMatcher> > m_matchers;
84 
85  QColor m_unreadColor;
86  QColor m_newColor;
87 };
88 
89 
90 class AKREGATORPART_EXPORT ArticleListView : public QTreeView, public ArticleLister
91 {
92  Q_OBJECT
93 
94 public:
95 
96  explicit ArticleListView( QWidget* parent = 0 );
97  ~ArticleListView();
98 
99  //impl ArticleLister
100  void setArticleModel( Akregator::ArticleModel* model );
101 
102  //impl ArticleLister
103  QItemSelectionModel* articleSelectionModel() const;
104 
105  //impl ArticleLister
106  const QAbstractItemView* itemView() const;
107 
108  //impl ArticleLister
109  QAbstractItemView* itemView();
110 
111  //impl ArticleLister
112  QPoint scrollBarPositions() const;
113 
114  //impl ArticleLister
115  void setScrollBarPositions( const QPoint& p );
116 
117  //impl ArticleLister
118  void setFilters( const std::vector<boost::shared_ptr<const Akregator::Filters::AbstractMatcher> >& );
119 
120  //impl ArticleLister
121  void forceFilterUpdate();
122 
123  void setIsAggregation( bool isAggregation );
124 
125  /* reimp */ void setModel( QAbstractItemModel* model );
126 
127 protected:
128  void mousePressEvent( QMouseEvent *ev );
129 
130 signals:
131  void signalMouseButtonPressed( int, const KUrl );
132 
133 public Q_SLOTS:
134 
135  void slotClear();
136 
137  void slotPreviousArticle();
138 
139  void slotNextArticle();
140 
141  void slotPreviousUnreadArticle();
142 
143  void slotNextUnreadArticle();
144 
145 Q_SIGNALS:
146 
147  void userActionTakingPlace();
148 
149 private:
150  void restoreHeaderState();
151  void saveHeaderSettings();
152  void loadHeaderSettings();
153 
154  //reimpl
155  void paintEvent( QPaintEvent* e );
156 
157  //reimpl
158  void contextMenuEvent( QContextMenuEvent* event );
159 
160  void selectIndex( const QModelIndex& index );
161 
162  void setFeedMode();
163  void setGroupMode();
164 
165 private Q_SLOTS:
166  void showHeaderMenu( const QPoint& pos );
167  void startResizingTitleColumn();
168  void finishResizingTitleColumn();
169 
170 private:
171 
172  enum ColumnMode { GroupMode, FeedMode };
173  ColumnMode m_columnMode;
174  QPointer<SortColorizeProxyModel> m_proxy;
175  std::vector<boost::shared_ptr<const Filters::AbstractMatcher> > m_matchers;
176  QByteArray m_feedHeaderState;
177  QByteArray m_groupHeaderState;
178 };
179 
180 } // namespace Akregator
181 
182 
183 #endif // AKREGATOR_ARTICLELISTVIEW_H
QWidget
QObject
Akregator::ArticleListView
Definition: articlelistview.h:90
QTreeView
Akregator::SortColorizeProxyModel
Definition: articlelistview.h:66
Akregator::FilterDeletedProxyModel
Definition: articlelistview.h:55
Akregator::ArticleLister
Definition: abstractselectioncontroller.h:50
QAbstractItemModel
QSortFilterProxyModel
akregator_export.h
AKREGATORPART_EXPORT
#define AKREGATORPART_EXPORT
Definition: akregator_export.h:48
abstractselectioncontroller.h
Akregator::ArticleModel
Definition: articlemodel.h:44
QList
Definition: article.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:14 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

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