1/*
2 kmime_newsarticle.cpp
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
24#include "kmime_newsarticle.h"
25#include "kmime_message_p.h"
26#include "kmime_util_p.h"
27
28using namespace KMime;
29
30namespace KMime {
31
32class NewsArticlePrivate : public MessagePrivate
33{
34 public:
35 NewsArticlePrivate( NewsArticle *q ) : MessagePrivate( q )
36 {
37 }
38
39 Q_DECLARE_PUBLIC( NewsArticle )
40};
41
42NewsArticle::NewsArticle()
43 : Message( new NewsArticlePrivate( this ) )
44{
45}
46
47NewsArticle::~NewsArticle()
48{
49}
50
51void NewsArticle::parse()
52{
53 // KDE5: remove this virtual reimplementation.
54 Message::parse();
55}
56
57QByteArray NewsArticle::assembleHeaders()
58{
59 // Create the mandatory Lines: field.
60 lines( true );
61
62 // Assemble all header fields.
63 return Message::assembleHeaders();
64}
65
66void NewsArticle::clear()
67{
68 // KDE5: remove this virtual reimplementation.
69 Message::clear();
70}
71
72Headers::Base * NewsArticle::getHeaderByType( const char *type )
73{
74 // KDE5: remove this virtual reimplementation.
75 return headerByType( type );
76}
77
78Headers::Base * NewsArticle::headerByType( const char *type )
79{
80 // KDE5: remove this virtual reimplementation.
81 return Message::headerByType( type );
82}
83
84void NewsArticle::setHeader( Headers::Base *h )
85{
86 // KDE5: remove this virtual reimplementation.
87 Message::setHeader( h );
88}
89
90bool NewsArticle::removeHeader( const char *type )
91{
92 // KDE5: remove this virtual reimplementation.
93 return Message::removeHeader( type );
94}
95
96// @cond PRIVATE
97#define kmime_mk_header_accessor( type, method ) \
98Headers::type* NewsArticle::method( bool create ) { \
99 return header<Headers::type>( create ); \
100}
101
102kmime_mk_header_accessor( Control, control )
103kmime_mk_header_accessor( Lines, lines )
104kmime_mk_header_accessor( Supersedes, supersedes )
105kmime_mk_header_accessor( MailCopiesTo, mailCopiesTo )
106kmime_mk_header_accessor( Newsgroups, newsgroups )
107kmime_mk_header_accessor( FollowUpTo, followUpTo )
108
109#undef kmime_mk_header_accessor
110// @endcond
111
112} // namespace KMime
113