File indexing completed on 2024-11-24 04:39:31
0001 /* 0002 This file is part of Contact Editor. 0003 0004 SPDX-FileCopyrightText: 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com 0005 SPDX-FileCopyrightText: 2016-2020 Laurent Montel <montel.org> 0006 0007 SPDX-License-Identifier: LGPL-2.0-or-later 0008 */ 0009 0010 #include "weblistwidget.h" 0011 #include "webwidgetlister.h" 0012 #include <KContacts/Addressee> 0013 #include <KLocalizedString> 0014 #include <QLabel> 0015 #include <QVBoxLayout> 0016 0017 using namespace Akonadi; 0018 0019 WebListWidget::WebListWidget(QWidget *parent) 0020 : QWidget(parent) 0021 , mWebWidgetLister(new Akonadi::WebWidgetLister(this)) 0022 { 0023 auto topLayout = new QVBoxLayout(this); 0024 topLayout->setContentsMargins({}); 0025 topLayout->setSpacing(0); 0026 0027 auto label = new QLabel(i18n("Web"), this); 0028 label->setObjectName(QLatin1StringView("weblistlabel")); 0029 topLayout->addWidget(label); 0030 0031 mWebWidgetLister->setObjectName(QLatin1StringView("webwidgetlister")); 0032 topLayout->addWidget(mWebWidgetLister); 0033 } 0034 0035 WebListWidget::~WebListWidget() = default; 0036 0037 void WebListWidget::loadContact(const KContacts::Addressee &contact) 0038 { 0039 mWebWidgetLister->loadContact(contact); 0040 } 0041 0042 void WebListWidget::storeContact(KContacts::Addressee &contact) const 0043 { 0044 mWebWidgetLister->storeContact(contact); 0045 } 0046 0047 void WebListWidget::setReadOnly(bool readOnly) 0048 { 0049 mWebWidgetLister->setReadOnly(readOnly); 0050 } 0051 0052 #include "moc_weblistwidget.cpp"