1 /*
2     SPDX-FileCopyrightText: 2010 Casey Link <unnamedrambler@gmail.com>
3     SPDX-FileCopyrightText: 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
4 
5     Refactored from earlier code by:
6     SPDX-FileCopyrightText: 2010 Volker Krause <vkrause@kde.org>
7     SPDX-FileCopyrightText: 2004 Cornelius Schumacher <schumacher@kde.org>
8 
9     SPDX-License-Identifier: LGPL-2.0-or-later
10 */
11 
12 #pragma once
13 
14 #include "recipientseditor.h"
15 
16 class QLabel;
17 class QPushButton;
18 
19 namespace MessageComposer
20 {
21 class KWindowPositioner;
22 
23 class RecipientsPicker;
24 
25 class RecipientsEditorSideWidget : public QWidget
26 {
27     Q_OBJECT
28 public:
29     explicit RecipientsEditorSideWidget(RecipientsEditor *editor, QWidget *parent);
30     ~RecipientsEditorSideWidget() override;
31 
32     Q_REQUIRED_RESULT MessageComposer::RecipientsPicker *picker() const;
33 
34 public Q_SLOTS:
35     void setTotal(int recipients, int lines);
36     void setFocus();
37     void updateTotalToolTip();
38     void pickRecipient();
39 
40 Q_SIGNALS:
41     void pickedRecipient(const Recipient &, bool &);
42     void saveDistributionList();
43 
44 private:
45     RecipientsEditor *const mEditor;
46     QLabel *mTotalLabel = nullptr;
47     QPushButton *mDistributionListButton = nullptr;
48     QPushButton *mSelectButton = nullptr;
49     /** The RecipientsPicker is lazy loaded, never access it directly,
50       only through picker() */
51     mutable MessageComposer::RecipientsPicker *mRecipientPicker = nullptr;
52     /** lazy loaded, don't access directly, unless you've called picker() */
53     mutable MessageComposer::KWindowPositioner *mPickerPositioner = nullptr;
54 };
55 }
56 
57