Attica

atticabasejob.h
1 /*
2  This file is part of KDE.
3 
4  SPDX-FileCopyrightText: 2008 Cornelius Schumacher <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7  */
8 #ifndef ATTICA_ATTICABASEJOB_H
9 #define ATTICA_ATTICABASEJOB_H
10 
11 #include <QObject>
12 #include <QSharedPointer>
13 #include <QUrl>
14 #include <QNetworkAccessManager>
15 #include <QNetworkRequest>
16 
17 #include "attica_export.h"
18 #include "metadata.h"
19 
20 class QNetworkReply;
21 
22 namespace Attica
23 {
24 class PlatformDependent;
25 
26 class ATTICA_EXPORT BaseJob : public QObject
27 {
28  Q_OBJECT
29 
30 public:
31  virtual ~BaseJob();
32 
33  Metadata metadata() const;
34 
35  enum NetworkRequestCustomAttributes {
36  UserAttribute = QNetworkRequest::User + 1,
37  PasswordAttribute
38  };
39 
40 public Q_SLOTS:
41  void start();
42  void abort();
43 
44 Q_SIGNALS:
45  void finished(Attica::BaseJob *job);
46 
47 protected Q_SLOTS:
48  void dataFinished();
49 
50 protected:
51  BaseJob(PlatformDependent *internals);
52 
53  void setMetadata(const Metadata &data) const;
54 
55  virtual QNetworkReply *executeRequest() = 0;
56  virtual void parse(const QString &xml) = 0;
57  PlatformDependent *internals();
58  void setError(int errorCode);
59 
60 private Q_SLOTS:
61  void doWork();
62  void authenticationRequired(QNetworkReply *, QAuthenticator *);
63 
64 private:
65  BaseJob(const BaseJob &other);
66  BaseJob &operator=(const BaseJob &other);
67 
68  class Private;
69  Private *d;
70 };
71 
72 }
73 
74 #endif
QVector< QVariant > parse(const QString &message, const QDate &externalIssueDate=QDate())
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 23:06:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.