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

kioslave/nntp

  • kioslave
  • nntp
nntp.h
1 /* This file is part of KDE
2  Copyright (C) 2000 by Wolfram Diestel <wolfram@steloj.de>
3  Copyright (C) 2005 by Tim Way <tim@way.hrcoxmail.com>
4  Copyright (C) 2005 by Volker Krause <vkrause@kde.org>
5 
6  This is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 */
10 
11 #ifndef _NNTP_H
12 #define _NNTP_H
13 
14 #include <kurl.h>
15 #include <kio/global.h>
16 #include <kio/tcpslavebase.h>
17 
18 #define MAX_PACKET_LEN 8192
19 
20 /* TODO:
21  - test special post command
22  - progress information in get, and maybe post
23  - remove unnecessary debug stuff
24 */
34 class NNTPProtocol:public KIO::TCPSlaveBase
35 {
36 
37  public:
41  NNTPProtocol ( const QByteArray & pool, const QByteArray & app, bool isSSL );
42  virtual ~NNTPProtocol();
43 
44  virtual void get(const KUrl& url );
45  virtual void put( const KUrl& url, int permissions, KIO::JobFlags flags );
46  virtual void stat(const KUrl& url );
47  virtual void listDir(const KUrl& url );
48  virtual void setHost(const QString& host, quint16 port,
49  const QString& user, const QString& pass);
50 
59  virtual void special(const QByteArray& data);
60 
61  protected:
62 
68  int sendCommand( const QString &cmd );
69 
74  void nntp_close ();
75 
80  bool nntp_open();
81 
85  bool post_article();
86 
87 
88  private:
89  QString mHost, mUser, mPass;
90  quint16 m_port, m_defaultPort;
91  bool postingAllowed, isAuthenticated;
92  char readBuffer[MAX_PACKET_LEN];
93  ssize_t readBufferLen;
95  QString mCurrentGroup;
96 
103  void fetchGroups( const QString &since, bool desc );
113  bool fetchGroup ( QString &group, unsigned long first = 0, unsigned long max = 0 );
120  bool fetchGroupRFC977( unsigned long first );
131  bool fetchGroupXOVER( unsigned long first, bool &notSupported );
133  void fillUDSEntry ( KIO::UDSEntry & entry, const QString & name, long size,
134  bool is_article, long access = 0 );
136  void unexpected_response ( int res_code, const QString & command );
142  int evalResponse ( char *data, ssize_t &len );
148  int authenticate();
149 };
150 
151 #endif
NNTPProtocol::nntp_open
bool nntp_open()
Attempt to initiate a NNTP connection via a TCP socket, if no existing connection could be reused...
Definition: nntp.cpp:732
NNTPProtocol::special
virtual void special(const QByteArray &data)
Special command: 1 = post article it takes no other args, the article data are requested by dataReq()...
Definition: nntp.cpp:187
NNTPProtocol::post_article
bool post_article()
Post article.
Definition: nntp.cpp:203
NNTPProtocol::sendCommand
int sendCommand(const QString &cmd)
Send a command to the server.
Definition: nntp.cpp:794
NNTPProtocol::NNTPProtocol
NNTPProtocol(const QByteArray &pool, const QByteArray &app, bool isSSL)
Default Constructor.
Definition: nntp.cpp:63
NNTPProtocol
NNTP KIO slave.
Definition: nntp.h:34
NNTPProtocol::nntp_close
void nntp_close()
Attempt to properly shut down the NNTP connection by sending &quot;QUIT\r\n&quot; before closing the socket...
Definition: nntp.cpp:723
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:02:21 by doxygen 1.8.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.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • 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