nextcloud-desktop/src/libsync/clientproxy.h
Jocelyn Turcotte cf15cbf0b3 Move Utility to a new common static library
Now that csync builds as C++, this will avoid having to implement
functionalities needed by csync mandatorily in csync itself.

This library is built as part of libocsync and symbols exported
through it.
This requires a relicense of Utility as LGPL. All classes moved into
this library from src/libsync will need to be relicensed as well.
2017-09-05 17:25:19 +02:00

67 lines
1.5 KiB
C++

/*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* 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>
#include <QUrl>
#include <csync.h>
#include "common/utility.h"
#include "owncloudlib.h"
namespace OCC {
class ConfigFile;
/**
* @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);
}
#endif // CLIENTPROXY_H