File indexing completed on 2025-01-05 05:23:48

0001 /*
0002     This file is part of the Okteta Kasten Framework, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2009, 2012 Alex Richardson <alex.richardson@gmx.de>
0005     SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0008 */
0009 
0010 #ifndef KASTEN_STRUCTUREVIEW_HPP
0011 #define KASTEN_STRUCTUREVIEW_HPP
0012 
0013 #include "structureviewitemdelegate.hpp"
0014 // Qt
0015 #include <QWidget>
0016 
0017 namespace Okteta {
0018 class AbstractByteArrayModel;
0019 }
0020 
0021 class QTreeView;
0022 class QAction;
0023 
0024 namespace Kasten {
0025 class StructuresTool;
0026 class StructureTreeModel;
0027 
0028 class StructureView : public QWidget
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033     explicit StructureView(StructuresTool* tool, QWidget* parent = nullptr);
0034     ~StructureView() override;
0035 
0036 public:
0037     StructuresTool* tool() const;
0038     bool eventFilter(QObject* object, QEvent* event) override;
0039 
0040 private Q_SLOTS:
0041     void openSettingsDlg();
0042     void openScriptConsole();
0043     void onCurrentRowChanged(const QModelIndex& current, const QModelIndex& previous);
0044     void onLockButtonClicked(bool checked);
0045     void onLockButtonToggled(bool checked);
0046     void onByteArrayModelChanged(Okteta::AbstractByteArrayModel* model);
0047     void onCustomContextMenuRequested(QPoint pos);
0048 
0049 private:
0050     void setLockButtonState(const QModelIndex& current);
0051     void editData();
0052     void selectBytesInView();
0053     void copyToClipboard();
0054 
0055 private:
0056     StructuresTool* mTool;
0057 
0058     StructureTreeModel* mStructureTreeModel;
0059 
0060     StructureViewItemDelegate* mDelegate;
0061 
0062     QTreeView* mStructTreeView;
0063 
0064     QAction* mValidateAction;
0065     QAction* mSettingsAction;
0066     QAction* mScriptConsoleAction;
0067     QAction* mLockStructureAction;
0068 
0069     QWidget* mStructTreeViewFocusChild;
0070 };
0071 
0072 }
0073 
0074 #endif