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 #pragma once 0011 0012 #include <QWidget> 0013 0014 #include <KContacts/ResourceLocatorUrl> 0015 class QToolButton; 0016 namespace Akonadi 0017 { 0018 class WebSelectTypeCombobox; 0019 class PreferredLineEditWidget; 0020 class WebWidget : public QWidget 0021 { 0022 Q_OBJECT 0023 public: 0024 explicit WebWidget(QWidget *parent = nullptr); 0025 ~WebWidget() override; 0026 void updateAddRemoveButton(bool addButtonEnabled); 0027 0028 void clearWidget(); 0029 void setPreferred(bool b); 0030 0031 KContacts::ResourceLocatorUrl url(); 0032 void loadWebSite(const KContacts::ResourceLocatorUrl &url); 0033 0034 void setReadOnly(bool readOnly); 0035 0036 Q_SIGNALS: 0037 void addWidget(Akonadi::WebWidget *); 0038 void removeWidget(Akonadi::WebWidget *); 0039 void preferredChanged(Akonadi::WebWidget *); 0040 0041 private: 0042 void slotRemoveWeb(); 0043 void slotAddWeb(); 0044 void slotPreferredChanged(); 0045 KContacts::ResourceLocatorUrl mUrl; 0046 QStringList mWebSiteType; 0047 QString mOldType; 0048 PreferredLineEditWidget *mWebSiteEdit = nullptr; 0049 QToolButton *mAddButton = nullptr; 0050 QToolButton *mRemoveButton = nullptr; 0051 Akonadi::WebSelectTypeCombobox *mWebType = nullptr; 0052 }; 0053 }