File indexing completed on 2024-05-12 05:43:34
0001 /* 0002 Copyright (C) 2015 Volker Krause <vkrause@kde.org> 0003 0004 This program is free software; you can redistribute it and/or modify it 0005 under the terms of the GNU Library General Public License as published by 0006 the Free Software Foundation; either version 2 of the License, or (at your 0007 option) any later version. 0008 0009 This program is distributed in the hope that it will be useful, but WITHOUT 0010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 0012 License for more details. 0013 0014 You should have received a copy of the GNU General Public License 0015 along with this program. If not, see <https://www.gnu.org/licenses/>. 0016 */ 0017 0018 #ifndef ELFSTRUCTUREVIEW_H 0019 #define ELFSTRUCTUREVIEW_H 0020 0021 #include <QVector> 0022 #include <QWidget> 0023 0024 #include <memory> 0025 0026 namespace Ui { 0027 class ElfStructureView; 0028 } 0029 0030 class ElfModel; 0031 class QItemSelection; 0032 class QSortFilterProxyModel; 0033 class QUrl; 0034 0035 class ElfStructureView : public QWidget 0036 { 0037 Q_OBJECT 0038 public: 0039 explicit ElfStructureView(QWidget* parent = nullptr); 0040 ~ElfStructureView(); 0041 0042 void setModel(ElfModel* model); 0043 0044 protected: 0045 bool eventFilter(QObject* receiver, QEvent* event) override; 0046 0047 private slots: 0048 void selectionChanged(const QItemSelection& selection); 0049 void anchorClicked(const QUrl &url); 0050 0051 private: 0052 void updateActionState(); 0053 void selectUrl(const QUrl &url); 0054 0055 std::unique_ptr<Ui::ElfStructureView> ui; 0056 ElfModel *m_elfModel = nullptr; 0057 QSortFilterProxyModel* m_proxy; 0058 QVector<QUrl> m_history; 0059 int m_historyIndex = -1; 0060 bool m_historyLock = false; 0061 }; 0062 0063 #endif // ELFSTRUCTUREVIEW_H