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

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 <QWidget>
0013 
0014 #include "akonadi_contact_widgets_private_export.h"
0015 
0016 class QToolButton;
0017 
0018 namespace KContacts
0019 {
0020 class Impp;
0021 }
0022 
0023 namespace Akonadi
0024 {
0025 class PreferredLineEditWidget;
0026 class ContactEditorComboBox;
0027 class AKONADI_CONTACT_WIDGETS_TESTS_EXPORT MessagingWidget : public QWidget
0028 {
0029     Q_OBJECT
0030 public:
0031     explicit MessagingWidget(QWidget *parent = nullptr);
0032     ~MessagingWidget() override;
0033 
0034     void updateAddRemoveButton(bool addButtonEnabled);
0035     KContacts::Impp imAddress() const;
0036     void setIMAddress(const KContacts::Impp &address);
0037     void setPreferred(bool b);
0038     void clearWidget();
0039     void setReadOnly(bool readOnly);
0040 Q_SIGNALS:
0041     void addWidget(Akonadi::MessagingWidget *);
0042     void removeWidget(Akonadi::MessagingWidget *);
0043     void preferredChanged(Akonadi::MessagingWidget *);
0044 
0045 private:
0046     void slotAddMessaging();
0047     void slotRemoveMessaging();
0048     void slotPreferredChanged();
0049     PreferredLineEditWidget *mMessagingEdit = nullptr;
0050     QToolButton *mAddButton = nullptr;
0051     QToolButton *mRemoveButton = nullptr;
0052     Akonadi::ContactEditorComboBox *mProtocolCombo = nullptr;
0053 };
0054 }