File indexing completed on 2024-12-22 05:00:57
0001 /* 0002 This file is part of KTnef. 0003 0004 SPDX-FileCopyrightText: 2002 Michael Goffioul <kdeprint@swing.be> 0005 SPDX-FileCopyrightText: 2012 Allen Winter <winter@kde.org> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 0009 You should have received a copy of the GNU General Public License 0010 along with this program; if not, write to the Free Software Foundation, 0011 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 0012 */ 0013 0014 #pragma once 0015 0016 #include "ui_attachpropertywidgetbase.h" 0017 0018 #include <QDialog> 0019 0020 #include <QMap> 0021 #include <QPixmap> 0022 0023 namespace KTnef 0024 { 0025 class KTNEFAttach; 0026 class KTNEFProperty; 0027 class KTNEFPropertySet; 0028 } 0029 using namespace KTnef; 0030 0031 class QTreeWidget; 0032 class QTreeWidgetItem; 0033 0034 class AttachPropertyDialog : public QDialog 0035 { 0036 Q_OBJECT 0037 public: 0038 explicit AttachPropertyDialog(QWidget *parent = nullptr); 0039 ~AttachPropertyDialog() override; 0040 0041 void setAttachment(KTNEFAttach *attach); 0042 0043 static QPixmap loadRenderingPixmap(KTNEFPropertySet *, const QColor &); 0044 static void formatProperties(const QMap<int, KTNEFProperty *> &, QTreeWidget *, QTreeWidgetItem *, const QString & = QStringLiteral("prop")); 0045 static void formatPropertySet(KTNEFPropertySet *, QTreeWidget *); 0046 static bool saveProperty(QTreeWidget *, KTNEFPropertySet *, QWidget *); 0047 0048 protected: 0049 Ui::AttachPropertyWidgetBase mUI; 0050 0051 private: 0052 void slotSave(); 0053 void readConfig(); 0054 void writeConfig(); 0055 KTNEFAttach *mAttach = nullptr; 0056 };