• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KHTML

kjavaappletviewer.h

Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor,
00020  * Boston, MA 02110-1301, 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/statusbarextension.h>
00029 #include <kparts/factory.h>
00030 #include <kdialogbase.h>
00031 #include <kurl.h>
00032 #include <qobject.h>
00033 #include <qstringlist.h>
00034 #include <qguardedptr.h>
00035 
00036 #include "kjavaappletwidget.h"
00037 
00038 class QTable;
00039 class QLabel;
00040 class KJavaProcess;
00041 class KJavaAppletViewer;
00042 class KAboutData;
00043 class KInstance;
00044 class KConfig;
00045 class CoverWidget;
00046 
00047 class KJavaAppletViewerBrowserExtension : public KParts::BrowserExtension {
00048     Q_OBJECT
00049 public:
00050     KJavaAppletViewerBrowserExtension (KJavaAppletViewer *parent);
00051     void urlChanged (const QString & url);
00052     void setLoadingProgress (int percentage);
00053 
00054     void setURLArgs (const KParts::URLArgs & args);
00055     void saveState (QDataStream & stream);
00056     void restoreState (QDataStream & stream);
00057 public slots:
00058     void showDocument (const QString & doc, const QString & frame);
00059 };
00060 
00061 class KJavaAppletViewerLiveConnectExtension : public KParts::LiveConnectExtension {
00062     Q_OBJECT
00063 public:
00064     KJavaAppletViewerLiveConnectExtension(KJavaAppletViewer * parent);
00065 
00066     bool get (const unsigned long objid, const QString & field, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, QString & value);
00067     bool put(const unsigned long, const QString & field, const QString & value);
00068     bool call (const unsigned long , const QString & func, const QStringList & args, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, QString & value);
00069     void unregister (const unsigned long objid);
00070 
00071     int jsSessions () const { return m_jssessions; }
00072 public slots:
00073     void jsEvent (const QStringList & args);
00074 signals:
00075     virtual void partEvent (const unsigned long objid, const QString & event, const KParts::LiveConnectExtension::ArgList & args);
00076 
00077 private:
00078     KJavaAppletViewer * m_viewer;
00079     static int m_jssessions;
00080 };
00081 
00082 class KJavaAppletViewer : public KParts::ReadOnlyPart {
00083     Q_OBJECT
00084 public: 
00085     KJavaAppletViewer (QWidget * wparent, const char * wname,
00086               QObject * parent, const char * name, const QStringList &args);
00087     ~KJavaAppletViewer ();
00088     CoverWidget * view () const { return m_view; }
00089     static KAboutData* createAboutData ();
00090 
00091     KJavaAppletViewerBrowserExtension * browserextension() const
00092         { return m_browserextension; }
00093     KParts::LiveConnectExtension * liveConnectExtension () const
00094         { return m_liveconnect; }
00095 
00096     bool eventFilter (QObject *o, QEvent *e);
00097 
00098     bool appletAlive () const;
00099 public slots:
00100     virtual bool openURL (const KURL & url);
00101     virtual bool closeURL ();
00102     void appletLoaded ();
00103     void infoMessage (const QString &);
00104 protected:
00105     bool openFile();
00106 private slots:
00107     void delayedCreateTimeOut ();
00108 private:
00109     QGuardedPtr <CoverWidget> m_view;
00110     KConfig * m_config;
00111     KJavaProcess * process;
00112     KJavaAppletViewerBrowserExtension * m_browserextension;
00113     KJavaAppletViewerLiveConnectExtension * m_liveconnect;
00114     KParts::StatusBarExtension * m_statusbar;
00115     QGuardedPtr <QLabel> m_statusbar_icon;
00116     QString baseurl;
00117     bool m_closed;
00118 };
00119 
00120 class KJavaAppletViewerFactory : public KParts::Factory {
00121     Q_OBJECT
00122 public:
00123     KJavaAppletViewerFactory ();
00124     virtual ~KJavaAppletViewerFactory ();
00125     virtual KParts::Part *createPartObject 
00126         (QWidget *wparent, const char *wname,
00127          QObject *parent, const char *name,
00128          const char *className, const QStringList &args);
00129     static KInstance * instance () { return s_instance; }
00130 private:
00131     static KInstance * s_instance;
00132 };
00133 
00134 class AppletParameterDialog : public KDialogBase {
00135     Q_OBJECT
00136 public:
00137     AppletParameterDialog (KJavaAppletWidget * parent);
00138 protected slots:
00139     void slotClose ();
00140 private:
00141     KJavaAppletWidget * m_appletWidget;
00142     QTable * table;
00143 };
00144 
00145 #endif

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal