# khtml Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# kjavaapplet.h

    00001 // -*- c++ -*-
    00002 /* This file is part of the KDE project
    00003  *
    00004  * Copyright (C) 2000 Richard Moore <rich@kde.org>
    00005  *               2000 Wynn Wilkes <wynnw@caldera.com>
    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
    00024 #ifndef KJAVAAPPLET_H
    00025 #define KJAVAAPPLET_H
    00026
    00027 #include <kurl.h>
    00028 #include <kparts/browserextension.h>
    00029
    00030 #include <qobject.h>
    00031 #include <qmap.h>
    00032
    00045 class KJavaApplet;
    00046 class KJavaAppletWidget;
    00047 class KJavaAppletContext;
    00048 class KJavaAppletPrivate;
    00049
    00050 class KJavaLiveConnect : public KParts::LiveConnectExtension
    00051 {
    00052 Q_OBJECT
    00053
    00054 public:
    00055     KJavaLiveConnect(KJavaAppletContext*, KJavaApplet*);
    00056
    00057     bool get( const unsigned long objid, const QString & field, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, QString & value );
    00058     bool put( const unsigned long, const QString & field, const QString & value );
    00059     bool call( const unsigned long , const QString & func, const QStringList & args, KParts::LiveConnectExtension::Type & type, unsigned long & retobjid, QString & value );
    00060     void unregister( const unsigned long objid );
    00061
    00062     void sendEvent(const unsigned long objid, const QString & event, const KParts::LiveConnectExtension::ArgList & args ) {
    00063         emit partEvent(objid, event, args);
    00064     }
    00065 signals:
    00066
    00067   virtual void partEvent( const unsigned long objid, const QString & event, const KParts::LiveConnectExtension::ArgList & args );
    00068
    00069 private:
    00070
    00071   KJavaAppletContext *context;
    00072   KJavaApplet *applet;
    00073 };
    00074
    00075 class KJavaApplet : public QObject
    00076 {
    00077 Q_OBJECT
    00078
    00079 public:
    00080     // states describing the life cycle of an applet.
    00081     // keep in sync with applet state in KJASAppletStub.java !
    00082     typedef enum {
    00083          UNKNOWN      = 0,
    00084          CLASS_LOADED = 1,
    00085          INSTANCIATED = 2,
    00086          INITIALIZED  = 3,
    00087          STARTED      = 4,
    00088          STOPPED      = 5,
    00089          DESTROYED    = 6
    00090     } AppletState;
    00091     KJavaApplet( KJavaAppletWidget* _parent, KJavaAppletContext* _context = 0 );
    00092     ~KJavaApplet();
    00093
    00097     void setAppletContext( KJavaAppletContext* _context );
    00098
    00102     void setAppletClass( const QString& clazzName );
    00103
    00107     QString& appletClass();
    00108
    00112     void setBaseURL( const QString& base );
    00113
    00117     QString& baseURL();
    00118
    00122     void setCodeBase( const QString& codeBase );
    00123
    00127     QString& codeBase();
    00128
    00133     void setArchives( const QString& _archives );
    00134
    00139     QString& archives();
    00140
    00144     void setAppletName( const QString& name );
    00145
    00149     QString& appletName();
    00150
    00154     void setSize( QSize size );
    00155
    00159     QSize size();
    00160
    00164     void setParameter( const QString& name, const QString& value );
    00165
    00170     QString& parameter( const QString& name );
    00171
    00175     QMap<QString,QString>& getParams();
    00176
    00180     KParts::LiveConnectExtension * getLiveConnectExtension() {
    00181         return liveconnect;
    00182     }
    00183
    00187     void setWindowName( const QString& title );
    00188
    00192     QString& getWindowName();
    00193
    00197     void resizeAppletWidget( int width, int height );
    00198
    00203     void create();
    00204
    00209     void init();
    00210
    00214     bool isCreated();
    00215
    00219     void start();
    00220
    00224     void stop();
    00225
    00229     int  appletId();
    00230
    00234     void setAppletId( int id );
    00235
    00236     KJavaAppletContext* getContext() const { return context; }
    00237
    00241     void setUser(const QString & _user) { username = _user; }
    00242     const QString & user () const { return username; }
    00243
    00247     void setPassword(const QString & _password) { userpassword = _password; }
    00248     const QString & password () const { return userpassword; }
    00249
    00253     void setAuthName(const QString & _auth) { authname = _auth; }
    00254     const QString & authName () const { return authname; }
    00255
    00261     void stateChange ( const int newState );
    00262     void setFailed ();
    00263     AppletState state() const;
    00264     bool failed() const;
    00265     bool isAlive() const;
    00266
    00267 private:
    00268     void showStatus( const QString &msg);
    00269     KJavaAppletPrivate*    d;
    00270     QMap<QString, QString> params;
    00271     KJavaAppletContext*    context;
    00272     KJavaLiveConnect*      liveconnect;
    00273     int                    id;
    00274     QString                username;
    00275     QString                userpassword;
    00276     QString                authname;
    00277 };
    00278
    00279 #endif // KJAVAAPPLET_H

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:34:10 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001