Akonadi Contacts

messaginglistwidget.cpp
1/*
2 This file is part of Contact Editor.
3
4 SPDX-FileCopyrightText: 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
5 SPDX-FileCopyrightText: 2016-2020 Laurent Montel <montel.org>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8*/
9
10#include "messaginglistwidget.h"
11#include "messagingwidgetlister.h"
12#include <KContacts/Addressee>
13#include <KLocalizedString>
14#include <QLabel>
15#include <QVBoxLayout>
16using namespace Akonadi;
17
18MessagingListWidget::MessagingListWidget(QWidget *parent)
19 : QWidget(parent)
20 , mMessagingWidgetLister(new Akonadi::MessagingWidgetLister(this))
21{
22 auto topLayout = new QVBoxLayout(this);
23 topLayout->setContentsMargins({});
24 topLayout->setSpacing(0);
25
26 auto label = new QLabel(i18nc("@label:textbox", "Messaging"), this);
27 label->setObjectName(QLatin1StringView("messaginglistlabel"));
28 topLayout->addWidget(label);
29 mMessagingWidgetLister->setObjectName(QLatin1StringView("messagingwidgetlister"));
30 topLayout->addWidget(mMessagingWidgetLister);
31}
32
33MessagingListWidget::~MessagingListWidget() = default;
34
35void MessagingListWidget::loadContact(const KContacts::Addressee &contact)
36{
37 mMessagingWidgetLister->loadContact(contact);
38}
39
40void MessagingListWidget::storeContact(KContacts::Addressee &contact) const
41{
42 mMessagingWidgetLister->storeContact(contact);
43}
44
45void MessagingListWidget::setReadOnly(bool readOnly)
46{
47 mMessagingWidgetLister->setReadOnly(readOnly);
48}
49
50#include "moc_messaginglistwidget.cpp"
QString i18nc(const char *context, const char *text, const TYPE &arg...)
A widget for editing the display name of a contact.
QString label(StandardShortcut id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:08 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.