2 * Qt OBS - A Qt based OBS client
4 * Copyright (C) 2010 Novell Inc, Klaas Freitag <freitag@suse.de>
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) version 3.
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.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * Written by Klaas Freitag <freitag@suse.de>
28 #include <QNetworkAccessManager>
30 #include <QNetworkReply>
32 #include <QDomDocument>
34 #include "obsxmlreader.h"
39 class OBSAccess : public QObject
44 OBSAccess( const QUrl& url = QUrl("https://api.opensuse.org") );
45 void getPath( const QString& );
46 void setCredentials( const QString&, const QString& );
47 void setXmlReadHandler( OBSXmlReader* );
48 QXmlStreamReader* xmlReadHandler();
51 void replyContent( const QString& );
56 void authenticate( QNetworkReply* , QAuthenticator* );
57 void replyFinished(QNetworkReply*);
58 void slotNetworkError( QNetworkReply::NetworkError );
60 void slotSSLErrors( QList<QSslError> );
61 void slotProxyAuthenticate( const QNetworkProxy&, QAuthenticator* );
62 void slotReplyFinished();
65 QUrl redirectUrl(const QUrl&, const QUrl&) const;
67 QNetworkAccessManager *mManager;
70 QUrl mUrlRedirectedTo;
74 QNetworkReply *mReply;
75 OBSXmlReader *mXmlStreamReader;