File indexing completed on 2024-05-12 15:42:11

0001 /*
0002     fixhosturifilter.h
0003 
0004     This file is part of the KDE project
0005     SPDX-FileCopyrightText: 2007 Lubos Lunak <llunak@suse.cz>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef FIXHOSTURIFILTER_H
0011 #define FIXHOSTURIFILTER_H
0012 
0013 #include <KUriFilter>
0014 
0015 class QHostInfo;
0016 class QEventLoop;
0017 
0018 /**
0019  This filter tries to automatically prepend www. to http URLs that need it.
0020 */
0021 class FixHostUriFilter : public KUriFilterPlugin
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     FixHostUriFilter(QObject *parent, const QVariantList &args);
0027     bool filterUri(KUriFilterData &data) const override;
0028 
0029 private:
0030     bool exists(const QString &host) const;
0031     bool isResolvable(const QString &host) const;
0032 };
0033 
0034 #endif