21#ifndef __TDEIO_DATASLAVE_H__
22#define __TDEIO_DATASLAVE_H__
24#include <tdeio/global.h>
25#include <tdeio/slave.h>
30#define DISPATCH_DECL(type) \
31 void dispatch_##type();
34#define DISPATCH_DECL1(type, paramtype, param) \
35 void dispatch_##type(paramtype param);
55 virtual void setHost(
const TQString &
host,
int port,
57 virtual void setConfig(
const MetaData &config);
62 virtual void send(
int cmd,
const TQByteArray &data = TQByteArray());
64 virtual void hold(
const KURL &url);
67 virtual void get(
const KURL &url) = 0;
68 virtual void mimetype(
const KURL &url) = 0;
84 enum QueueType { Queue_mimeType = 1, Queue_totalSize,
85 Queue_sendMetaData, Queue_data, Queue_finished };
96 QueueStruct(
QueueType type) : type(type) {}
98 typedef TQValueList<QueueStruct> DispatchQueue;
99 DispatchQueue dispatchQueue;
101 DISPATCH_DECL1(mimeType,
const TQString &, s)
104 DISPATCH_DECL1(data,
const TQByteArray &, ba)
105 DISPATCH_DECL(finished)
113 virtual void virtual_hook(
int id,
void* data );
void dispatchNext()
dispatches next queued method.
void setAllMetaData(const MetaData &)
Sets metadata.
QueueType
identifiers of functions to be queued
void sendMetaData()
Sends metadata set with setAllMetaData.
Attention developers: If you change the implementation of TDEIO::Slave, do not use connection() or sl...
bool suspended()
Tells wether the tdeioslave is suspended.
void suspend()
Suspends the operation of the attached tdeioslave.
void resume()
Resumes the operation of the attached tdeioslave.
A namespace for TDEIO globals.
TQ_ULLONG filesize_t
64-bit file size