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

tdeio/tdeio

  • tdeio
  • tdeio
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 __TDEIO_DATASLAVE_H__
23 #define __TDEIO_DATASLAVE_H__
24 
25 #include <tdeio/global.h>
26 #include <tdeio/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 TDEIO {
39 
49  class DataSlave : public TDEIO::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  TDEIO::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, TDEIO::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 /*__TDEIO_DATASLAVE_H__*/

tdeio/tdeio

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

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.