File indexing completed on 2024-04-28 15:30:18

0001 /*
0002     SPDX-FileCopyrightText: 2007 David Nolden <david.nolden.kdevelop@art-master.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KATEARGUMENTHINTTREE_H
0008 #define KATEARGUMENTHINTTREE_H
0009 
0010 #include <QTextDocument>
0011 #include <QTreeView>
0012 
0013 class KateCompletionWidget;
0014 class KateArgumentHintModel;
0015 class QRect;
0016 
0017 class KateArgumentHintTree : public QTreeView
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit KateArgumentHintTree(KateCompletionWidget *parent);
0022 
0023     // Navigation
0024     bool nextCompletion();
0025     bool previousCompletion();
0026     bool pageDown();
0027     bool pageUp();
0028     void top();
0029     void bottom();
0030 
0031     // Returns the total size of all columns
0032     int resizeColumns();
0033 
0034     void clearCompletion();
0035 public Q_SLOTS:
0036     void updateGeometry();
0037     void updateGeometry(QRect rect);
0038 
0039     KateArgumentHintModel *model() const;
0040 
0041 protected:
0042     void paintEvent(QPaintEvent *event) override;
0043     void rowsInserted(const QModelIndex &parent, int start, int end) override;
0044 
0045 private:
0046     uint rowHeight(const QModelIndex &index) const;
0047     int sizeHintForColumn(int column) const override;
0048 
0049     KateCompletionWidget *m_parent;
0050 };
0051 
0052 #endif