You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
146 lines
4.7 KiB
146 lines
4.7 KiB
15 years ago
|
// -*- c++ -*-
|
||
|
|
||
|
/* This file is part of the KDE project
|
||
|
*
|
||
|
* Copyright (C) 2003 Koos Vriezen <koos.vriezen@xs4all.nl>
|
||
|
*
|
||
|
* This library is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU Library General Public
|
||
|
* License as published by the Free Software Foundation; either
|
||
|
* version 2 of the License, or (at your option) any later version.
|
||
|
*
|
||
|
* This library is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* Library General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Library General Public License
|
||
|
* along with this library; see the file COPYING.LIB. If not, write to
|
||
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef KJAVAAPPLETVIEWER_H
|
||
|
#define KJAVAAPPLETVIEWER_H
|
||
|
|
||
12 years ago
|
#include <tdeparts/part.h>
|
||
|
#include <tdeparts/browserextension.h>
|
||
|
#include <tdeparts/statusbarextension.h>
|
||
|
#include <tdeparts/factory.h>
|
||
15 years ago
|
#include <kdialogbase.h>
|
||
|
#include <kurl.h>
|
||
14 years ago
|
#include <tqobject.h>
|
||
|
#include <tqstringlist.h>
|
||
|
#include <tqguardedptr.h>
|
||
15 years ago
|
|
||
|
#include "kjavaappletwidget.h"
|
||
|
|
||
14 years ago
|
class TQTable;
|
||
|
class TQLabel;
|
||
15 years ago
|
class KJavaProcess;
|
||
|
class KJavaAppletViewer;
|
||
12 years ago
|
class TDEAboutData;
|
||
|
class TDEInstance;
|
||
12 years ago
|
class TDEConfig;
|
||
15 years ago
|
class CoverWidget;
|
||
|
|
||
|
class KJavaAppletViewerBrowserExtension : public KParts::BrowserExtension {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
KJavaAppletViewerBrowserExtension (KJavaAppletViewer *parent);
|
||
14 years ago
|
void urlChanged (const TQString & url);
|
||
15 years ago
|
void setLoadingProgress (int percentage);
|
||
|
|
||
|
void setURLArgs (const KParts::URLArgs & args);
|
||
14 years ago
|
void saveState (TQDataStream & stream);
|
||
|
void restoreState (TQDataStream & stream);
|
||
15 years ago
|
public slots:
|
||
14 years ago
|
void showDocument (const TQString & doc, const TQString & frame);
|
||
15 years ago
|
};
|
||
|
|
||
|
class KJavaAppletViewerLiveConnectExtension : public KParts::LiveConnectExtension {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
KJavaAppletViewerLiveConnectExtension(KJavaAppletViewer * parent);
|
||
|
|
||
14 years ago
|
bool get (const unsigned long objid, const TQString & field, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, TQString & value);
|
||
|
bool put(const unsigned long, const TQString & field, const TQString & value);
|
||
|
bool call (const unsigned long , const TQString & func, const TQStringList & args, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, TQString & value);
|
||
15 years ago
|
void unregister (const unsigned long objid);
|
||
|
|
||
|
int jsSessions () const { return m_jssessions; }
|
||
|
public slots:
|
||
14 years ago
|
void jsEvent (const TQStringList & args);
|
||
15 years ago
|
signals:
|
||
14 years ago
|
virtual void partEvent (const unsigned long objid, const TQString & event, const KParts::LiveConnectExtension::ArgList & args);
|
||
15 years ago
|
|
||
|
private:
|
||
|
KJavaAppletViewer * m_viewer;
|
||
|
static int m_jssessions;
|
||
|
};
|
||
|
|
||
|
class KJavaAppletViewer : public KParts::ReadOnlyPart {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
14 years ago
|
KJavaAppletViewer (TQWidget * wparent, const char * wname,
|
||
|
TQObject * parent, const char * name, const TQStringList &args);
|
||
15 years ago
|
~KJavaAppletViewer ();
|
||
|
CoverWidget * view () const { return m_view; }
|
||
12 years ago
|
static TDEAboutData* createAboutData ();
|
||
15 years ago
|
|
||
|
KJavaAppletViewerBrowserExtension * browserextension() const
|
||
|
{ return m_browserextension; }
|
||
|
KParts::LiveConnectExtension * liveConnectExtension () const
|
||
|
{ return m_liveconnect; }
|
||
|
|
||
14 years ago
|
bool eventFilter (TQObject *o, TQEvent *e);
|
||
15 years ago
|
|
||
|
bool appletAlive () const;
|
||
|
public slots:
|
||
|
virtual bool openURL (const KURL & url);
|
||
|
virtual bool closeURL ();
|
||
|
void appletLoaded ();
|
||
14 years ago
|
void infoMessage (const TQString &);
|
||
15 years ago
|
protected:
|
||
|
bool openFile();
|
||
|
private slots:
|
||
|
void delayedCreateTimeOut ();
|
||
|
private:
|
||
14 years ago
|
TQGuardedPtr <CoverWidget> m_view;
|
||
12 years ago
|
TDEConfig * m_config;
|
||
15 years ago
|
KJavaProcess * process;
|
||
|
KJavaAppletViewerBrowserExtension * m_browserextension;
|
||
|
KJavaAppletViewerLiveConnectExtension * m_liveconnect;
|
||
|
KParts::StatusBarExtension * m_statusbar;
|
||
14 years ago
|
TQGuardedPtr <TQLabel> m_statusbar_icon;
|
||
|
TQString baseurl;
|
||
15 years ago
|
bool m_closed;
|
||
|
};
|
||
|
|
||
|
class KJavaAppletViewerFactory : public KParts::Factory {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
KJavaAppletViewerFactory ();
|
||
|
virtual ~KJavaAppletViewerFactory ();
|
||
|
virtual KParts::Part *createPartObject
|
||
14 years ago
|
(TQWidget *wparent, const char *wname,
|
||
|
TQObject *parent, const char *name,
|
||
|
const char *className, const TQStringList &args);
|
||
12 years ago
|
static TDEInstance * instance () { return s_instance; }
|
||
15 years ago
|
private:
|
||
12 years ago
|
static TDEInstance * s_instance;
|
||
15 years ago
|
};
|
||
|
|
||
|
class AppletParameterDialog : public KDialogBase {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
AppletParameterDialog (KJavaAppletWidget * parent);
|
||
|
protected slots:
|
||
|
void slotClose ();
|
||
|
private:
|
||
|
KJavaAppletWidget * m_appletWidget;
|
||
14 years ago
|
TQTable * table;
|
||
15 years ago
|
};
|
||
|
|
||
|
#endif
|