File indexing completed on 2024-11-24 04:39:28

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 #include <KContacts/Addressee>
0012 #include <QSplitter>
0013 
0014 class QTreeView;
0015 
0016 namespace Akonadi
0017 {
0018 class AddressModel;
0019 class AddressLocationWidget;
0020 
0021 class AddressesLocationWidget : public QSplitter
0022 {
0023     Q_OBJECT
0024 public:
0025     explicit AddressesLocationWidget(QWidget *parent = nullptr);
0026     ~AddressesLocationWidget() override;
0027 
0028     void loadContact(const KContacts::Addressee &contact);
0029     void storeContact(KContacts::Addressee &contact) const;
0030 
0031     void setReadOnly(bool readOnly);
0032     [[nodiscard]] bool hasNoSavedData() const;
0033 
0034 private:
0035     AddressLocationWidget *const mAddressLocationWidget;
0036     QTreeView *const mAddressesLocationView;
0037     AddressModel *const mAddressModel;
0038     bool mReadOnly = false;
0039 };
0040 }