File indexing completed on 2024-05-12 09:56:58

0001 /*
0002     SPDX-FileCopyrightText: 2007-2008 Robert Knight <robertknight@gmail.com>
0003     SPDX-FileCopyrightText: 2020 Tomaz Canabrava <tcanabrava@gmail.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef URLFILTER_H
0009 #define URLFILTER_H
0010 
0011 #include "RegExpFilter.h"
0012 #include "konsoleprivate_export.h"
0013 
0014 namespace Konsole
0015 {
0016 /** A filter which matches URLs in blocks of text */
0017 
0018 // Exported for unittests
0019 class KONSOLEPRIVATE_EXPORT UrlFilter : public RegExpFilter
0020 {
0021 public:
0022     UrlFilter();
0023 
0024 protected:
0025     QSharedPointer<HotSpot> newHotSpot(int beginRow, int beginColumn, int endRow, int endColumn, const QStringList &list) override;
0026 
0027 public:
0028     static const QRegularExpression FullUrlRegExp;
0029     static const QRegularExpression EmailAddressRegExp;
0030 
0031     // combined OR of FullUrlRegExp and EmailAddressRegExp
0032     static const QRegularExpression CompleteUrlRegExp;
0033 };
0034 
0035 }
0036 #endif