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