File indexing completed on 2024-05-05 16:18:16
0001 /* 0002 SPDX-FileCopyrightText: 2017-18 Friedrich W. H. Kossebau <kossebau@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KATE_ANNOTATIONITEMDELEGATE_H 0008 #define KATE_ANNOTATIONITEMDELEGATE_H 0009 0010 #include <ktexteditor/abstractannotationitemdelegate.h> 0011 0012 namespace KTextEditor 0013 { 0014 class ViewPrivate; 0015 } 0016 class KateViewInternal; 0017 0018 class KateAnnotationItemDelegate : public KTextEditor::AbstractAnnotationItemDelegate 0019 { 0020 Q_OBJECT 0021 0022 public: 0023 explicit KateAnnotationItemDelegate(QObject *parent); 0024 ~KateAnnotationItemDelegate() override; 0025 0026 public: 0027 void paint(QPainter *painter, const KTextEditor::StyleOptionAnnotationItem &option, KTextEditor::AnnotationModel *model, int line) const override; 0028 bool helpEvent(QHelpEvent *event, 0029 KTextEditor::View *view, 0030 const KTextEditor::StyleOptionAnnotationItem &option, 0031 KTextEditor::AnnotationModel *model, 0032 int line) override; 0033 void hideTooltip(KTextEditor::View *view) override; 0034 QSize sizeHint(const KTextEditor::StyleOptionAnnotationItem &option, KTextEditor::AnnotationModel *model, int line) const override; 0035 0036 private: 0037 0038 mutable qreal m_maxCharWidth = 0.0; 0039 mutable QFontMetricsF m_cachedDataContentFontMetrics; 0040 }; 0041 0042 #endif