Messagelib

bodypartformatterfactory.h
1/*
2 bodypartformatterfactory.h
3
4 This file is part of KMail, the KDE mail client.
5 SPDX-FileCopyrightText: 2004 Marc Mutz <mutz@kde.org>
6 SPDX-FileCopyrightText: 2004 Ingo Kloecker <kloecker@kde.org>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10
11#pragma once
12
13#include "mimetreeparser_export.h"
14
15#include <QList>
16#include <memory>
17namespace MimeTreeParser
18{
19namespace Interface
20{
21class BodyPartFormatter;
22}
23
24class BodyPartFormatterFactoryPrivate;
25
26/** The place to obtain BodyPartFormatter candidates for a given mime type. */
27class MIMETREEPARSER_EXPORT BodyPartFormatterFactory
28{
29public:
32
33 static BodyPartFormatterFactory *instance();
34
35 /**
36 * Returns all suitable formatters for the given mimetype.
37 * The candidates are ordered by priority, with the catch-call
38 * formatter coming last.
39 */
40 [[nodiscard]] QList<const Interface::BodyPartFormatter *> formattersForType(const QString &mimeType) const;
41
42protected:
43 void insert(const QString &mimeType, const Interface::BodyPartFormatter *formatter, int priority);
44 virtual void loadPlugins();
45
46private:
47 Q_DISABLE_COPY(BodyPartFormatterFactory)
48 std::unique_ptr<BodyPartFormatterFactoryPrivate> const d;
49 friend class BodyPartFormatterFactoryPrivate;
50};
51}
The place to obtain BodyPartFormatter candidates for a given mime type.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:43 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.