khtml Library API Documentation

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 
00029 #include <qobject.h>
00030 #include <qstringlist.h>
00031 #include <qmap.h>
00032 
00045 class KJavaApplet;
00046 class KJavaAppletWidget;
00047 class KJavaAppletContext;
00048 class KJavaAppletPrivate;
00049 
00050 
00051 class KJavaApplet : public QObject
00052 {
00053 Q_OBJECT
00054 
00055 public:
00056     // states describing the life cycle of an applet.
00057     // keep in sync with applet state in KJASAppletStub.java !
00058     typedef enum {
00059          UNKNOWN      = 0,
00060          CLASS_LOADED = 1,
00061          INSTANCIATED = 2,
00062          INITIALIZED  = 3,
00063          STARTED      = 4,
00064          STOPPED      = 5,
00065          DESTROYED    = 6
00066     } AppletState;
00067     KJavaApplet( KJavaAppletWidget* _parent, KJavaAppletContext* _context = 0 );
00068     ~KJavaApplet();
00069 
00073     void setAppletContext( KJavaAppletContext* _context );
00074 
00078     void setAppletClass( const QString& clazzName );
00079 
00083     QString& appletClass();
00084 
00088     void setBaseURL( const QString& base );
00089 
00093     QString& baseURL();
00094 
00098     void setCodeBase( const QString& codeBase );
00099 
00103     QString& codeBase();
00104 
00109     void setArchives( const QString& _archives );
00110 
00115     QString& archives();
00116 
00120     void setAppletName( const QString& name );
00121 
00125     QString& appletName();
00126 
00130     void setSize( QSize size );
00131 
00135     QSize size();
00136 
00140     void setParameter( const QString& name, const QString& value );
00141 
00146     QString& parameter( const QString& name );
00147 
00151     QMap<QString,QString>& getParams();
00152 
00156     void setWindowName( const QString& title );
00157 
00161     QString& getWindowName();
00162 
00166     void resizeAppletWidget( int width, int height );
00167 
00172     void create();
00173 
00178     void init();
00179 
00183     bool isCreated();
00184  
00188     void start();
00189 
00193     void stop();
00194 
00198     int  appletId();
00199 
00203     void setAppletId( int id );
00204     
00205     KJavaAppletContext* getContext() const { return context; }
00206     
00210     void setUser(const QString & _user) { username = _user; }
00211     const QString & user () const { return username; }
00212 
00216     void setPassword(const QString & _password) { userpassword = _password; }
00217     const QString & password () const { return userpassword; }
00218 
00222     void setAuthName(const QString & _auth) { authname = _auth; }
00223     const QString & authName () const { return authname; }
00224 
00230     void stateChange ( const int newState );
00231     void setFailed ();
00232     AppletState state() const;
00233     bool failed() const;
00234     bool isAlive() const;
00238     void jsData (const QStringList & args) { emit jsEvent (args); }
00239 signals:
00240     void jsEvent (const QStringList & args);
00241 private:
00242     void showStatus( const QString &msg);
00243     KJavaAppletPrivate*    d;
00244     QMap<QString, QString> params;
00245     KJavaAppletContext*    context;
00246     int                    id;
00247     QString                username;
00248     QString                userpassword;
00249     QString                authname;
00250 };
00251 
00252 #endif // KJAVAAPPLET_H
KDE Logo
This file is part of the documentation for khtml Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun May 16 22:06:31 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003