khtml Library API Documentation

kjavaappletviewer.h

00001 // -*- c++ -*-
00002 
00003 /* This file is part of the KDE project
00004  *
00005  * Copyright (C) 2003 Koos Vriezen <koos.vriezen@xs4all.nl>
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Library General Public License
00018  * along with this library; see the file COPYING.LIB.  If not, write to
00019  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA 02111-1307, USA.
00021  */
00022 
00023 #ifndef KJAVAAPPLETVIEWER_H
00024 #define KJAVAAPPLETVIEWER_H
00025 
00026 #include <kparts/part.h>
00027 #include <kparts/browserextension.h>
00028 #include <kparts/factory.h>
00029 #include <kdialogbase.h>
00030 #include <kurl.h>
00031 #include <qobject.h>
00032 #include <qstringlist.h>
00033 #include <qguardedptr.h>
00034 
00035 #include "kjavaappletwidget.h"
00036 
00037 class QTable;
00038 class KJavaProcess;
00039 class KJavaAppletViewer;
00040 class KAboutData;
00041 class KInstance;
00042 class KConfig;
00043 class CoverWidget;
00044 
00045 class KJavaAppletViewerBrowserExtension : public KParts::BrowserExtension {
00046     Q_OBJECT
00047 public:
00048     KJavaAppletViewerBrowserExtension (KJavaAppletViewer *parent);
00049     void urlChanged (const QString & url);
00050     void setLoadingProgress (int percentage);
00051 
00052     void setURLArgs (const KParts::URLArgs & args);
00053     void saveState (QDataStream & stream);
00054     void restoreState (QDataStream & stream);
00055 public slots:
00056     void showDocument (const QString & doc, const QString & frame);
00057 };
00058 
00059 class KJavaAppletViewerLiveConnectExtension : public KParts::LiveConnectExtension {
00060     Q_OBJECT
00061 public:
00062     KJavaAppletViewerLiveConnectExtension(KJavaAppletViewer * parent);
00063 
00064     bool get (const unsigned long objid, const QString & field, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, QString & value);
00065     bool put(const unsigned long, const QString & field, const QString & value);
00066     bool call (const unsigned long , const QString & func, const QStringList & args, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, QString & value);
00067     void unregister (const unsigned long objid);
00068 
00069     int jsSessions () const { return m_jssessions; }
00070 public slots:
00071     void jsEvent (const QStringList & args);
00072 signals:
00073     virtual void partEvent (const unsigned long objid, const QString & event, const KParts::LiveConnectExtension::ArgList & args);
00074 
00075 private:
00076     KJavaAppletViewer * m_viewer;
00077     static int m_jssessions;
00078 };
00079 
00080 class KJavaAppletViewer : public KParts::ReadOnlyPart {
00081     Q_OBJECT
00082 public: 
00083     KJavaAppletViewer (QWidget * wparent, const char * wname,
00084               QObject * parent, const char * name, const QStringList &args);
00085     ~KJavaAppletViewer ();
00086     CoverWidget * view () const { return m_view; }
00087     static KAboutData* createAboutData ();
00088 
00089     KJavaAppletViewerBrowserExtension * browserextension() const
00090         { return m_browserextension; }
00091     KParts::LiveConnectExtension * liveConnectExtension () const
00092         { return m_liveconnect; }
00093 
00094     bool eventFilter (QObject *o, QEvent *e);
00095 
00096     bool appletAlive () const;
00097 public slots:
00098     virtual bool openURL (const KURL & url);
00099     virtual bool closeURL ();
00100     void appletLoaded ();
00101     void infoMessage (const QString &);
00102 protected:
00103     bool openFile();
00104 private slots:
00105     void delayedCreateTimeOut ();
00106 private:
00107     QGuardedPtr <CoverWidget> m_view;
00108     KConfig * m_config;
00109     KJavaProcess * process;
00110     KJavaAppletViewerBrowserExtension * m_browserextension;
00111     KJavaAppletViewerLiveConnectExtension * m_liveconnect;
00112     QString baseurl;
00113     bool m_closed;
00114 };
00115 
00116 class KJavaAppletViewerFactory : public KParts::Factory {
00117     Q_OBJECT
00118 public:
00119     KJavaAppletViewerFactory ();
00120     virtual ~KJavaAppletViewerFactory ();
00121     virtual KParts::Part *createPartObject 
00122         (QWidget *wparent, const char *wname,
00123          QObject *parent, const char *name,
00124          const char *className, const QStringList &args);
00125     static KInstance * instance () { return s_instance; }
00126 private:
00127     static KInstance * s_instance;
00128 };
00129 
00130 class AppletParameterDialog : public KDialogBase {
00131     Q_OBJECT
00132 public:
00133     AppletParameterDialog (KJavaAppletWidget * parent);
00134 protected slots:
00135     void slotClose ();
00136 private:
00137     KJavaAppletWidget * m_appletWidget;
00138     QTable * table;
00139 };
00140 
00141 #endif
KDE Logo
This file is part of the documentation for khtml Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed May 4 06:56:39 2005 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003