Akonadi Contacts

weblistwidget.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 "weblistwidget.h"
11#include "webwidgetlister.h"
12#include <KContacts/Addressee>
13#include <KLocalizedString>
14#include <QLabel>
15#include <QVBoxLayout>
16
17using namespace Akonadi;
18
19WebListWidget::WebListWidget(QWidget *parent)
20 : QWidget(parent)
21 , mWebWidgetLister(new Akonadi::WebWidgetLister(this))
22{
23 auto topLayout = new QVBoxLayout(this);
24 topLayout->setContentsMargins({});
25 topLayout->setSpacing(0);
26
27 auto label = new QLabel(i18n("Web"), this);
28 label->setObjectName(QLatin1StringView("weblistlabel"));
29 topLayout->addWidget(label);
30
31 mWebWidgetLister->setObjectName(QLatin1StringView("webwidgetlister"));
32 topLayout->addWidget(mWebWidgetLister);
33}
34
35WebListWidget::~WebListWidget() = default;
36
37void WebListWidget::loadContact(const KContacts::Addressee &contact)
38{
39 mWebWidgetLister->loadContact(contact);
40}
41
42void WebListWidget::storeContact(KContacts::Addressee &contact) const
43{
44 mWebWidgetLister->storeContact(contact);
45}
46
47void WebListWidget::setReadOnly(bool readOnly)
48{
49 mWebWidgetLister->setReadOnly(readOnly);
50}
51
52#include "moc_weblistwidget.cpp"
QString i18n(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 Tue Mar 26 2024 11:13:20 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.