Akonadi Contacts

maillistwidget.cpp
1 /*
2  This file is part of Contact Editor.
3 
4  SPDX-FileCopyrightText: 2016 eyeOS S.L.U., a Telefonica company, [email protected]
5  SPDX-FileCopyrightText: 2016-2020 Laurent Montel <montel.org>
6 
7  SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9 
10 #include "maillistwidget.h"
11 #include "mailwidgetlister.h"
12 #include <KContacts/Addressee>
13 #include <KLocalizedString>
14 #include <QLabel>
15 #include <QVBoxLayout>
16 using namespace ContactEditor;
17 
18 MailListWidget::MailListWidget(QWidget *parent)
19  : QWidget(parent)
20  , mMailWidgetLister(new ContactEditor::MailWidgetLister(this))
21 {
22  auto topLayout = new QVBoxLayout(this);
23  topLayout->setContentsMargins({});
24  topLayout->setSpacing(0);
25 
26  auto label = new QLabel(i18n("Email"), this);
27  label->setObjectName(QStringLiteral("emaillistlabel"));
28  topLayout->addWidget(label);
29 
30  mMailWidgetLister->setObjectName(QStringLiteral("emailwidgetlister"));
31  topLayout->addWidget(mMailWidgetLister);
32 }
33 
34 MailListWidget::~MailListWidget() = default;
35 
36 void MailListWidget::loadContact(const KContacts::Addressee &contact)
37 {
38  mMailWidgetLister->loadContact(contact);
39 }
40 
41 void MailListWidget::storeContact(KContacts::Addressee &contact) const
42 {
43  mMailWidgetLister->storeContact(contact);
44 }
45 
46 void MailListWidget::setReadOnly(bool readOnly)
47 {
48  mMailWidgetLister->setReadOnly(readOnly);
49 }
QString i18n(const char *text, const TYPE &arg...)
QString label(StandardShortcut id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Apr 1 2023 04:09:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.