KTnef

ktnefattach.h
Go to the documentation of this file.
1/*
2 ktnefattach.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 KTNEFAttach class.
14 *
15 * @author Michael Goffioul
16 */
17
18#pragma once
19
20#include <QString>
21
22#include "ktnef_export.h"
23#include "ktnefpropertyset.h"
24#include <memory>
25
26namespace KTnef
27{
28class KTNEFProperty;
29}
30
31namespace KTnef
32{
33/**
34 * @brief
35 * Represents a @acronym TNEF attachment.
36 */
37class KTNEF_EXPORT KTNEFAttach : public KTNEFPropertySet
38{
39public:
40 /**
41 * The different attachment parsed states.
42 */
44 Unparsed = 0x0000, /**< Unparsed */
45 TitleParsed = 0x0001, /**< The title is parsed */
46 DataParsed = 0x0002, /**< The data is parsed */
47 InfoParsed = 0x0004 /**< The info is parsed */
48 };
49
50 /**
51 * Constructs a @acronym TNEF attachment.
52 */
54
55 /**
56 * Destroys the @acronym TNEF attachment.
57 */
59
60 /**
61 * Sets the #TitleParsed flag for this attachment.
62 */
63 void setTitleParsed();
64
65 /**
66 * Sets the #DataParsed flag for this attachment.
67 */
68 void setDataParsed();
69
70 /**
71 * Unsets the #DataParsed flag for this attachment.
72 */
73 void unsetDataParser();
74
75 /**
76 * Sets the #InfoParsed flag for this attachment.
77 */
78 void setInfoParsed();
79
80 /**
81 * Returns true if the #TitleParsed flag is set; else returns false.
82 */
83 [[nodiscard]] bool titleParsed() const;
84
85 /**
86 * Returns true if the ParseState::DataParsed flag is set; else returns false.
87 */
88 [[nodiscard]] bool dataParsed() const;
89
90 /**
91 * Returns true if the #InfoParsed flag is set; else returns false.
92 */
93 [[nodiscard]] bool infoParsed() const;
94
95 /**
96 * Sets/Unsets the attachment state according to the @p state flag
97 * must be a #ParseState type.
98 *
99 * @param state a #ParseState type.
100 * @return true if the state is turned-on; else returns false.
101 */
102 [[nodiscard]] bool checkState(int state) const;
103
104 /**
105 * Sets the offset value of this attachment to @p offset.
106 *
107 * @param offset is the attachment offset to set.
108 */
109 void setOffset(int offset);
110
111 /**
112 * Returns the offset value of the attachment.
113 */
114 [[nodiscard]] int offset() const;
115
116 /**
117 * Sets the size of the attachment to @p size.
118 *
119 * @param size is the attachment size to set.
120 */
121 void setSize(int size);
122
123 /**
124 * Returns the size of the attachment.
125 */
126 [[nodiscard]] int size() const;
127
128 /**
129 * Sets the display size of the attachment to @p size.
130 *
131 * @param size is the attachment display size to set.
132 */
133 void setDisplaySize(int size);
134
135 /**
136 * Returns the display size of the attachment.
137 */
138 [[nodiscard]] int displaySize() const;
139
140 /**
141 * Sets the name of this attachment to @p str.
142 *
143 * @param str is attachment name to set.
144 */
145 void setName(const QString &str);
146
147 /**
148 * Returns the name of the attachment.
149 */
150 [[nodiscard]] QString name() const;
151
152 /**
153 * Sets the index of this attachment to @p indx.
154 *
155 * @param indx is the attachment index to set.
156 */
157 void setIndex(int indx);
158
159 /**
160 * Returns the index of the attachment.
161 */
162 [[nodiscard]] int index() const;
163
164 /**
165 * Sets the filename of this attachment to @p str.
166 *
167 * @param str is the attachment filename to set.
168 */
169 void setFileName(const QString &str);
170
171 /**
172 * Returns the filename of the attachment.
173 */
174 [[nodiscard]] QString fileName() const;
175
176 /**
177 * Sets the display name of this attachment to @p str.
178 *
179 * @param str is the attachment display name to set.
180 */
181 void setDisplayName(const QString &str);
182
183 /**
184 * Returns the display name of the attachment.
185 */
186 [[nodiscard]] QString displayName() const;
187
188 /**
189 * Sets the @acronym MIME tag of this attachment to @p str.
190 *
191 * @param str is the attachment @acronym MIME tag to set.
192 */
193 void setMimeTag(const QString &str);
194
195 /**
196 * Returns the @acronym MIME tag of the attachment.
197 */
198 [[nodiscard]] QString mimeTag() const;
199
200 /**
201 * Sets the filename extension of this attachment to @p str.
202 *
203 * @param str is the attachment filename extension to set.
204 */
205 void setExtension(const QString &str);
206
207 /**
208 * Returns the filename extension of the attachment.
209 */
210 [[nodiscard]] QString extension() const;
211
212private:
213 //@cond PRIVATE
214 class AttachPrivate;
215 std::unique_ptr<AttachPrivate> const d;
216 //@endcond
217
218 Q_DISABLE_COPY(KTNEFAttach)
219};
220
221}
Represents a TNEF attachment.
Definition ktnefattach.h:38
~KTNEFAttach()
Destroys the TNEF attachment.
ParseState
The different attachment parsed states.
Definition ktnefattach.h:43
Interface for setting MAPI properties and TNEF attributes.
This file is part of the API for handling TNEF data and defines the KTNEFPropertySet class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:55:02 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.