File indexing completed on 2024-05-26 05:56:27

0001 /*
0002     This file is part of the Okteta Kasten module, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2008-2009 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef KASTEN_FILTERVIEW_HPP
0010 #define KASTEN_FILTERVIEW_HPP
0011 
0012 // Kasten gui
0013 #include <Kasten/AbstractToolWidget>
0014 
0015 class AbstractByteArrayFilterParameterSet;
0016 
0017 class KComboBox;
0018 
0019 class QStackedWidget;
0020 class QString;
0021 class QAction;
0022 
0023 namespace Kasten {
0024 
0025 class FilterTool;
0026 
0027 class FilterView : public AbstractToolWidget
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit FilterView(FilterTool* tool, QWidget* parent = nullptr);
0033     ~FilterView() override;
0034 
0035 public:
0036     FilterTool* tool() const;
0037 
0038 private: // get
0039     void getParameterSet(AbstractByteArrayFilterParameterSet* parameterSet) const;
0040 
0041 private: // separation
0042     void addFilters();
0043 
0044 private Q_SLOTS:
0045     void onFilterChanged(int filterId);
0046     void onFilterClicked();
0047     void onOperationChange(int index);
0048     void onHasWriteableChanged(bool hasWriteable);
0049     void onCharCodecChanged(const QString& charCodecName);
0050     void onValuesChanged();
0051     void onValidityChanged(bool isValid);
0052 
0053 private:
0054     FilterTool* mTool;
0055     KComboBox* mOperationComboBox;
0056     QStackedWidget* mParameterSetEditStack;
0057     QAction* mFilterAction;
0058 };
0059 
0060 inline FilterTool* FilterView::tool() const { return mTool; }
0061 
0062 }
0063 
0064 #endif