KTnef

ktnefparser.h
Go to the documentation of this file.
1/*
2 ktnefparser.h
3
4 SPDX-FileCopyrightText: 2002 Michael Goffioul <kdeprint@swing.be>
5
6 This file is part of KTNEF, the KDE TNEF support library/program.
7
8 SPDX-License-Identifier: LGPL-2.0-or-later
9 */
10/**
11 * @file
12 * This file is part of the API for handling TNEF data and
13 * defines the KTNEFParser class.
14 *
15 * @author Michael Goffioul
16 */
17
18#pragma once
19
20#include "ktnef_export.h"
21#include <QIODevice>
22#include <QString>
23#include <memory>
24
25namespace KTnef
26{
27class KTNEFMessage;
28}
29
30namespace KTnef
31{
32/**
33 * @brief
34 * Provides an @acronym TNEF parser.
35 */
36class KTNEF_EXPORT KTNEFParser
37{
38public:
39 /**
40 Constructs a @acronym TNEF parser object.
41 */
43
44 /**
45 Destroys the @acronym TNEF parser object.
46 */
48
49 /**
50 Opens the @p filename for parsing.
51
52 @param filename is the name of the file to open.
53 @return true if the open succeeded; otherwise false.
54 */
55 [[nodiscard]] bool openFile(const QString &filename) const;
56
57 /**
58 Opens the #QIODevice @p device for parsing.
59
60 @param device is the #QIODevice to open.
61 @return true if the open succeeded; otherwise false.
62 */
63 [[nodiscard]] bool openDevice(QIODevice *device);
64
65 /**
66 Extracts a @acronym TNEF attachment having filename @p filename
67 into the default directory.
68
69 @param filename is the name of the file to extract the attachment into.
70 @return true if the extraction succeeds; otherwise false.
71 */
72 [[nodiscard]] bool extractFile(const QString &filename) const;
73
74 /**
75 Extracts a @acronym TNEF attachment having filename @p filename
76 into the directory @p dirname.
77
78 @param filename is the name of the file to extract the attachment into.
79 @param dirname is the name of the directory where the @p filename
80 should be written.
81
82 @return true if the extraction succeeds; otherwise false.
83 */
84 [[nodiscard]] bool extractFileTo(const QString &filename, const QString &dirname) const;
85
86 /**
87 Extracts all @acronym TNEF attachments into the default directory.
88
89 @return true if the extraction succeeds; otherwise false.
90 */
91 [[nodiscard]] bool extractAll();
92
93 /**
94 Sets the default extraction directory to @p dirname.
95
96 @param dirname is the name of the default extraction directory.
97 */
98 void setDefaultExtractDir(const QString &dirname);
99
100 /**
101 Returns the KTNEFMessage used in the parsing process.
102
103 @return a pointer to a KTNEFMessage object.
104 */
105 KTNEFMessage *message() const;
106
107private:
108 //@cond PRIVATE
109 class ParserPrivate;
110 std::unique_ptr<ParserPrivate> const d;
111 //@endcond
112
113 Q_DISABLE_COPY(KTNEFParser)
114};
115
116}
Represents a TNEF message.
Provides an TNEF parser.
Definition ktnefparser.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.