KTnef

ktnefattach.cpp
Go to the documentation of this file.
1/*
2 ktnefattach.cpp
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#include "ktnefattach.h"
19
20using namespace KTnef;
21
22/**
23 * Private class that helps to provide binary compatibility between releases.
24 * @internal
25 */
26//@cond PRIVATE
27class KTnef::KTNEFAttach::AttachPrivate
28{
29public:
30 int state_;
31 int size_;
32 int offset_;
33 int displaysize_;
34 QString name_;
35 int index_;
36 QString filename_;
37 QString displayname_;
38 QString mimetag_;
39 QString extension_;
40};
41//@endcond
42
44 : d(new KTnef::KTNEFAttach::AttachPrivate)
45{
46 d->state_ = Unparsed;
47 d->offset_ = -1;
48 d->size_ = 0;
49 d->displaysize_ = 0;
50 d->index_ = -1;
51}
52
54
56{
57 d->state_ |= TitleParsed;
58}
59
61{
62 d->state_ |= DataParsed;
63}
64
66{
67 d->state_ = (d->state_ & ~DataParsed);
68}
69
71{
72 d->state_ |= InfoParsed;
73}
74
76{
77 return d->state_ & TitleParsed;
78}
79
81{
82 return d->state_ & DataParsed;
83}
84
86{
87 return d->state_ & InfoParsed;
88}
89
90bool KTNEFAttach::checkState(int state) const
91{
92 return d->state_ & state;
93}
94
96{
97 return d->offset_;
98}
99
101{
103 d->offset_ = n;
104}
105
107{
108 return d->size_;
109}
110
112{
113 d->size_ = s;
114}
115
117{
118 return d->displaysize_;
119}
120
122{
123 d->displaysize_ = s;
124}
125
127{
128 return d->name_;
129}
130
132{
134 d->name_ = str;
135}
136
138{
139 return d->index_;
140}
141
143{
145 d->index_ = i;
146}
147
149{
150 return d->filename_;
151}
152
154{
155 d->filename_ = str;
156}
157
159{
160 return d->displayname_;
161}
162
164{
165 d->displayname_ = str;
166}
167
169{
170 return d->mimetag_;
171}
172
174{
175 d->mimetag_ = str;
176}
177
179{
180 return d->extension_;
181}
182
184{
185 d->extension_ = str;
186}
Represents a TNEF attachment.
Definition ktnefattach.h:38
void setFileName(const QString &str)
Sets the filename of this attachment to str.
int size() const
Returns the size of the attachment.
void setTitleParsed()
Sets the TitleParsed flag for this attachment.
void setSize(int size)
Sets the size of the attachment to size.
void setInfoParsed()
Sets the InfoParsed flag for this attachment.
void setExtension(const QString &str)
Sets the filename extension of this attachment to str.
void setIndex(int indx)
Sets the index of this attachment to indx.
void setOffset(int offset)
Sets the offset value of this attachment to offset.
void setMimeTag(const QString &str)
Sets the MIME tag of this attachment to str.
QString name() const
Returns the name of the attachment.
bool titleParsed() const
Returns true if the TitleParsed flag is set; else returns false.
void setDataParsed()
Sets the DataParsed flag for this attachment.
void unsetDataParser()
Unsets the DataParsed flag for this attachment.
QString fileName() const
Returns the filename of the attachment.
KTNEFAttach()
Constructs a TNEF attachment.
bool infoParsed() const
Returns true if the InfoParsed flag is set; else returns false.
void setName(const QString &str)
Sets the name of this attachment to str.
int offset() const
Returns the offset value of the attachment.
int index() const
Returns the index of the attachment.
QString mimeTag() const
Returns the MIME tag of the attachment.
QString extension() const
Returns the filename extension of the attachment.
QString displayName() const
Returns the display name of the attachment.
void setDisplaySize(int size)
Sets the display size of the attachment to size.
~KTNEFAttach()
Destroys the TNEF attachment.
int displaySize() const
Returns the display size of the attachment.
void setDisplayName(const QString &str)
Sets the display name of this attachment to str.
bool dataParsed() const
Returns true if the ParseState::DataParsed flag is set; else returns false.
bool checkState(int state) const
Sets/Unsets the attachment state according to the state flag must be a ParseState type.
@ DataParsed
The data is parsed.
Definition ktnefattach.h:46
@ InfoParsed
The info is parsed.
Definition ktnefattach.h:47
@ Unparsed
Unparsed.
Definition ktnefattach.h:44
@ TitleParsed
The title is parsed.
Definition ktnefattach.h:45
This file is part of the API for handling TNEF data and defines the KTNEFAttach class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:06:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.