• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/kio
 

kio/kio

  • kio
  • kio
dataslave.h
1 // -*- c++ -*-
2 /*
3  * This file is part of the KDE libraries
4  * Copyright (c) 2003 Leo Savernik <l.savernik@aon.at>
5  * Derived from slave.h
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License version 2 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  **/
21 
22 #ifndef __KIO_DATASLAVE_H__
23 #define __KIO_DATASLAVE_H__
24 
25 #include <kio/global.h>
26 #include <kio/slave.h>
27 
28 class TQTimer;
29 
30 // don't forget to sync DISPATCH_IMPL in dataslave.h
31 #define DISPATCH_DECL(type) \
32  void dispatch_##type();
33 
34 // don't forget to sync DISPATCH_IMPL1 in dataslave.h
35 #define DISPATCH_DECL1(type, paramtype, param) \
36  void dispatch_##type(paramtype param);
37 
38 namespace KIO {
39 
49  class DataSlave : public KIO::Slave {
50  Q_OBJECT
51  public:
52  DataSlave();
53 
54  virtual ~DataSlave();
55 
56  virtual void setHost(const TQString &host, int port,
57  const TQString &user, const TQString &passwd);
58  virtual void setConfig(const MetaData &config);
59 
60  virtual void suspend();
61  virtual void resume();
62  virtual bool suspended();
63  virtual void send(int cmd, const TQByteArray &data = TQByteArray());
64 
65  virtual void hold(const KURL &url);
66 
67  // pure virtual methods that are defined by the actual protocol
68  virtual void get(const KURL &url) = 0;
69  virtual void mimetype(const KURL &url) = 0;
70 
71  protected:
76  void setAllMetaData(const MetaData &);
81  void sendMetaData();
82 
83  // queueing methods
85  enum QueueType { Queue_mimeType = 1, Queue_totalSize,
86  Queue_sendMetaData, Queue_data, Queue_finished };
90  struct QueueStruct {
91  QueueType type;
92  TQString s;
93  KIO::filesize_t size;
94  TQByteArray ba;
95 
96  QueueStruct() {}
97  QueueStruct(QueueType type) : type(type) {}
98  };
99  typedef TQValueList<QueueStruct> DispatchQueue;
100  DispatchQueue dispatchQueue;
101 
102  DISPATCH_DECL1(mimeType, const TQString &, s)
103  DISPATCH_DECL1(totalSize, KIO::filesize_t, size)
104  DISPATCH_DECL(sendMetaData)
105  DISPATCH_DECL1(data, const TQByteArray &, ba)
106  DISPATCH_DECL(finished)
107 
108  protected slots:
112  void dispatchNext();
113  protected:
114  virtual void virtual_hook( int id, void* data );
115  private:
116  MetaData meta_data;
117  bool _suspended;
118  TQTimer *timer;
119  };
120 
121 }
122 
123 #undef DISPATCH_DECL
124 #undef DISPATCH_DECL1
125 
126 #endif /*__KIO_DATASLAVE_H__*/
KIO::DataSlave::sendMetaData
void sendMetaData()
Sends metadata set with setAllMetaData.
Definition: dataslave.cpp:167
KIO::DataSlave::QueueStruct
structure for queueing.
Definition: dataslave.h:90
KIO
A namespace for KIO globals.
Definition: authinfo.h:29
KIO::MetaData
MetaData is a simple map of key/value strings.
Definition: global.h:514
KIO::Slave
Attention developers: If you change the implementation of KIO::Slave, do not use connection() or slav...
Definition: slave.h:44
KIO::DataSlave::setAllMetaData
void setAllMetaData(const MetaData &)
Sets metadata.
Definition: dataslave.cpp:163
KIO::DataSlave::QueueType
QueueType
identifiers of functions to be queued
Definition: dataslave.h:85
KIO::Slave::passwd
TQString passwd()
Definition: slave.h:139
KIO::Slave::user
TQString user()
Definition: slave.h:134
KIO::Slave::host
TQString host()
Definition: slave.h:124
KIO::filesize_t
TQ_ULLONG filesize_t
64-bit file size
Definition: global.h:39
KIO::Slave::port
int port()
Definition: slave.h:129
KIO::DataSlave
This class provides a high performance implementation for the data url scheme (rfc2397).
Definition: dataslave.h:49
KIO::DataSlave::dispatchNext
void dispatchNext()
dispatches next queued method.
Definition: dataslave.cpp:99

kio/kio

Skip menu "kio/kio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kio/kio

Skip menu "kio/kio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kio by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |