libkmime

kmime_newsarticle.h
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 program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software Foundation,
14  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
15 */
16 #ifndef __KMIME_NEWSARTICLE_H__
17 #define __KMIME_NEWSARTICLE_H__
18 
19 #include "kmime_message.h"
20 
21 #include <tdemacros.h>
22 
23 namespace KMime {
24 
25 class TDE_EXPORT NewsArticle : public Message {
26 
27 public:
28 
29  NewsArticle() : Message() { l_ines.setParent(this); }
30  ~NewsArticle() {};
31 
32  virtual void parse();
33  virtual void assemble();
34  virtual void clear();
35 
36  virtual KMime::Headers::Base * getHeaderByType(const char* type);
37  virtual void setHeader(KMime::Headers::Base *h);
38  virtual bool removeHeader(const char * type);
39 
40  virtual KMime::Headers::Control* control(bool create=true) { KMime::Headers::Control *p=0; return getHeaderInstance(p, create); }
41  virtual KMime::Headers::Supersedes* supersedes(bool create=true) { KMime::Headers::Supersedes *p=0; return getHeaderInstance(p, create); }
42  virtual KMime::Headers::MailCopiesTo* mailCopiesTo(bool create=true) { KMime::Headers::MailCopiesTo *p=0; return getHeaderInstance(p, create); }
43  virtual KMime::Headers::Newsgroups* newsgroups(bool create=true) { KMime::Headers::Newsgroups *p=0; return getHeaderInstance(p, create); }
44  virtual KMime::Headers::FollowUpTo* followUpTo(bool create=true) { KMime::Headers::FollowUpTo *p=0; return getHeaderInstance(p, create); }
45  virtual KMime::Headers::Lines* lines(bool create=true) { if(!create && l_ines.isEmpty()) return 0; return &l_ines; }
46 
47 
48 protected:
49  KMime::Headers::Lines l_ines;
50 
51 }; // class NewsArticle
52 
53 } // namespace KMime
54 
55 #endif // __KMIME_NEWSARTICLE_H__
Baseclass of all header-classes.
Represents a "Control" header.
Represents a "Followup-To" header.
Represents a "Lines" header.
Represents a "Newsgroups" header.