parts/doctreeview/chm/kchmpart.h
Go to the documentation of this file.00001 /* This library is free software; you can redistribute it and/or 00002 modify it under the terms of the GNU Library General Public 00003 License as published by the Free Software Foundation; either 00004 version 2 of the License, or (at your option) any later version. 00005 00006 This library is distributed in the hope that it will be useful, 00007 but WITHOUT ANY WARRANTY; without even the implied warranty of 00008 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00009 Library General Public License for more details. 00010 00011 You should have received a copy of the GNU Library General Public License 00012 along with this library; see the file COPYING.LIB. If not, write to 00013 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00014 Boston, MA 02111-1307, USA. 00015 */ 00016 00017 #ifndef __kchmpart_h__ 00018 #define __kchmpart_h__ 00019 00020 #include <kparts/factory.h> 00021 #include <kparts/part.h> 00022 #include <kparts/browserextension.h> 00023 #include <khtml_part.h> 00024 #include <kio/job.h> 00025 #include <kio/jobclasses.h> 00026 00027 #include <qcstring.h> 00028 00029 class KInstance; 00030 class KAboutData; 00031 00032 class KChmPartFactory: public KParts::Factory 00033 { 00034 Q_OBJECT 00035 public: 00036 KChmPartFactory( QObject *parent = 0, const char *name = 0 ); 00037 virtual ~KChmPartFactory(); 00038 00039 virtual KParts::Part* createPartObject( 00040 QWidget *parentWidget, const char *widgetName, 00041 QObject *parent, const char *name, 00042 const char *classname, const QStringList &args ); 00043 00044 static KInstance *instance(); 00045 00046 private: 00047 static KInstance *s_instance; 00048 static KAboutData *s_about; 00049 00050 }; 00051 00052 00053 class KChmPart : public KHTMLPart 00054 { 00055 Q_OBJECT 00056 public: 00057 KChmPart( QWidget *, const char * = 0 ); 00058 KParts::BrowserExtension * extension() { return m_extension; } 00059 00060 public slots: 00061 virtual bool openURL( const KURL & ); 00062 /* 00063 protected slots: 00064 void readData(KIO::Job * , const QByteArray & data); 00065 void jobDone( KIO::Job *); 00066 */ 00067 protected: 00068 //virtual bool openFile(); 00069 KInstance *m_instance; 00070 KParts::BrowserExtension *m_extension; 00071 KIO::TransferJob *m_job; 00072 QCString m_htmlData; 00073 }; 00074 00075 #endif // __kchmpart_h__ 00076