KIO

kshorturifilter.h
1/*
2 kshorturifilter.h
3
4 This file is part of the KDE project
5 SPDX-FileCopyrightText: 2000 Dawit Alemayehu <adawit@kde.org>
6 SPDX-FileCopyrightText: 2000 Malte Starostik <starosti@zedat.fu-berlin.de>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10
11#ifndef KSHORTURIFILTER_H
12#define KSHORTURIFILTER_H
13
14#include <QList>
15#include <QRegularExpression>
16
17#include "kurifilterplugin_p.h"
18#include <kurifilter.h>
19
20/**
21 * This is short URL filter class.
22 *
23 * @short A filter that converts short URLs into fully qualified ones.
24 *
25 * @author Dawit Alemayehu <adawit@kde.org>
26 * @author Malte Starostik <starosti@zedat.fu-berlin.de>
27 */
28class KShortUriFilter : public KUriFilterPlugin
29{
30 Q_OBJECT
31public:
32 explicit KShortUriFilter(QObject *parent, const KPluginMetaData &data);
33
34 /**
35 * Converts short URIs into fully qualified valid URIs
36 * whenever possible.
37 *
38 * Parses any given invalid URI to determine whether it
39 * is a known short URI and converts it to its fully
40 * qualified version.
41 *
42 * @param data the data to be filtered
43 * @return true if the url has been filtered
44 */
45 bool filterUri(KUriFilterData &data) const override;
46
47public Q_SLOTS:
48 void configure();
49
50private:
51 struct URLHint {
52 URLHint()
53 {
54 }
55
57 : hintRe(r)
58 , prepend(p)
59 , type(t)
60 {
61 }
62
63 QRegularExpression hintRe; // if this matches, then...
64 QString prepend; // ...prepend this to the url
66 };
67
68 QList<URLHint> m_urlHints;
69 QString m_strDefaultUrlScheme;
70};
71
72#endif
This is short URL filter class.
bool filterUri(KUriFilterData &data) const override
Converts short URIs into fully qualified valid URIs whenever possible.
This class is a basic messaging class used to exchange filtering information between the filter plugi...
Definition kurifilter.h:153
UriTypes
Describes the type of the URI that was filtered.
Definition kurifilter.h:158
@ NetProtocol
Any network protocol: http, ftp, nttp, pop3, etc...
Definition kurifilter.h:159
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.