Messagelib

recipientline.h
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 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#pragma once
9
10#include <QSharedPointer>
11
12#include "MessageComposer/Recipient"
13
14#include <Libkdepim/MultiplyingLine>
15#include <MessageComposer/ComposerLineEdit>
16
17#include <QComboBox>
18
19namespace MessageComposer
20{
21class RecipientComboBox : public QComboBox
22{
24public:
25 explicit RecipientComboBox(QWidget *parent);
26
28 void rightPressed();
29
30protected:
31 void keyPressEvent(QKeyEvent *ev) override;
32};
33/**
34 * @brief The RecipientLineEdit class
35 */
36class MESSAGECOMPOSER_EXPORT RecipientLineEdit : public MessageComposer::ComposerLineEdit
37{
38 Q_OBJECT
39public:
40 explicit RecipientLineEdit(QWidget *parent);
41
42Q_SIGNALS:
43 void deleteMe();
44 void leftPressed();
45 void rightPressed();
46
47protected:
48 void keyPressEvent(QKeyEvent *ev) override;
49};
50
51/**
52 * @brief The RecipientLineNG class
53 */
54class MESSAGECOMPOSER_EXPORT RecipientLineNG : public KPIM::MultiplyingLine
55{
56 Q_OBJECT
57public:
58 explicit RecipientLineNG(QWidget *parent);
59 ~RecipientLineNG() override = default;
60
61 void activate() override;
62 [[nodiscard]] bool isActive() const override;
63
64 [[nodiscard]] bool isEmpty() const override;
65 void clear() override;
66 [[nodiscard]] bool canDeleteLineEdit() const override;
67
68 [[nodiscard]] bool isModified() const override;
69 void clearModified() override;
70
71 [[nodiscard]] KPIM::MultiplyingLineData::Ptr data() const override;
72 void setData(const KPIM::MultiplyingLineData::Ptr &data) override;
73
74 void fixTabOrder(QWidget *previous) override;
75 [[nodiscard]] QWidget *tabOut() const override;
76
77 void setCompletionMode(KCompletion::CompletionMode mode) override;
78
79 [[nodiscard]] int setColumnWidth(int w) override;
80
81 // recipient specific methods
82 [[nodiscard]] int recipientsCount() const;
83
84 void setRecipientType(Recipient::Type);
85 [[nodiscard]] Recipient::Type recipientType() const;
86 [[nodiscard]] QSharedPointer<Recipient> recipient() const;
87
88 void setIcon(const QIcon &icon, const QString &tooltip = QString());
89
90 /**
91 * Sets the config file used for storing recent addresses.
92 */
93 void setRecentAddressConfig(KConfig *config);
94
95 void setEnableIndexSearch(bool enableIndexSearch);
96 [[nodiscard]] bool enableIndexSearch() const;
97
98 void setEnableAkonadiSearch(bool enableAkonadiSearch);
99 [[nodiscard]] bool enableAkonadiSearch() const;
100
101 [[nodiscard]] QString rawData() const;
102
103Q_SIGNALS:
104 void typeModified(RecipientLineNG *);
105 void addRecipient(RecipientLineNG *, const QString &);
106 void countChanged();
107 void iconClicked();
108 void activeChanged();
109
110protected Q_SLOTS:
111 void slotEditingFinished();
112 void slotTypeModified();
113 void analyzeLine(const QString &);
114
115protected:
116 bool eventFilter(QObject *watched, QEvent *event) override;
117
118private:
119 MESSAGECOMPOSER_NO_EXPORT void dataFromFields();
120 MESSAGECOMPOSER_NO_EXPORT void fieldsFromData();
121 MESSAGECOMPOSER_NO_EXPORT void slotAddRecipient(const QString &);
122 RecipientComboBox *const mCombo;
123 RecipientLineEdit *const mEdit;
124 int mRecipientsCount = 0;
125 bool mModified = false;
127};
128}
The ComposerLineEdit class.
The RecipientLineEdit class.
The RecipientLineNG class.
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.