Messagelib

bodypartformatter.h
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2  bodypartformatter.h
3 
4  This file is part of KMail's plugin interface.
5  SPDX-FileCopyrightText: 2004 Marc Mutz <[email protected]>
6  SPDX-FileCopyrightText: 2004 Ingo Kloecker <[email protected]>
7 
8  SPDX-License-Identifier: GPL-2.0-or-later
9 */
10 
11 #pragma once
12 
13 #include "mimetreeparser_export.h"
14 
15 #include <QSharedPointer>
16 
17 #include "mimetreeparser/objecttreeparser.h"
18 
19 namespace MimeTreeParser
20 {
21 class MessagePart;
22 using MessagePartPtr = QSharedPointer<MessagePart>;
23 
24 namespace Interface
25 {
26 class BodyPart;
27 /**
28  * @brief The BodyPartFormatter class
29  */
30 class MIMETREEPARSER_EXPORT BodyPartFormatter
31 {
32 public:
33  virtual ~BodyPartFormatter();
34 
35  virtual MimeTreeParser::MessagePartPtr process(BodyPart &part) const = 0;
36 };
37 
38 /**
39  @short interface for BodyPartFormatter plugins
40 
41  The interface is queried by for types, subtypes, and the
42  corresponding bodypart formatter, and the result inserted into
43  the bodypart formatter factory.
44 
45  Subtype alone or both type and subtype may be "*", which is
46  taken as a wildcard, so that e.g. type=text subtype=* matches
47  any text subtype, but with lesser specificity than a concrete
48  mimetype such as text/plain. type=* is only allowed when
49  subtype=*, too.
50 */
51 class MIMETREEPARSER_EXPORT BodyPartFormatterPlugin
52 {
53 public:
54  virtual ~BodyPartFormatterPlugin();
55 
56  virtual const BodyPartFormatter *bodyPartFormatter(int idx) const = 0;
57 };
58 } // namespace Interface
59 }
60 
61 Q_DECLARE_INTERFACE(MimeTreeParser::Interface::BodyPartFormatterPlugin, "org.kde.messageviewer.bodypartformatter/1.1")
interface for BodyPartFormatter plugins
interface of message body parts.
Definition: bodypart.h:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 3 2023 03:57:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.