File indexing completed on 2024-12-08 04:34:13
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "lrucache.h" 0010 #include <QString> 0011 #include <QTextDocument> 0012 #include <memory> 0013 0014 class TextSelectionImpl; 0015 class QListView; 0016 0017 class TextUiBase 0018 { 0019 public: 0020 explicit TextUiBase(TextSelectionImpl *textSelectionImpl, QListView *view); 0021 virtual ~TextUiBase(); 0022 0023 protected: 0024 virtual void removeMessageCache(const QString &messageId); 0025 virtual void setCacheMaxEntries(int maxEntries); 0026 virtual void clearCache(); 0027 mutable LRUCache<QString, std::unique_ptr<QTextDocument>> mDocumentCache; 0028 TextSelectionImpl *const mTextSelectionImpl; 0029 QListView *const mListView; 0030 };