• 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
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 #include <boost/shared_ptr.hpp>
33 #include <vector>
34 
35 namespace Akregator {
36 
37 class Article;
38 class TreeNode;
39 
40 namespace Filters {
41  class AbstractMatcher;
42 }
43 
44 class AKREGATORPART_EXPORT ArticleModel : public QAbstractTableModel
45 {
46  Q_OBJECT
47 
48 public:
49 
50  enum Column {
51  ItemTitleColumn=0,
52  FeedTitleColumn,
53  AuthorColumn,
54  DateColumn,
55  DescriptionColumn,
56  ContentColumn,
57  ColumnCount
58  };
59 
60  enum Role {
61  SortRole=Qt::UserRole,
62  LinkRole,
63  GuidRole,
64  ItemIdRole,
65  FeedIdRole,
66  StatusRole,
67  IsImportantRole,
68  IsDeletedRole
69  };
70 
71  explicit ArticleModel( const QList<Article>& articles, QObject* parent = 0 );
72  ~ArticleModel();
73 
74  //reimpl
75  int columnCount( const QModelIndex& parent = QModelIndex() ) const;
76 
77  //impl
78  int rowCount( const QModelIndex& parent = QModelIndex() ) const;
79 
80  QVariant headerData( int section, Qt::Orientation, int role ) const;
81  //impl
82  QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
83 
84  bool rowMatches( int row, const boost::shared_ptr<const Akregator::Filters::AbstractMatcher>& matcher ) const;
85 
86  Article article( int row ) const;
87 
88  /* reimp */ QStringList mimeTypes() const;
89 
90  /* reimp */ QMimeData* mimeData( const QModelIndexList& indexes ) const;
91 
92  /* reimp */ Qt::ItemFlags flags( const QModelIndex& idx ) const;
93 
94 public Q_SLOTS:
95 
96  void articlesAdded( Akregator::TreeNode*, const QList<Akregator::Article>& );
97  void articlesUpdated( Akregator::TreeNode*, const QList<Akregator::Article>& );
98  void articlesRemoved( Akregator::TreeNode*, const QList<Akregator::Article>& );
99  void clear();
100 
101 private:
102  ArticleModel( const ArticleModel& );
103  ArticleModel& operator=( const ArticleModel& );
104 
105  class Private;
106  Private* const d;
107 };
108 
109 } //namespace Akregator
110 
111 #endif // AKREGATOR_ARTICLEMODEL_H
Akregator::ArticleModel::ContentColumn
Definition: articlemodel.h:56
Akregator::ArticleModel::DescriptionColumn
Definition: articlemodel.h:55
QObject
Akregator::ArticleModel::Column
Column
Definition: articlemodel.h:50
Akregator::ArticleModel::IsImportantRole
Definition: articlemodel.h:67
Akregator::ArticleModel::AuthorColumn
Definition: articlemodel.h:53
Akregator::ArticleModel::GuidRole
Definition: articlemodel.h:63
Akregator::ArticleModel::Role
Role
Definition: articlemodel.h:60
Akregator::ArticleModel::FeedIdRole
Definition: articlemodel.h:65
Akregator::ArticleModel::StatusRole
Definition: articlemodel.h:66
Akregator::ArticleModel::LinkRole
Definition: articlemodel.h:62
akregator_export.h
Akregator::ArticleModel::FeedTitleColumn
Definition: articlemodel.h:52
Akregator::ArticleModel::ItemIdRole
Definition: articlemodel.h:64
Akregator::Article
A proxy class for Syndication::ItemPtr with some additional methods to assist sorting.
Definition: article.h:61
Akregator::ArticleModel::DateColumn
Definition: articlemodel.h:54
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:59
Akregator::ArticleModel
Definition: articlemodel.h:44
QAbstractTableModel
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