File indexing completed on 2024-06-23 05:48:46

0001 /*
0002     This file is part of the Okteta Kasten module, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 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_CHECKSUMVIEW_HPP
0010 #define KASTEN_CHECKSUMVIEW_HPP
0011 
0012 // Kasten gui
0013 #include <Kasten/AbstractToolWidget>
0014 
0015 class AbstractByteArrayChecksumParameterSet;
0016 
0017 class KComboBox;
0018 class QLineEdit;
0019 class QAction;
0020 
0021 class QStackedWidget;
0022 
0023 namespace Kasten {
0024 
0025 class ChecksumTool;
0026 
0027 class ChecksumView : public AbstractToolWidget
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit ChecksumView(ChecksumTool* tool, QWidget* parent = nullptr);
0033     ~ChecksumView() override;
0034 
0035 public:
0036     ChecksumTool* tool() const;
0037 
0038 private:
0039     void getParameterSet(AbstractByteArrayChecksumParameterSet* parameterSet) const;
0040 
0041 private:
0042     void addAlgorithms();
0043 
0044 private Q_SLOTS: // gui
0045 //     void setDirty( bool dirty );
0046     void onOperationChange(int index);
0047 
0048 private Q_SLOTS: // tool
0049     void onAlgorithmChanged(int algorithmId);
0050     void onChecksumUptodateChanged(bool checksumUptodate);
0051     void onApplyableChanged(bool isApplyable);
0052     void onValuesChanged();
0053     void onValidityChanged(bool isValid);
0054 
0055 private:
0056     ChecksumTool* mTool;
0057 
0058     KComboBox* mAlgorithmComboBox;
0059     QStackedWidget* mParameterSetEditStack;
0060     QLineEdit* mChecksumLabel;
0061     QAction* mCalculateAction;
0062 };
0063 
0064 inline ChecksumTool* ChecksumView::tool() const { return mTool; }
0065 
0066 }
0067 
0068 #endif