File indexing completed on 2024-05-12 16:16:00

0001 /*
0002    SPDX-FileCopyrightText: 2022-2023 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #pragma once
0007 #include "textgrammarcheck_export.h"
0008 #include <QDebug>
0009 #include <QString>
0010 #include <QStringList>
0011 
0012 namespace TextGrammarCheck
0013 {
0014 class TEXTGRAMMARCHECK_EXPORT GrammarAction
0015 {
0016 public:
0017     GrammarAction();
0018 
0019     Q_REQUIRED_RESULT QString replacement() const;
0020     void setReplacement(const QString &replacement);
0021 
0022     Q_REQUIRED_RESULT int start() const;
0023     void setStart(int start);
0024 
0025     Q_REQUIRED_RESULT int length() const;
0026     void setLength(int length);
0027 
0028     Q_REQUIRED_RESULT QStringList suggestions() const;
0029     void setSuggestions(const QStringList &suggestions);
0030 
0031     Q_REQUIRED_RESULT int blockId() const;
0032     void setBlockId(int blockId);
0033 
0034     Q_REQUIRED_RESULT QStringList infoUrls() const;
0035     void setInfoUrls(const QStringList &urls);
0036 
0037 private:
0038     QStringList mSuggestions;
0039     QStringList mInfoUrls;
0040     QString mReplacement;
0041     int mStart = -1;
0042     int mLength = -1;
0043     int mBlockId = -1;
0044 };
0045 }
0046 Q_DECLARE_METATYPE(TextGrammarCheck::GrammarAction)
0047 TEXTGRAMMARCHECK_EXPORT QDebug operator<<(QDebug d, const TextGrammarCheck::GrammarAction &t);