1 | /* |
2 | ktnefmessage.h |
3 | |
4 | Copyright (C) 2002 Michael Goffioul <kdeprint@swing.be> |
5 | |
6 | This file is part of KTNEF, the KDE TNEF support library/program. |
7 | |
8 | This library is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU Library General Public |
10 | License as published by the Free Software Foundation; either |
11 | version 2 of the License, or (at your option) any later version. |
12 | |
13 | This library is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 | Library General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Library General Public License |
19 | along with this library; see the file COPYING.LIB. If not, write to |
20 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 | Boston, MA 02110-1301, USA. |
22 | */ |
23 | /** |
24 | * @file |
25 | * This file is part of the API for handling TNEF data and |
26 | * defines the KTNEFMessage class. |
27 | * |
28 | * @author Michael Goffioul |
29 | */ |
30 | |
31 | #ifndef KTNEFMESSAGE_H |
32 | #define KTNEFMESSAGE_H |
33 | |
34 | #include <QtCore/QList> |
35 | |
36 | #include "ktnefpropertyset.h" |
37 | #include "ktnef_export.h" |
38 | |
39 | namespace KTnef { |
40 | class KTNEFAttach; |
41 | } |
42 | |
43 | namespace KTnef { |
44 | |
45 | /** |
46 | * @brief |
47 | * Represents a @acronym TNEF message. |
48 | */ |
49 | class KTNEF_EXPORT KTNEFMessage : public KTNEFPropertySet |
50 | { |
51 | public: |
52 | /** |
53 | * Creates a KTNEFMessage message object. |
54 | */ |
55 | KTNEFMessage(); |
56 | |
57 | /** |
58 | * Destroys a KTNEFMessage message object. |
59 | */ |
60 | ~KTNEFMessage(); |
61 | |
62 | /** |
63 | * Return a QList containing all the message's attachments. |
64 | */ |
65 | const QList<KTNEFAttach *> &attachmentList() const; |
66 | |
67 | /** |
68 | * Find the attachment associated to the specified file name. |
69 | * |
70 | * @param filename is a QString containing the file to search for in the |
71 | * list of message attachments. |
72 | * |
73 | * @return A pointer to KTNEFAttach object, or 0 if the search fails. |
74 | */ |
75 | KTNEFAttach *attachment( const QString &filename ) const; |
76 | |
77 | /** |
78 | * Append an attachment to the message. |
79 | * @param attach is a pointer to a KTNEFAttach object to be attached. |
80 | */ |
81 | void addAttachment( KTNEFAttach *attach ); |
82 | |
83 | /** |
84 | * Clear the attachments list. |
85 | */ |
86 | void clearAttachments(); |
87 | |
88 | /** |
89 | * Returns the Rich Text Format (@acronym RTF) data contained in the message. |
90 | * @return A QString containing the @acronym RTF data. |
91 | */ |
92 | QString rtfString() const; |
93 | |
94 | private: |
95 | //@cond PRIVATE |
96 | class MessagePrivate; |
97 | MessagePrivate *const d; |
98 | //@endcond |
99 | |
100 | Q_DISABLE_COPY( KTNEFMessage ) |
101 | }; |
102 | |
103 | } |
104 | #endif |
105 | |