kjavaapplet.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
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     
00057     
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
 
This file is part of the documentation for khtml Library Version 3.2.0.