File indexing completed on 2024-04-28 03:55:42
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 "kurifilterplugin_p.h" 0014 #include <KUriFilter> 0015 0016 /** 0017 This filter tries to automatically prepend www. to http URLs that need it. 0018 */ 0019 class FixHostUriFilter : public KUriFilterPlugin 0020 { 0021 Q_OBJECT 0022 0023 public: 0024 using KUriFilterPlugin::KUriFilterPlugin; 0025 bool filterUri(KUriFilterData &data) const override; 0026 0027 private: 0028 bool exists(const QString &host) const; 0029 bool isResolvable(const QString &host) const; 0030 }; 0031 0032 #endif