Akonadi Contacts

contactviewer.h
1 /*
2  This file is part of Akonadi Contact.
3 
4  SPDX-FileCopyrightText: 2009 Tobias Koenig <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef AKONADI_CONTACTVIEWER_H
10 #define AKONADI_CONTACTVIEWER_H
11 
12 #include "akonadi-contact_export.h"
13 
14 #include <itemmonitor.h>
15 
16 #include <QWidget>
17 
18 namespace KContacts {
19 class Address;
20 class Addressee;
21 class PhoneNumber;
22 }
23 
24 namespace Akonadi {
25 class AbstractContactFormatter;
26 
60 class AKONADI_CONTACT_EXPORT ContactViewer : public QWidget, public Akonadi::ItemMonitor
61 {
62  Q_OBJECT
63 
64 public:
70  explicit ContactViewer(QWidget *parent = nullptr);
71 
75  ~ContactViewer() override;
76 
83  Q_REQUIRED_RESULT Akonadi::Item contact() const;
84 
90  Q_REQUIRED_RESULT KContacts::Addressee rawContact() const;
91 
100  void setContactFormatter(AbstractContactFormatter *formatter);
104  void updateView();
105 
109  void setShowQRCode(bool b);
110  Q_REQUIRED_RESULT bool showQRCode() const;
111 public Q_SLOTS:
115  void setContact(const Akonadi::Item &contact);
116 
122  void setRawContact(const KContacts::Addressee &contact);
123 
124 Q_SIGNALS:
131  void urlClicked(const QUrl &url);
132 
140  void emailClicked(const QString &name, const QString &email);
141 
148  void phoneNumberClicked(const KContacts::PhoneNumber &number);
149 
156  void smsClicked(const KContacts::PhoneNumber &number);
157 
164  void addressClicked(const KContacts::Address &address);
165 
166 private:
170  void itemChanged(const Item &contact) override;
171 
176  void itemRemoved() override;
177 
178 private:
179  //@cond PRIVATE
180  class Private;
181  Private *const d;
182 
183  Q_PRIVATE_SLOT(d, void slotUrlClicked(const QUrl &))
184  Q_PRIVATE_SLOT(d, void slotParentCollectionFetched(KJob *))
185  //@endcond
186 };
187 }
188 
189 #endif
A viewer component for contacts in Akonadi.
Definition: contactviewer.h:60
The interface for all contact formatters.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Aug 11 2020 23:10:45 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.