File indexing completed on 2024-04-28 05:34:16
0001 // SPDX-FileCopyrightText: 2014 Sven Brauch <svenbrauch@gmail.com> 0002 // 0003 // SPDX-License-Identifier: LGPL-2.1-or-later 0004 0005 #ifndef PLASMAPASS_ABBREVIATIONS_H 0006 #define PLASMAPASS_ABBREVIATIONS_H 0007 0008 #include <QStringList> 0009 #include <QVector> 0010 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0011 class QStringRef; 0012 #endif 0013 class QString; 0014 0015 namespace PlasmaPass 0016 { 0017 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0018 bool matchesAbbreviation(const QStringRef &word, const QStringRef &typed); 0019 #else 0020 bool matchesAbbreviation(const QStringView &word, const QStringView &typed); 0021 #endif 0022 0023 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0024 bool matchesPath(const QStringRef &path, const QStringRef &typed); 0025 #else 0026 bool matchesPath(const QStringView &path, const QStringView &typed); 0027 #endif 0028 0029 /** 0030 * @brief Matches a path against a list of search fragments. 0031 * @return -1 when no match is found, otherwise a positive integer, higher values mean lower quality 0032 */ 0033 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0034 int matchPathFilter(const QVector<QStringRef> &toFilter, const QVector<QStringRef> &text); 0035 #else 0036 int matchPathFilter(const QVector<QStringView> &toFilter, const QVector<QStringView> &text); 0037 #endif 0038 } 0039 0040 #endif