Akonadi Contacts

phonewidget.h
1 /*
2  This file is part of Contact Editor.
3 
4  Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
5  Copyright (C) 2016-2020 Laurent Montel <montel.org>
6 
7  This library is free software; you can redistribute it and/or modify it
8  under the terms of the GNU Library General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version.
11 
12  This library is distributed in the hope that it will be useful, but WITHOUT
13  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15  License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to the
19  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  02110-1301, USA.
21 */
22 
23 #ifndef PHONEWIDGET_H
24 #define PHONEWIDGET_H
25 
26 #include <QWidget>
27 #include "contacteditor_private_export.h"
28 class QToolButton;
29 namespace KContacts {
30 class PhoneNumber;
31 }
32 namespace ContactEditor {
33 class PreferredLineEditWidget;
34 class PhoneComboBoxType;
35 class CONTACTEDITOR_TESTS_EXPORT PhoneWidget : public QWidget
36 {
37  Q_OBJECT
38 public:
39  explicit PhoneWidget(QWidget *parent = nullptr);
40  ~PhoneWidget();
41 
42  void updateAddRemoveButton(bool addButtonEnabled);
43  void loadPhone(const KContacts::PhoneNumber &number);
44  KContacts::PhoneNumber storePhone();
45  void clearWidget();
46  void setPreferred(bool b);
47  void setReadOnly(bool readOnly);
48 Q_SIGNALS:
49  void addWidget(PhoneWidget *);
50  void removeWidget(PhoneWidget *);
51  void preferredChanged(PhoneWidget *);
52 
53 private:
54  void slotAddPhone();
55  void slotRemovePhone();
56  void slotPreferredChanged();
57  PreferredLineEditWidget *mPhoneNumberEdit = nullptr;
58  QToolButton *mAddButton = nullptr;
59  QToolButton *mRemoveButton = nullptr;
60  PhoneComboBoxType *mPhoneType = nullptr;
61 };
62 }
63 #endif // PHONEWIDGET_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Aug 10 2020 23:12:25 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.