Warning, file /utilities/okteta/kasten/gui/liboktetawidgets/bytearraycombobox_p.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     This file is part of the Okteta Kasten module, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2009, 2011 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_BYTEARRAYCOMBOBOX_P_HPP
0010 #define KASTEN_BYTEARRAYCOMBOBOX_P_HPP
0011 
0012 // lib
0013 #include "bytearraycombobox.hpp"
0014 #include "bytearrayvalidator.hpp"
0015 // KF
0016 #include <KComboBox>
0017 // Qt
0018 #include <QByteArray>
0019 
0020 namespace Okteta {
0021 
0022 class ByteArrayComboBoxPrivate
0023 {
0024 public:
0025     explicit ByteArrayComboBoxPrivate(ByteArrayComboBox* parent);
0026     ByteArrayComboBoxPrivate(const ByteArrayComboBoxPrivate&) = delete;
0027 
0028     ~ByteArrayComboBoxPrivate() = default;
0029 
0030     ByteArrayComboBoxPrivate& operator=(const ByteArrayComboBoxPrivate&) = delete;
0031 
0032 public:
0033     QByteArray byteArray() const;
0034     int format() const;
0035     int maxLength() const;
0036     int minLength() const;
0037 
0038 public:
0039     void init();
0040     void setByteArray(const QByteArray& byteArray);
0041     void setFormat(ByteArrayComboBox::Coding codecId);
0042     void setCharCodec(const QString& charCodecName);
0043     void setMaxLength(int maxLength);
0044     void setMinLength(int minLength);
0045     void rememberCurrentByteArray();
0046 
0047     void onFormatChanged(int index);
0048     void onValueEdited(const QString& value);
0049     void onValueActivated(int index);
0050 
0051 private:
0052     ByteArrayComboBox* const q_ptr;
0053     Q_DECLARE_PUBLIC(ByteArrayComboBox)
0054 
0055     KComboBox * mFormatComboBox;
0056     KComboBox* mValueComboBox;
0057 
0058     ByteArrayValidator* mValidator;
0059 };
0060 
0061 inline ByteArrayComboBoxPrivate::ByteArrayComboBoxPrivate(ByteArrayComboBox* parent)
0062     : q_ptr(parent)
0063 {}
0064 
0065 inline QByteArray ByteArrayComboBoxPrivate::byteArray() const
0066 {
0067     return mValidator->toByteArray(mValueComboBox->currentText());
0068 }
0069 inline int ByteArrayComboBoxPrivate::format() const
0070 {
0071     return mFormatComboBox->currentIndex();
0072 }
0073 
0074 }
0075 
0076 #endif