File indexing completed on 2024-11-24 04:39:29

0001 /*
0002     This file is part of Contact Editor.
0003 
0004     SPDX-FileCopyrightText: 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
0005     SPDX-FileCopyrightText: 2016-2020 Laurent Montel <montel.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #pragma once
0011 
0012 #include "customfields_p.h"
0013 #include <QWidget>
0014 class KLineEdit;
0015 class QPushButton;
0016 class QCheckBox;
0017 class QComboBox;
0018 namespace Akonadi
0019 {
0020 class CustomFieldEditorWidget : public QWidget
0021 {
0022     Q_OBJECT
0023 public:
0024     explicit CustomFieldEditorWidget(QWidget *parent = nullptr);
0025     ~CustomFieldEditorWidget() override;
0026     void setReadOnly(bool readOnly);
0027 
0028 Q_SIGNALS:
0029     void addNewField(const CustomField &field);
0030 
0031 private:
0032     void slotAddField();
0033     void slotFielNameChanged(const QString &text);
0034     void fillTypes();
0035     KLineEdit *mFieldName = nullptr;
0036     QPushButton *mAddField = nullptr;
0037     QCheckBox *mUseAllContacts = nullptr;
0038     QComboBox *mFieldType = nullptr;
0039 };
0040 }