File indexing completed on 2024-06-23 05:18:36

0001 /*
0002     SPDX-FileCopyrightText: 2010 Casey Link <unnamedrambler@gmail.com>
0003     SPDX-FileCopyrightText: 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
0004 
0005     Refactored from earlier code by:
0006     SPDX-FileCopyrightText: 2010 Volker Krause <vkrause@kde.org>
0007     SPDX-FileCopyrightText: 2004 Cornelius Schumacher <schumacher@kde.org>
0008 
0009     SPDX-License-Identifier: LGPL-2.0-or-later
0010 */
0011 
0012 #pragma once
0013 
0014 #include "recipientseditor.h"
0015 
0016 class QLabel;
0017 class QPushButton;
0018 
0019 namespace MessageComposer
0020 {
0021 class KWindowPositioner;
0022 
0023 class RecipientsPicker;
0024 
0025 class RecipientsEditorSideWidget : public QWidget
0026 {
0027     Q_OBJECT
0028 public:
0029     explicit RecipientsEditorSideWidget(RecipientsEditor *editor, QWidget *parent);
0030     ~RecipientsEditorSideWidget() override;
0031 
0032     [[nodiscard]] MessageComposer::RecipientsPicker *picker() const;
0033 
0034 public Q_SLOTS:
0035     void setTotal(int recipients, int lines);
0036     void setFocus();
0037     void updateTotalToolTip();
0038     void pickRecipient();
0039 
0040 Q_SIGNALS:
0041     void pickedRecipient(const Recipient &, bool &);
0042     void saveDistributionList();
0043 
0044 private:
0045     RecipientsEditor *const mEditor;
0046     QLabel *mTotalLabel = nullptr;
0047     QPushButton *mDistributionListButton = nullptr;
0048     QPushButton *mSelectButton = nullptr;
0049     /** The RecipientsPicker is lazy loaded, never access it directly,
0050       only through picker() */
0051     mutable MessageComposer::RecipientsPicker *mRecipientPicker = nullptr;
0052     /** lazy loaded, don't access directly, unless you've called picker() */
0053     mutable MessageComposer::KWindowPositioner *mPickerPositioner = nullptr;
0054 };
0055 }