1 | /* |
2 | kmime_newsarticle.h |
3 | |
4 | KMime, the KDE Internet mail/usenet news message library. |
5 | Copyright (c) 2001 the KMime authors. |
6 | See file AUTHORS for details |
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 | #ifndef __KMIME_NEWSARTICLE_H__ |
24 | #define __KMIME_NEWSARTICLE_H__ |
25 | |
26 | #include "kmime_export.h" |
27 | #include "kmime_message.h" |
28 | #include <kpimutils/supertrait.h> |
29 | |
30 | namespace KMime { |
31 | |
32 | class NewsArticlePrivate; |
33 | |
34 | class KMIME_EXPORT NewsArticle : public Message |
35 | { |
36 | public: |
37 | /** |
38 | A shared pointer to a news article. |
39 | */ |
40 | typedef boost::shared_ptr<NewsArticle> Ptr; |
41 | |
42 | /** |
43 | Creates a NewsArticle object. |
44 | */ |
45 | NewsArticle(); |
46 | |
47 | /** |
48 | Destroys this NewsArticle. |
49 | */ |
50 | ~NewsArticle(); |
51 | |
52 | /* reimpl */ |
53 | virtual void parse(); |
54 | |
55 | /* reimpl */ |
56 | virtual void clear(); |
57 | |
58 | /* reimpl */ |
59 | virtual KMIME_DEPRECATED KMime::Headers::Base * getHeaderByType( const char *type ); |
60 | |
61 | /* reimpl */ |
62 | virtual KMime::Headers::Base * headerByType( const char *type ); |
63 | |
64 | /* reimpl */ |
65 | virtual void setHeader( KMime::Headers::Base *h ); |
66 | |
67 | /* reimpl */ |
68 | virtual bool removeHeader( const char *type ); |
69 | |
70 | /** |
71 | Returns the Control header. |
72 | @param create If true, create the header if it doesn't exist yet. |
73 | */ |
74 | virtual KMime::Headers::Control *control( bool create = true ); |
75 | |
76 | /** |
77 | Returns the Supersedes header. |
78 | @param create If true, create the header if it doesn't exist yet. |
79 | */ |
80 | virtual KMime::Headers::Supersedes *supersedes( bool create = true ); |
81 | |
82 | /** |
83 | Returns the Mail-Copies-To header. |
84 | @param create If true, create the header if it doesn't exist yet. |
85 | */ |
86 | virtual KMime::Headers::MailCopiesTo *mailCopiesTo( bool create = true ); |
87 | |
88 | /** |
89 | Returns the Newsgroups header. |
90 | @param create If true, create the header if it doesn't exist yet. |
91 | */ |
92 | virtual KMime::Headers::Newsgroups *newsgroups( bool create = true ); |
93 | |
94 | /** |
95 | Returns the Follow-Up-To header. |
96 | @param create If true, create the header if it doesn't exist yet. |
97 | */ |
98 | virtual KMime::Headers::FollowUpTo *followUpTo( bool create = true ); |
99 | |
100 | /** |
101 | Returns the Lines header. |
102 | @param create If true, create the header if it doesn't exist yet. |
103 | */ |
104 | virtual KMime::Headers::Lines *lines( bool create = true ); |
105 | |
106 | protected: |
107 | /* reimpl */ |
108 | virtual QByteArray assembleHeaders(); |
109 | |
110 | private: |
111 | Q_DECLARE_PRIVATE( NewsArticle ) |
112 | |
113 | }; // class NewsArticle |
114 | |
115 | } // namespace KMime |
116 | |
117 | |
118 | //@cond PRIVATE |
119 | // super class trait specialization |
120 | namespace KPIMUtils { |
121 | template <> struct SuperClass<KMime::NewsArticle> : public SuperClassTrait<KMime::Message>{}; |
122 | } |
123 | //@endcond |
124 | |
125 | #endif // __KMIME_NEWSARTICLE_H__ |
126 | |