Akonadi Contacts

displaynameeditwidget.h
1 /*
2  This file is part of Contact Editor.
3 
4  SPDX-FileCopyrightText: 2009 Tobias Koenig <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef DISPLAYNAMEEDITWIDGET_H
10 #define DISPLAYNAMEEDITWIDGET_H
11 
12 #include <QWidget>
13 
14 #include <kcontacts/addressee.h>
15 
16 class KComboBox;
17 
25 {
26  Q_OBJECT
27 
28 public:
32  enum DisplayType {
39  };
40 
41  explicit DisplayNameEditWidget(QWidget *parent = nullptr);
42  ~DisplayNameEditWidget() override;
43 
44  void loadContact(const KContacts::Addressee &contact);
45  void storeContact(KContacts::Addressee &contact) const;
46 
47  void setReadOnly(bool readOnly);
48 
49  void setDisplayType(DisplayType type);
50  Q_REQUIRED_RESULT DisplayType displayType() const;
51 
52 public Q_SLOTS:
53  void changeName(const KContacts::Addressee &contact);
54  void changeOrganization(const QString &organization);
55 
56 protected:
57  bool eventFilter(QObject *object, QEvent *event) override;
58 
59 private:
60  void displayTypeChanged(int);
61  void setComboBoxEditable(bool);
62  void updateView();
63 
64  KComboBox *mView = nullptr;
65  KContacts::Addressee mContact;
66  QWidget *mViewport = nullptr;
67  DisplayType mDisplayType = DisplayType::SimpleName;
68  int mAdditionalPopupWidth;
69 };
70 
71 #endif
Let the user input a display name.
A widget for editing the display name of a contact.
A name of the form: prefix givenName additionalName familyName suffix.
A name of the form: familyName givenName.
A name of the form: familyName, givenName.
Q_OBJECTQ_OBJECT
DisplayType
Describes what the display name should look like.
A name of the form: givenName familyName.
Q_SLOTSQ_SLOTS
QObject * parent() const const
virtual bool event(QEvent *event) override
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Oct 22 2020 23:12:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.