• 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
subscriptionlistmodel.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_SUBSCRIPTIONLISTMODEL_H
25 #define AKREGATOR_SUBSCRIPTIONLISTMODEL_H
26 
27 #include "akregator_export.h"
28 
29 #include <QAbstractItemModel>
30 
31 #ifndef Q_MOC_RUN
32 #include <boost/shared_ptr.hpp>
33 #endif
34 
35 namespace Akregator {
36 
37 class Feed;
38 class FeedList;
39 class Folder;
40 class TreeNode;
41 
42 class AKREGATORPART_EXPORT SubscriptionListModel : public QAbstractItemModel
43 {
44 Q_OBJECT
45 public:
46 
47  enum Role {
48  SubscriptionIdRole=Qt::UserRole,
49  IsFetchableRole,
50  IsGroupRole,
51  IsAggregationRole,
52  LinkRole,
53  IdRole,
54  IsOpenRole,
55  HasUnreadRole
56  };
57 
58  enum Column {
59  TitleColumn=0,
60  UnreadCountColumn=1,
61  TotalCountColumn=2,
62  ColumnCount=3
63  };
64 
65  explicit SubscriptionListModel( const boost::shared_ptr<const FeedList>& feedList, QObject* parent = 0 );
66 
67  //impl
68  int columnCount( const QModelIndex& parent = QModelIndex() ) const;
69 
70  //impl
71  int rowCount( const QModelIndex& parent = QModelIndex() ) const;
72 
73  //impl
74  QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
75 
76  //impl
77  QModelIndex index( int row, int column, const QModelIndex& parent = QModelIndex() ) const;
78 
79  //impl
80  QModelIndex parent( const QModelIndex& index ) const;
81 
82  //reimpl
83  QVariant headerData( int section, Qt::Orientation orientation, int role=Qt::DisplayRole ) const;
84 
85  //reimpl
86  Qt::ItemFlags flags( const QModelIndex& index ) const;
87 
88  //reimpl
89  QStringList mimeTypes() const;
90 
91  //reimpl
92  QMimeData* mimeData( const QModelIndexList& indexes ) const;
93 
94  //reimpl
95  bool dropMimeData( const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent );
96 
97  //reimpl
98  bool setData( const QModelIndex& idx, const QVariant& value, int role = Qt::EditRole );
99 
100  uint nodeIdForIndex( const QModelIndex& index ) const;
101 
102 private:
103  QModelIndex indexForNode( const TreeNode* node ) const;
104 
105 private Q_SLOTS:
106 
107  void subscriptionAdded( Akregator::TreeNode* );
108 
109  void aboutToRemoveSubscription( Akregator::TreeNode* );
110 
111  void subscriptionRemoved( Akregator::TreeNode* );
112 
113  void subscriptionChanged( Akregator::TreeNode* );
114 
115  void fetchStarted( Akregator::Feed* );
116 
117  void fetched( Akregator::Feed* );
118 
119  void fetchError( Akregator::Feed* );
120 
121  void fetchAborted( Akregator::Feed* );
122 
123 
124 private:
125 
126  boost::shared_ptr<const FeedList> m_feedList;
127  bool m_beganRemoval;
128 };
129 
130 }
131 
132 
133 namespace Akregator {
134 
135 class AKREGATORPART_EXPORT FolderExpansionHandler : public QObject
136 {
137  Q_OBJECT
138 
139 public:
140  explicit FolderExpansionHandler( QObject* parent = 0 );
141 
142  void setFeedList( const boost::shared_ptr<FeedList>& feedList );
143  void setModel( Akregator::SubscriptionListModel* model );
144 
145 public Q_SLOTS:
146  void itemExpanded( const QModelIndex& index );
147  void itemCollapsed( const QModelIndex& index );
148 
149 private:
150  void setExpanded( const QModelIndex& index, bool expanded );
151 
152 private:
153  boost::shared_ptr<FeedList> m_feedList;
154  SubscriptionListModel* m_model;
155 };
156 
157 } // namespace Akregator
158 
159 #endif // AKREGATOR_SUBSCRIPTIONLISTMODEL_H
QModelIndex
Akregator::SubscriptionListModel::LinkRole
Definition: subscriptionlistmodel.h:52
uint
unsigned int uint
Definition: article.h:41
Akregator::FolderExpansionHandler
Definition: subscriptionlistmodel.h:135
Akregator::SubscriptionListModel
Definition: subscriptionlistmodel.h:42
Akregator::SubscriptionListModel::IdRole
Definition: subscriptionlistmodel.h:53
QMimeData
QObject
Akregator::SubscriptionListModel::IsOpenRole
Definition: subscriptionlistmodel.h:54
QStringList
Akregator::SubscriptionListModel::Role
Role
Definition: subscriptionlistmodel.h:47
Akregator::SubscriptionListModel::Column
Column
Definition: subscriptionlistmodel.h:58
akregator_export.h
Akregator::SubscriptionListModel::IsFetchableRole
Definition: subscriptionlistmodel.h:49
Akregator::Feed
represents a feed
Definition: feed.h:53
QAbstractItemModel
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::SubscriptionListModel::IsGroupRole
Definition: subscriptionlistmodel.h:50
Akregator::SubscriptionListModel::IsAggregationRole
Definition: subscriptionlistmodel.h:51
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