khtml Library API Documentation

kmultipart.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002 David Faure <david@mandrakesoft.com>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef __kmultipart_h__
00021 #define __kmultipart_h__
00022 
00023 #include <httpfilter/httpfilter.h>
00024 
00025 #include <kparts/part.h>
00026 #include <kparts/factory.h>
00027 #include <kparts/browserextension.h>
00028 #include <kaboutdata.h>
00029 
00030 class KHTMLPart;
00031 class KInstance;
00032 class KTempFile;
00033 class KLineParser;
00034 
00038 class KMultiPart : public KParts::ReadOnlyPart
00039 {
00040     Q_OBJECT
00041 public:
00042     KMultiPart( QWidget *parentWidget, const char *widgetName,
00043                 QObject *parent, const char *name, const QStringList& );
00044     virtual ~KMultiPart();
00045 
00046     virtual bool openFile() { return false; }
00047     virtual bool openURL( const KURL &url );
00048 
00049     virtual bool closeURL();
00050 
00051     static KAboutData* createAboutData();
00052 
00053 protected:
00054     virtual void guiActivateEvent( KParts::GUIActivateEvent *e );
00055     void setPart( const QString& mimeType );
00056 
00057     void startOfData();
00058     void sendData( const QByteArray& line );
00059     void endOfData();
00060 
00061 private slots:
00062     void reallySendData( const QByteArray& line );
00063     //void slotPopupMenu( KXMLGUIClient *cl, const QPoint &pos, const KURL &u, const QString &mime, mode_t mode );
00064     void slotJobFinished( KIO::Job *job );
00065     void slotData( KIO::Job *, const QByteArray & );
00066     //void updateWindowCaption();
00067 
00068     void slotPartCompleted();
00069 
00070     void startHeader();
00071 
00072 private:
00073     KParts::BrowserExtension* m_extension;
00074     QGuardedPtr<KParts::ReadOnlyPart> m_part;
00075     bool m_isHTMLPart;
00076     KIO::Job* m_job;
00077     QCString m_boundary;
00078     int m_boundaryLength;
00079     QString m_mimeType; // the one handled by m_part - store the kservice instead?
00080     QString m_nextMimeType; // while parsing headers
00081     KTempFile* m_tempFile;
00082     KLineParser* m_lineParser;
00083     bool m_bParsingHeader;
00084     bool m_bGotAnyHeader;
00085     bool m_gzip;
00086     HTTPFilterBase *m_filter;
00087 };
00088 
00089 #if 0
00090 class KMultiPartBrowserExtension : public KParts::BrowserExtension
00091 {
00092     //Q_OBJECT
00093 public:
00094     KMultiPartBrowserExtension( KMultiPart *parent, const char *name = 0 );
00095 
00096     virtual int xOffset();
00097     virtual int yOffset();
00098 
00099 //protected slots:
00100     void print();
00101     void reparseConfiguration();
00102 
00103 private:
00104     KMultiPart *m_imgPart;
00105 };
00106 #endif
00107 
00108 #endif
KDE Logo
This file is part of the documentation for khtml Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed May 5 07:18:29 2004 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003