• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.3 API Reference
  • KDE Home
  • Contact Us
 

kioslave/nntp

nntp.h
00001 /* This file is part of KDE
00002    Copyright (C) 2000 by Wolfram Diestel <wolfram@steloj.de>
00003    Copyright (C) 2005 by Tim Way <tim@way.hrcoxmail.com>
00004    Copyright (C) 2005 by Volker Krause <vkrause@kde.org>
00005 
00006    This is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
00009 */
00010 
00011 #ifndef _NNTP_H
00012 #define _NNTP_H
00013 
00014 
00015 #include <kio/global.h>
00016 #include <kio/tcpslavebase.h>
00017 
00018 #define MAX_PACKET_LEN 8192
00019 
00020 /* TODO:
00021   - test special post command
00022   - progress information in get, and maybe post
00023   - remove unnecessary debug stuff
00024 */
00034 class NNTPProtocol:public KIO::TCPSlaveBase
00035 {
00036 
00037  public:
00041   NNTPProtocol ( const QByteArray & pool, const QByteArray & app, bool isSSL );
00042   virtual ~NNTPProtocol();
00043 
00044   virtual void get(const KUrl& url );
00045   virtual void put( const KUrl& url, int permissions, KIO::JobFlags flags );
00046   virtual void stat(const KUrl& url );
00047   virtual void listDir(const KUrl& url );
00048   virtual void setHost(const QString& host, quint16 port,
00049         const QString& user, const QString& pass);
00050 
00058   virtual void special(const QByteArray& data);
00059 
00060  protected:
00061 
00066   int sendCommand( const QString &cmd );
00067 
00072   void nntp_close ();
00073 
00078   bool nntp_open();
00079 
00083   bool post_article();
00084 
00085 
00086  private:
00087    QString mHost, mUser, mPass;
00088    quint16 m_port, m_defaultPort;
00089    bool postingAllowed, isAuthenticated;
00090    char readBuffer[MAX_PACKET_LEN];
00091    ssize_t readBufferLen;
00093    QString mCurrentGroup;
00094 
00101    void fetchGroups( const QString &since, bool desc );
00111    bool fetchGroup ( QString &group, unsigned long first = 0, unsigned long max = 0 );
00118    bool fetchGroupRFC977( unsigned long first );
00129    bool fetchGroupXOVER( unsigned long first, bool &notSupported );
00131    void fillUDSEntry ( KIO::UDSEntry & entry, const QString & name, long size,
00132                        bool is_article, long access = 0 );
00134    void unexpected_response ( int res_code, const QString & command );
00140    int evalResponse ( char *data, ssize_t &len );
00146    int authenticate();
00147 };
00148 
00149 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:40:58 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kioslave/nntp

Skip menu "kioslave/nntp"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal