nextcloud-desktop/src/libsync/clientproxy.h

66 lines
1.5 KiB
C
Raw Normal View History

/*
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#ifndef CLIENTPROXY_H
#define CLIENTPROXY_H
#include <QObject>
#include <QNetworkProxy>
#include <QRunnable>
2015-03-26 20:36:37 +03:00
#include <QUrl>
#include <csync.h>
#include "utility.h"
2014-11-10 00:34:07 +03:00
namespace OCC {
2014-11-10 00:30:29 +03:00
class ConfigFile;
2015-06-29 19:56:09 +03:00
/**
* @brief The ClientProxy class
* @ingroup libsync
*/
class OWNCLOUDSYNC_EXPORT ClientProxy : public QObject
{
Q_OBJECT
public:
explicit ClientProxy(QObject *parent = 0);
static bool isUsingSystemDefault();
static void lookupSystemProxyAsync(const QUrl &url, QObject *dst, const char *slot);
public slots:
void setupQtProxyFromConfig();
private:
const char* proxyTypeToCStr(QNetworkProxy::ProxyType type);
};
class SystemProxyRunnable : public QObject, public QRunnable {
Q_OBJECT
public:
SystemProxyRunnable(const QUrl &url);
void run();
signals:
void systemProxyLookedUp(const QNetworkProxy &url);
private:
QUrl _url;
};
OWNCLOUDSYNC_EXPORT QString printQNetworkProxy(const QNetworkProxy &proxy);
2015-03-27 12:36:34 +03:00
}
#endif // CLIENTPROXY_H