• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

Syndication Library

  • sources
  • kde-4.14
  • kdepimlibs
  • syndication
dataretriever.h
1 /*
2  * Copyright (c) 2001, 2002, 2003 Frerich Raabe <raabe@kde.org>
3  *
4  * This program is distributed in the hope that it will be useful, but WITHOUT
5  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
6  * FOR A PARTICULAR PURPOSE. For licensing and distribution details, check the
7  * accompanying file 'COPYING'.
8  */
9 
10 #ifndef SYNDICATION_DATARETRIEVER_H
11 #define SYNDICATION_DATARETRIEVER_H
12 
13 #include "ksyndication_export.h"
14 
15 #include <QtCore/QObject>
16 #include <QtCore/QString>
17 #include <QtCore/QProcess>
18 
19 namespace KIO
20 {
21  class Job;
22 }
23 class KJob;
24 class KUrl;
25 
26 class QByteArray;
27 
28 namespace Syndication
29 {
30 
36 class SYNDICATION_EXPORT DataRetriever : public QObject
37 {
38  Q_OBJECT
39  public:
43  DataRetriever();
44 
48  virtual ~DataRetriever();
49 
59  virtual void retrieveData(const KUrl& url) = 0;
60 
67  virtual int errorCode() const = 0;
68 
72  virtual void abort() = 0;
73 
74  Q_SIGNALS:
87  void dataRetrieved(const QByteArray& data, bool success);
88 
89  private:
90  DataRetriever(const DataRetriever& other);
91  DataRetriever& operator=(const DataRetriever& other);
92 };
93 
94 
100 class SYNDICATION_EXPORT OutputRetriever : public DataRetriever
101 {
102  Q_OBJECT
103 
104  public:
105 
109  OutputRetriever();
110 
114  virtual ~OutputRetriever();
115 
123  virtual void retrieveData(const KUrl& url);
124 
131  virtual int errorCode() const;
132 
133  virtual void abort() {}
134 
135  private Q_SLOTS:
136  void slotFinished ( int exitCode, QProcess::ExitStatus exitStatus ) ;
137 
138  private:
139  OutputRetriever(const OutputRetriever& other);
140  OutputRetriever& operator=(const OutputRetriever& other);
141 
142  struct OutputRetrieverPrivate;
143  OutputRetrieverPrivate* const d;
144 };
145 
150 class SYNDICATION_EXPORT FileRetriever : public DataRetriever
151 {
152  Q_OBJECT
153 
154  public:
155 
159  FileRetriever();
160 
164  virtual ~FileRetriever();
165 
173  virtual void retrieveData(const KUrl& url);
174 
181  virtual int errorCode() const;
182 
186  virtual void abort();
187 
194  static void setUseCache(bool enabled);
195 
201  static void setUserAgent(const QString& userAgent);
202 
203  Q_SIGNALS:
204 
215  void permanentRedirection(const KUrl& url);
216 
217  protected Q_SLOTS:
218 
219  void slotTimeout();
220 
221  private Q_SLOTS:
222 
223  void slotData(KIO::Job*job, const QByteArray& data);
224  void slotResult(KJob* job);
225  void slotPermanentRedirection(KIO::Job* job, const KUrl& fromUrl,
226  const KUrl& toUrl);
227 
228  private:
229 
230  static bool m_useCache;
231  static QString m_userAgent;
232 
233  FileRetriever(const FileRetriever& other);
234  FileRetriever& operator=(const FileRetriever& other);
235 
236  struct FileRetrieverPrivate;
237  FileRetrieverPrivate* const d;
238 };
239 
240 } // namespace Syndication
241 
242 #endif // SYNDICATION_DATARETRIEVER_H
QByteArray
Syndication::FileRetriever
Implements a file retriever, to be used with Loader::loadFrom().
Definition: dataretriever.h:150
QObject
Syndication::OutputRetriever
Implements a data retriever which executes a program and stores returned by the program on stdout...
Definition: dataretriever.h:100
QString
Syndication::OutputRetriever::abort
virtual void abort()
aborts the retrieval process.
Definition: dataretriever.h:133
Syndication::DataRetriever
Abstract baseclass for all data retriever classes.
Definition: dataretriever.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Syndication Library

Skip menu "Syndication Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

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