Akonadi Contacts

standardcontactformatter.h
1/*
2 This file is part of Akonadi Contact.
3
4 SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#pragma once
10
11#include "akonadi-contact-core_export.h"
12
13#include "abstractcontactformatter.h"
14
15#include <memory>
16
17namespace Akonadi
18{
19class 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 <tokoe@kde.org>
41 * @since 4.5
42 */
43class AKONADI_CONTACT_CORE_EXPORT StandardContactFormatter : public AbstractContactFormatter
44{
45public:
46 /**
47 * Creates a new standard contact formatter.
48 */
50
51 /**
52 * Destroys the standard contact formatter.
53 */
55
56 /**
57 * Returns the contact formatted as HTML.
58 */
59 [[nodiscard]] 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 [[nodiscard]] bool displayQRCode() const;
69
70private:
71 //@cond PRIVATE
72 std::unique_ptr<StandardContactFormatterPrivate> const d;
73 //@endcond
74};
75}
The interface for all contact formatters.
HtmlForm
Describes the form of the HTML that is created.
A class that formats a contact as HTML code.
~StandardContactFormatter() override
Destroys the standard contact formatter.
A widget for editing the display name of a contact.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.