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