libkmime

kmime_newsarticle.h

00001 /*
00002     kmime_newsarticle.h
00003 
00004     KMime, the KDE internet mail/usenet news message library.
00005     Copyright (c) 2001 the KMime authors.
00006     See file AUTHORS for details
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012     You should have received a copy of the GNU General Public License
00013     along with this program; if not, write to the Free Software Foundation,
00014     Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
00015 */
00016 #ifndef __KMIME_NEWSARTICLE_H__
00017 #define __KMIME_NEWSARTICLE_H__
00018 
00019 #include "kmime_message.h"
00020 
00021 #include <kdepimmacros.h>
00022 
00023 namespace KMime {
00024 
00025 class KDE_EXPORT NewsArticle : public Message {
00026 
00027 public:
00028 
00029   NewsArticle() : Message() { l_ines.setParent(this); }
00030   ~NewsArticle() {};
00031 
00032   virtual void parse();
00033   virtual void assemble();
00034   virtual void clear();
00035 
00036   virtual KMime::Headers::Base * getHeaderByType(const char* type);
00037   virtual void setHeader(KMime::Headers::Base *h);
00038   virtual bool removeHeader(const char * type);
00039 
00040   virtual KMime::Headers::Control* control(bool create=true)            { KMime::Headers::Control *p=0; return getHeaderInstance(p, create); }
00041   virtual KMime::Headers::Supersedes* supersedes(bool create=true)      { KMime::Headers::Supersedes *p=0; return getHeaderInstance(p, create); }
00042   virtual KMime::Headers::MailCopiesTo* mailCopiesTo(bool create=true)  { KMime::Headers::MailCopiesTo *p=0; return getHeaderInstance(p, create); }
00043   virtual KMime::Headers::Newsgroups* newsgroups(bool create=true)      { KMime::Headers::Newsgroups *p=0; return getHeaderInstance(p, create); }
00044   virtual KMime::Headers::FollowUpTo* followUpTo(bool create=true)      { KMime::Headers::FollowUpTo *p=0; return getHeaderInstance(p, create); }
00045   virtual KMime::Headers::Lines* lines(bool create=true)                { if(!create && l_ines.isEmpty()) return 0; return &l_ines; }
00046 
00047 
00048 protected:
00049   KMime::Headers::Lines l_ines;
00050 
00051 }; // class NewsArticle
00052 
00053 } // namespace KMime
00054 
00055 #endif // __KMIME_NEWSARTICLE_H__
KDE Home | KDE Accessibility Home | Description of Access Keys