File indexing completed on 2024-05-12 16:02:26

0001 /*
0002     SPDX-FileCopyrightText: 2021 Waqar Ahmed <waqar.17a@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #include <QList>
0007 #include <QMenu>
0008 
0009 class QTreeView;
0010 class QLineEdit;
0011 class CommandModel;
0012 class QAction;
0013 class CommandBarFilterModel;
0014 class KisKActionCollection;
0015 
0016 #include <kritawidgetutils_export.h>
0017 
0018 class KRITAWIDGETUTILS_EXPORT KateCommandBar : public QMenu
0019 {
0020     Q_OBJECT
0021 public:
0022     KateCommandBar(QWidget *parent = nullptr);
0023 
0024     void updateBar(const QList<KisKActionCollection *> &actions, int totalActions);
0025 
0026     void updateViewGeometry();
0027 
0028 protected:
0029     bool eventFilter(QObject *obj, QEvent *event) override;
0030 
0031 private Q_SLOTS:
0032     void slotReturnPressed();
0033     void reselectFirst();
0034 
0035 private:
0036     QTreeView *m_treeView;
0037     QLineEdit *m_lineEdit;
0038     CommandModel *m_model;
0039     CommandBarFilterModel *m_proxyModel;
0040     QVector<KisKActionCollection *> m_disposableActionCollections;
0041 };