Akonadi Contacts

standardcontactformatter.h
1 /*
2  This file is part of Akonadi Contact.
3 
4  SPDX-FileCopyrightText: 2010 Tobias Koenig <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #pragma once
10 
11 #include "akonadi-contact_export.h"
12 
13 #include "abstractcontactformatter.h"
14 
15 #include <memory>
16 
17 namespace Akonadi
18 {
19 class StandardContactFormatterPrivate;
20 
21 /**
22  * @short A class that formats a contact as HTML code.
23  *
24  * Examples:
25  *
26  * @code
27  *
28  * using namespace Akonadi;
29  *
30  * const KContacts::Addressee contact = ...
31  *
32  * StandardContactFormatter formatter;
33  * formatter.setContact( contact );
34  *
35  * QTextBrowser *view = new QTextBrowser;
36  * view->setHtml( formatter.toHtml() );
37  *
38  * @endcode
39  *
40  * @author Tobias Koenig <[email protected]>
41  * @since 4.5
42  */
43 class AKONADI_CONTACT_EXPORT StandardContactFormatter : public AbstractContactFormatter
44 {
45 public:
46  /**
47  * Creates a new standard contact formatter.
48  */
50 
51  /**
52  * Destroys the standard contact formatter.
53  */
54  ~StandardContactFormatter() override;
55 
56  /**
57  * Returns the contact formatted as HTML.
58  */
59  Q_REQUIRED_RESULT QString toHtml(HtmlForm form = SelfcontainedForm) const override;
60 
61  /*
62  * @since 4.9.1
63  */
64  void setDisplayQRCode(bool show);
65  /*
66  * @since 4.9.1
67  */
68  Q_REQUIRED_RESULT bool displayQRCode() const;
69 
70 private:
71  //@cond PRIVATE
72  std::unique_ptr<StandardContactFormatterPrivate> const d;
73  //@endcond
74 };
75 }
HtmlForm
Describes the form of the HTML that is created.
A class that formats a contact as HTML code.
The interface for all contact formatters.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Apr 1 2023 04:09:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.