• 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
folder.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  2004-2005 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 
26 #ifndef AKREGATOR_FOLDER_H
27 #define AKREGATOR_FOLDER_H
28 
29 #include "akregator_export.h"
30 #include "treenode.h"
31 
32 class QDomDocument;
33 class QDomElement;
34 template <class T> class QList;
35 
36 namespace Akregator {
37 
38 class Article;
39 class FetchQueue;
40 class TreeNodeVisitor;
41 
44 class AKREGATOR_EXPORT Folder : public TreeNode
45 {
46  Q_OBJECT
47  public:
52  static Folder* fromOPML(const QDomElement& e);
53 
57  explicit Folder(const QString& title = QString());
58 
59  ~Folder();
60 
61  bool accept(TreeNodeVisitor* visitor);
62 
65  int unread() const;
66 
69  int totalCount() const;
70 
72  bool isGroup() const { return true; }
73 
74  //impl
75  bool isAggregation() const { return true; }
76 
82  QDomElement toOPML( QDomElement parent, QDomDocument document ) const;
83 
88  //reimpl
89  QList<const TreeNode*> children() const;
90 
91  QList<const TreeNode*> namedChildren( const QString& title ) const;
92  QList<TreeNode*> namedChildren( const QString& title );
93 
94  //reimpl
95  QList<TreeNode*> children();
96 
97  QVector<const Feed*> feeds() const;
98  QVector<Feed*> feeds();
99  QVector<const Folder*> folders() const;
100  QVector<Folder*> folders();
101 
102  int indexOf( const TreeNode* node ) const;
103 
104  //reimpl
105  TreeNode* childAt( int pos );
106 
107  //reimpl
108  const TreeNode* childAt( int pos ) const;
109 
110 
111 
116  void insertChild(TreeNode* node, TreeNode* after);
117 
120  void prependChild(TreeNode* node);
121 
124  void appendChild(TreeNode* node);
125 
128  void removeChild(TreeNode* node);
129 
131  TreeNode* firstChild();
132  const TreeNode* firstChild() const;
133 
134 
136  TreeNode* lastChild();
137  const TreeNode* lastChild() const;
138 
139 
142  bool isOpen() const;
143 
145  void setOpen(bool open);
146 
150  TreeNode* next();
151  const TreeNode* next() const;
152 
153  QIcon icon() const;
154 
155  /* returns whether @p node is among the direct or indirect children of this
156  * folder
157  */
158  bool subtreeContains( const Akregator::TreeNode* node ) const;
159 
160  /* reimp */ KJob* createMarkAsReadJob();
161 
162  signals:
164  void signalChildAdded(Akregator::TreeNode*);
165 
167  void signalChildRemoved(Akregator::Folder*, Akregator::TreeNode*);
168 
169  void signalAboutToRemoveChild( Akregator::TreeNode* );
170 
171  public slots:
172 
176  void slotChildChanged(Akregator::TreeNode* node);
177 
181  void slotChildDestroyed(Akregator::TreeNode* node);
182 
185  void slotAddToFetchQueue(Akregator::FetchQueue* queue, bool intervalFetchesOnly=false);
186 
187  protected:
188 
192  void insertChild(int index, TreeNode* node);
193 
194  void doArticleNotification();
195 
196  private:
197  QList<Article> articles();
198 
199  void connectToNode(TreeNode* child);
200  void disconnectFromNode(TreeNode* child);
201 
202  void updateUnreadCount() const;
203 
204  class FolderPrivate;
205  FolderPrivate* d;
206 };
207 
208 } // namespace Akregator
209 
210 #endif // AKREGATOR_FOLDER_H
treenode.h
AKREGATOR_EXPORT
#define AKREGATOR_EXPORT
Definition: akregator_export.h:35
QString
QList
Definition: article.h:41
QDomDocument
QVector
akregator_export.h
Akregator::TreeNodeVisitor
Definition: treenodevisitor.h:35
Akregator::Folder::isGroup
bool isGroup() const
Helps the rest of the app to decide if node should be handled as group or not.
Definition: folder.h:72
Akregator::Folder
Represents a folder (containing feeds and/or other folders)
Definition: folder.h:44
Akregator::Folder::isAggregation
bool isAggregation() const
returns if the node represents an aggregation, i.e.
Definition: folder.h:75
QDomElement
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
KJob
Akregator::FetchQueue
Definition: fetchqueue.h:37
QIcon
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