File indexing completed on 2024-12-08 10:25:56

0001 /*
0002    SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libruqolacore_export.h"
0010 #include <QMap>
0011 #include <QString>
0012 #include <QStringList>
0013 #include <QVector>
0014 
0015 class EmojiManager;
0016 class Message;
0017 class MessageCache;
0018 
0019 namespace TextConverter
0020 {
0021 struct LIBRUQOLACORE_EXPORT ConvertMessageTextSettings {
0022     ConvertMessageTextSettings(const QString &_str,
0023                                const QString &_userName,
0024                                const QVector<Message> &_allMessages,
0025                                const QStringList &_highlightWords,
0026                                EmojiManager *_emojiManager,
0027                                MessageCache *_messageCache,
0028                                const QMap<QString, QString> &_mentions,
0029                                const QMap<QString, QString> &_channels,
0030                                const QString &_searchedText = {},
0031                                int _maximumRecursiveQuotedText = -1)
0032         : str(_str)
0033         , userName(_userName)
0034         , allMessages(_allMessages)
0035         , highlightWords(_highlightWords)
0036         , emojiManager(_emojiManager)
0037         , messageCache(_messageCache)
0038         , mentions(_mentions)
0039         , channels(_channels)
0040         , searchedText(_searchedText)
0041         , maximumRecursiveQuotedText(_maximumRecursiveQuotedText)
0042     {
0043     }
0044     const QString str;
0045     const QString userName;
0046     const QVector<Message> allMessages;
0047     const QStringList highlightWords;
0048     EmojiManager *const emojiManager;
0049     MessageCache *const messageCache;
0050     const QMap<QString, QString> mentions;
0051     const QMap<QString, QString> channels;
0052     const QString searchedText;
0053     int maximumRecursiveQuotedText = -1;
0054 };
0055 
0056 [[nodiscard]] LIBRUQOLACORE_EXPORT QString convertMessageText(const ConvertMessageTextSettings &settings, QString &needUpdateMessageId, int &recusiveIndex);
0057 }