2012-08-17 20:56:01 +02:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2015-05-22 22:00:06 +02:00
|
|
|
* Copyright (C) 2010-2015 David Rosca <nowrep@gmail.com>
|
2012-08-17 20:56:01 +02:00
|
|
|
*
|
|
|
|
* 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 3 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2012-08-16 23:15:31 +02:00
|
|
|
#ifndef USERAGENTMANAGER_H
|
|
|
|
#define USERAGENTMANAGER_H
|
|
|
|
|
2014-03-06 16:12:36 +01:00
|
|
|
#include <QObject>
|
2012-08-16 23:15:31 +02:00
|
|
|
#include <QHash>
|
|
|
|
|
2014-02-26 20:03:20 +01:00
|
|
|
#include "qzcommon.h"
|
2012-08-16 23:15:31 +02:00
|
|
|
|
|
|
|
class QUrl;
|
|
|
|
|
2014-03-06 16:12:36 +01:00
|
|
|
class QUPZILLA_EXPORT UserAgentManager : QObject
|
2012-08-16 23:15:31 +02:00
|
|
|
{
|
2014-03-06 16:12:36 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
2012-08-16 23:15:31 +02:00
|
|
|
public:
|
2014-03-06 16:12:36 +01:00
|
|
|
explicit UserAgentManager(QObject* parent = 0);
|
2012-08-16 23:15:31 +02:00
|
|
|
|
|
|
|
void loadSettings();
|
|
|
|
|
2012-08-17 20:56:01 +02:00
|
|
|
QString userAgentForUrl(const QUrl &url) const;
|
|
|
|
QString globalUserAgent() const;
|
|
|
|
|
|
|
|
bool usePerDomainUserAgents() const;
|
|
|
|
QHash<QString, QString> perDomainUserAgentsList() const;
|
2012-08-16 23:15:31 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_globalUserAgent;
|
|
|
|
|
|
|
|
bool m_usePerDomainUserAgent;
|
|
|
|
QHash<QString, QString> m_userAgentsList;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // USERAGENTMANAGER_H
|