kchmpart.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "kchmpart.h"
00018 #include <qstring.h>
00019
00020 #include <kinstance.h>
00021 #include <kglobal.h>
00022 #include <kdebug.h>
00023 #include <klocale.h>
00024 #include <kstddirs.h>
00025 #include <kaboutdata.h>
00026
00027 extern "C"
00028 {
00029 void* init_libkchmpart()
00030 {
00031 return new KChmPartFactory;
00032 }
00033 }
00034
00035 KInstance* KChmPartFactory::s_instance = 0L;
00036 KAboutData* KChmPartFactory::s_about = 0L;
00037
00038 KChmPartFactory::KChmPartFactory( QObject* parent, const char* name )
00039 : KParts::Factory( parent, name )
00040 {
00041 }
00042
00043 KChmPartFactory::~KChmPartFactory()
00044 {
00045 delete s_instance;
00046 s_instance = 0L;
00047 delete s_about;
00048 }
00049
00050 KParts::Part* KChmPartFactory::createPartObject( QWidget *parentWidget, const char *, QObject *,
00051 const char *name, const char *, const QStringList & )
00052 {
00053 KChmPart* part = new KChmPart( parentWidget, name );
00054 return part;
00055 }
00056
00057 KInstance* KChmPartFactory::instance()
00058 {
00059 if( !s_instance )
00060 {
00061 s_about = new KAboutData( "kchmpart",
00062 I18N_NOOP( "KChm" ), "1.0pre" );
00063 s_instance = new KInstance( s_about );
00064 }
00065 return s_instance;
00066 }
00067
00068
00069 KChmPart::KChmPart( QWidget * parent, const char * name )
00070 : KHTMLPart( parent, name ), m_job(0)
00071 {
00072 KInstance * instance = new KInstance( "kchmpart" );
00073 setInstance( instance );
00074 m_extension=new KParts::BrowserExtension(this);
00075 }
00076
00077 bool KChmPart::openURL( const KURL &url )
00078 {
00079 KURL chmURL = url;
00080 chmURL.setProtocol("ms-its");
00081 chmURL.addPath("/");
00082 return KHTMLPart::openURL(chmURL);
00083 }
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 #include "kchmpart.moc"
00113
This file is part of the documentation for KDevelop Version 3.1.2.