File indexing completed on 2024-04-21 04:55:27

0001 /*
0002     This file is part of Choqok, the KDE micro-blogging client
0003 
0004     SPDX-FileCopyrightText: 2008-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com>
0005     SPDX-FileCopyrightText: 2014 Andrea Scarpino <scarpino@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0008 */
0009 
0010 #ifndef URLUTILS_H
0011 #define URLUTILS_H
0012 
0013 #include <QObject>
0014 #include <QStringList>
0015 
0016 #include "choqok_export.h"
0017 
0018 class CHOQOK_EXPORT UrlUtils : public QObject
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     UrlUtils();
0024     ~UrlUtils();
0025 
0026     static QStringList detectUrls(const QString &text);
0027     static QString detectEmails(const QString &text);
0028 
0029 private:
0030     static const QRegExp mUrlRegExp;
0031     static const QRegExp mEmailRegExp;
0032 };
0033 
0034 #endif // URLUTILS_H