• 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
articlemodel.h
Go to the documentation of this file.
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2007 Frank Osterfeld <osterfeld@kde.org>
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 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  As a special exception, permission is given to link this program
21  with any edition of Qt, and distribute the resulting executable,
22  without including the source code for Qt in the source distribution.
23 */
24 #ifndef AKREGATOR_ARTICLEMODEL_H
25 #define AKREGATOR_ARTICLEMODEL_H
26 
27 #include <QAbstractTableModel>
28 #include <QList>
29 
30 #include "akregator_export.h"
31 
32 #ifndef Q_MOC_RUN
33 #include <boost/shared_ptr.hpp>
34 #endif
35 #include <vector>
36 
37 namespace Akregator {
38 
39 class Article;
40 class TreeNode;
41 
42 namespace Filters {
43  class AbstractMatcher;
44 }
45 
46 class AKREGATORPART_EXPORT ArticleModel : public QAbstractTableModel
47 {
48  Q_OBJECT
49 
50 public:
51 
52  enum Column {
53  ItemTitleColumn=0,
54  FeedTitleColumn,
55  AuthorColumn,
56  DateColumn,
57  DescriptionColumn,
58  ContentColumn,
59  ColumnCount
60  };
61 
62  enum Role {
63  SortRole=Qt::UserRole,
64  LinkRole,
65  GuidRole,
66  ItemIdRole,
67  FeedIdRole,
68  StatusRole,
69  IsImportantRole,
70  IsDeletedRole
71  };
72 
73  explicit ArticleModel( const QList<Article>& articles, QObject* parent = 0 );
74  ~ArticleModel();
75 
76  //reimpl
77  int columnCount( const QModelIndex& parent = QModelIndex() ) const;
78 
79  //impl
80  int rowCount( const QModelIndex& parent = QModelIndex() ) const;
81 
82  QVariant headerData( int section, Qt::Orientation, int role ) const;
83  //impl
84  QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
85 
86  bool rowMatches( int row, const boost::shared_ptr<const Akregator::Filters::AbstractMatcher>& matcher ) const;
87 
88  Article article( int row ) const;
89 
90  /* reimp */ QStringList mimeTypes() const;
91 
92  /* reimp */ QMimeData* mimeData( const QModelIndexList& indexes ) const;
93 
94  /* reimp */ Qt::ItemFlags flags( const QModelIndex& idx ) const;
95 
96 public Q_SLOTS:
97 
98  void articlesAdded( Akregator::TreeNode*, const QList<Akregator::Article>& );
99  void articlesUpdated( Akregator::TreeNode*, const QList<Akregator::Article>& );
100  void articlesRemoved( Akregator::TreeNode*, const QList<Akregator::Article>& );
101  void clear();
102 
103 private:
104  ArticleModel( const ArticleModel& );
105  ArticleModel& operator=( const ArticleModel& );
106 
107  class Private;
108  Private* const d;
109 };
110 
111 } //namespace Akregator
112 
113 #endif // AKREGATOR_ARTICLEMODEL_H
QModelIndex
Akregator::ArticleModel::ContentColumn
Definition: articlemodel.h:58
Akregator::ArticleModel::DescriptionColumn
Definition: articlemodel.h:57
QAbstractTableModel
QMimeData
Akregator::ArticleModel::Column
Column
Definition: articlemodel.h:52
Akregator::ArticleModel::IsImportantRole
Definition: articlemodel.h:69
Akregator::ArticleModel::AuthorColumn
Definition: articlemodel.h:55
Akregator::ArticleModel::GuidRole
Definition: articlemodel.h:65
QObject
Akregator::ArticleModel::Role
Role
Definition: articlemodel.h:62
Akregator::ArticleModel::FeedIdRole
Definition: articlemodel.h:67
QList
Definition: article.h:41
QStringList
Akregator::ArticleModel::StatusRole
Definition: articlemodel.h:68
Akregator::ArticleModel::LinkRole
Definition: articlemodel.h:64
akregator_export.h
Akregator::ArticleModel::FeedTitleColumn
Definition: articlemodel.h:54
Akregator::ArticleModel::ItemIdRole
Definition: articlemodel.h:66
Akregator::Article
A proxy class for Syndication::ItemPtr with some additional methods to assist sorting.
Definition: article.h:63
Akregator::ArticleModel::DateColumn
Definition: articlemodel.h:56
AKREGATORPART_EXPORT
#define AKREGATORPART_EXPORT
Definition: akregator_export.h:48
Akregator::TreeNode
Abstract base class for all kind of elements in the feed tree, like feeds and feed groups (and search...
Definition: treenode.h:58
Akregator::ArticleModel
Definition: articlemodel.h:46
QVariant
Qt::ItemFlags
typedef ItemFlags
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