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 namespace Akonadi
16 {
17 /**
18  * @short A class that formats a contact as HTML code.
19  *
20  * Examples:
21  *
22  * @code
23  *
24  * using namespace Akonadi;
25  *
26  * const KContacts::Addressee contact = ...
27  *
28  * StandardContactFormatter formatter;
29  * formatter.setContact( contact );
30  *
31  * QTextBrowser *view = new QTextBrowser;
32  * view->setHtml( formatter.toHtml() );
33  *
34  * @endcode
35  *
36  * @author Tobias Koenig <[email protected]>
37  * @since 4.5
38  */
39 class AKONADI_CONTACT_EXPORT StandardContactFormatter : public AbstractContactFormatter
40 {
41 public:
42  /**
43  * Creates a new standard contact formatter.
44  */
46 
47  /**
48  * Destroys the standard contact formatter.
49  */
50  ~StandardContactFormatter() override;
51 
52  /**
53  * Returns the contact formatted as HTML.
54  */
55  Q_REQUIRED_RESULT QString toHtml(HtmlForm form = SelfcontainedForm) const override;
56 
57  /*
58  * @since 4.9.1
59  */
60  void setDisplayQRCode(bool show);
61  /*
62  * @since 4.9.1
63  */
64  bool displayQRCode() const;
65 
66 private:
67  //@cond PRIVATE
68  class Private;
69  Private *const d;
70  //@endcond
71 };
72 }
73 
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-2021 The KDE developers.
Generated on Fri Jun 18 2021 23:08:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.