• 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
articlejobs.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 
25 #ifndef AKREGATOR_ARTICLE_JOBS_H
26 #define AKREGATOR_ARTICLE_JOBS_H
27 
28 #include <KCompositeJob>
29 
30 #include <QList>
31 #include <QMap>
32 #include <QPointer>
33 #include <QString>
34 
35 #ifndef Q_MOC_RUN
36 #include <boost/shared_ptr.hpp>
37 #endif
38 
39 #include "akregator_export.h"
40 
41 //transitional job classes
42 namespace Akregator {
43 
44 class Article;
45 class FeedList;
46 class TreeNode;
47 
48 struct ArticleId
49 {
50  QString feedUrl;
51  QString guid;
52  bool operator<( const ArticleId& other ) const
53  {
54  return feedUrl < other.feedUrl || ( feedUrl == other.feedUrl && guid < other.guid );
55  }
56 };
57 
58 typedef QList<Akregator::ArticleId> ArticleIdList;
59 
60 class AKREGATOR_EXPORT CompositeJob : public KCompositeJob
61 {
62  Q_OBJECT
63 public:
64  explicit CompositeJob( QObject* parent = 0 );
65  /* reimp */ bool addSubjob( KJob* job );
66  /* reimp */ void start();
67 };
68 
69 class AKREGATOR_EXPORT ArticleDeleteJob : public KJob
70 {
71  Q_OBJECT
72 public:
73  explicit ArticleDeleteJob( QObject* parent = 0 );
74 
75  void appendArticleIds( const Akregator::ArticleIdList& ids );
76  void appendArticleId( const Akregator::ArticleId& id );
77 
78  void start();
79 
80 private Q_SLOTS:
81  void doStart();
82 
83 private:
84  boost::shared_ptr<FeedList> m_feedList;
85  ArticleIdList m_ids;
86 };
87 
88 class AKREGATOR_EXPORT ArticleModifyJob : public KJob
89 {
90  Q_OBJECT
91 public:
92  explicit ArticleModifyJob( QObject* parent = 0 );
93 
94  // TODO replace this by passing modified item later
95  void setStatus( const ArticleId& id, int status );
96  void setKeep( const ArticleId& id, bool keep );
97 
98  void start();
99 
100 private Q_SLOTS:
101  void doStart();
102 
103 private:
104  boost::shared_ptr<FeedList> m_feedList;
105  QMap<ArticleId, bool> m_keepFlags;
106  QMap<ArticleId, int> m_status;
107 };
108 
109 
110 class AKREGATOR_EXPORT ArticleListJob : public KJob
111 {
112  Q_OBJECT
113 public:
114  explicit ArticleListJob( TreeNode* parent = 0 );
115 
116  QList<Article> articles() const;
117  TreeNode* node() const;
118 
119  /* reimp */ void start();
120 
121  enum Error {
122  ListingFailed = KJob::UserDefinedError
123  };
124 
125 private Q_SLOTS:
126  void doList();
127 
128 private:
129  const QPointer<TreeNode> m_node;
130  QList<Article> m_articles;
131 };
132 
133 } // namespace akregator
134 
135 #endif // AKREGATOR_ARTICLE_JOBS_H
Akregator::ArticleId::feedUrl
QString feedUrl
Definition: articlejobs.h:50
AKREGATOR_EXPORT
#define AKREGATOR_EXPORT
Definition: akregator_export.h:35
QMap
QPointer
Akregator::ArticleListJob::Error
Error
Definition: articlejobs.h:121
Akregator::CompositeJob
Definition: articlejobs.h:60
Akregator::ArticleListJob
Definition: articlejobs.h:110
QObject
Akregator::ArticleModifyJob
Definition: articlejobs.h:88
QString
QList< Akregator::ArticleId >
Akregator::ArticleId
Definition: articlejobs.h:48
Akregator::ArticleId::guid
QString guid
Definition: articlejobs.h:51
Akregator::ArticleDeleteJob
Definition: articlejobs.h:69
akregator_export.h
Akregator::ArticleIdList
QList< Akregator::ArticleId > ArticleIdList
Definition: articlejobs.h:58
KCompositeJob
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::ArticleId::operator<
bool operator<(const ArticleId &other) const
Definition: articlejobs.h:52
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