Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

kioinputstream_impl.h

00001         /*
00002 
00003         Copyright (C) 2001 Nikolas Zimmermann <wildfox@kde.org>
00004 
00005         This library is free software; you can redistribute it and/or
00006         modify it under the terms of the GNU Library General Public
00007         License as published by the Free Software Foundation; either
00008         version 2 of the License, or (at your option) any later version.
00009   
00010         This library is distributed in the hope that it will be useful,
00011         but WITHOUT ANY WARRANTY; without even the implied warranty of
00012         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013         Library General Public License for more details.
00014 
00015         You should have received a copy of the GNU Library General Public License
00016         along with this library; see the file COPYING.LIB.  If not, write to
00017         the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018         Boston, MA 02111-1307, USA.
00019 
00020         */
00021 
00022 #ifndef KIOINPUTSTREAM_IMPL
00023 #define KIOINPUTSTREAM_IMPL
00024 
00025 #include <qobject.h>
00026 #include <qcstring.h>
00027 #include <kio/jobclasses.h>
00028 #include <kurl.h>
00029 #include "artskde.h"
00030 #include "stdsynthmodule.h" 
00031 
00032 namespace Arts {
00033 
00034 class KIOInputStream_impl : public QObject, virtual public KIOInputStream_skel, 
00035                                             virtual public InputStream_skel,
00036                                             virtual public StdSynthModule
00037 {
00038 Q_OBJECT
00039 public:
00040         KIOInputStream_impl();
00041         ~KIOInputStream_impl();
00042         
00043         void streamStart();     
00044         void streamEnd();
00045 
00046         bool eof();
00047         bool seekOk();
00048         long size();
00049         long seek(long);
00050 
00051         bool openURL(const std::string& url);
00052 
00053         void processQueue();
00054         void request_outdata(DataPacket<mcopbyte> *packet);
00055 
00056         long bufferPackets() { return m_packetBuffer; }
00057         void bufferPackets(long i) { m_packetBuffer = i; }
00058 
00059         long packetSize() { return m_packetSize; }
00060 
00061 signals:
00062         void mimeTypeFound(const QString & mimetype);
00063         
00064 private slots:
00065         void slotData(KIO::Job *, const QByteArray &);
00066         void slotResult(KIO::Job *);
00067         void slotScanMimeType(KIO::Job *, const QString &mimetype);
00068 
00069 private:
00070         KURL m_url;
00071         KIO::TransferJob *m_job;
00072         QByteArray m_data;
00073         bool m_finished;
00074         bool m_firstBuffer;
00075         bool m_streamStarted;
00076         bool m_streamSuspended;
00077         bool m_streamPulled;
00078 
00079         unsigned int m_packetBuffer;
00080         const unsigned int m_packetSize;
00081         
00082         static const unsigned int PACKET_COUNT;
00083 };
00084 
00085 }
00086 
00087 #endif

Generated on Wed Aug 13 23:29:52 2003 for kdelibs by doxygen1.2.18