MessageComposer::RecipientsEditor Class

The RecipientsEditor class. More...

Header: #include <MessageComposer/RecipientsEditor>
CMake: find_package(KPim6MessageComposer REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::MessageComposer)

Public Functions

RecipientsEditor(QWidget *parent = nullptr)
RecipientsEditor(MessageComposer::RecipientLineFactory *lineFactory, QWidget *parent = nullptr)
virtual ~RecipientsEditor() override
QSharedPointer<MessageComposer::Recipient> activeRecipient() const
MessageComposer::RecipientsPicker *picker() const
QString recipientString(MessageComposer::Recipient::Type) const
QStringList recipientStringList(MessageComposer::Recipient::Type) const
Recipient::List recipients() const
void saveDistributionList()
void selectRecipients()
bool setRecipientString(const QList<KMime::Types::Mailbox> &mailboxes, MessageComposer::Recipient::Type)

Signals

void focusInRecipientLineEdit()

Protected Slots

void addRecipient(MessageComposer::RecipientLineNG *, const QString &)
void slotCalculateTotal()
void slotLineAdded(KPIM::MultiplyingLine *)
void slotLineDeleted(int pos)
void slotPickedRecipient(const MessageComposer::Recipient &, bool &tooManyAddress)

Detailed Description

Member Function Documentation

[explicit] RecipientsEditor::RecipientsEditor(QWidget *parent = nullptr)

Constructs a RecipientsEditor. parent The parent widget.

[explicit] RecipientsEditor::RecipientsEditor(MessageComposer::RecipientLineFactory *lineFactory, QWidget *parent = nullptr)

Constructs a RecipientsEditor with a custom line factory. lineFactory The factory for creating recipient lines. parent The parent widget.

[override virtual noexcept] RecipientsEditor::~RecipientsEditor()

Destroys the RecipientsEditor.

QSharedPointer<MessageComposer::Recipient> RecipientsEditor::activeRecipient() const

Returns the currently active recipient line.

[protected slot] void RecipientsEditor::addRecipient(MessageComposer::RecipientLineNG *, const QString &)

Note: This slot is overloaded. To connect to this slot:

// Connect using qOverload:
connect(sender, &SenderClass::signal,
        recipientsEditor, qOverload(&RecipientsEditor::addRecipient));

// Or using a lambda as wrapper:
connect(sender, &SenderClass::signal,
        recipientsEditor, [receiver = recipientsEditor](MessageComposer::RecipientLineNG *, const QString &) { receiver->addRecipient(arg1, arg2); });
For more examples and approaches, see connecting to overloaded slots.

[signal] void RecipientsEditor::focusInRecipientLineEdit()

MessageComposer::RecipientsPicker *RecipientsEditor::picker() const

Returns the recipients picker dialog.

QString RecipientsEditor::recipientString(MessageComposer::Recipient::Type) const

Returns the recipient string for the given type. type The recipient type. Returns The recipients as a formatted string.

See also setRecipientString().

QStringList RecipientsEditor::recipientStringList(MessageComposer::Recipient::Type) const

Returns the list of recipient strings for the given type. type The recipient type. Returns The recipients as a string list.

Recipient::List RecipientsEditor::recipients() const

Returns the list of all recipients in the editor.

void RecipientsEditor::saveDistributionList()

Saves the current recipients as a distribution list.

void RecipientsEditor::selectRecipients()

Opens the recipient picker dialog.

bool RecipientsEditor::setRecipientString(const QList<KMime::Types::Mailbox> &mailboxes, MessageComposer::Recipient::Type)

Sets the recipients from a list of mailboxes. mailboxes The list of mailboxes to add. type The recipient type (To, Cc, Bcc). Returns True if successful.

See also recipientString().

[protected slot] void RecipientsEditor::slotCalculateTotal()

[protected slot] void RecipientsEditor::slotLineAdded(KPIM::MultiplyingLine *)

[protected slot] void RecipientsEditor::slotLineDeleted(int pos)

[protected slot] void RecipientsEditor::slotPickedRecipient(const MessageComposer::Recipient &, bool &tooManyAddress)