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 00044 class KJavaApplet; 00045 class KJavaAppletWidget; 00046 class KJavaAppletContext; 00047 class KJavaAppletPrivate; 00048 00049 00050 class KJavaApplet : public QObject 00051 { 00052 Q_OBJECT 00053 00054 public: 00055 // states describing the life cycle of an applet. 00056 // keep in sync with applet state in KJASAppletStub.java ! 00057 typedef enum { 00058 UNKNOWN = 0, 00059 CLASS_LOADED = 1, 00060 INSTANCIATED = 2, 00061 INITIALIZED = 3, 00062 STARTED = 4, 00063 STOPPED = 5, 00064 DESTROYED = 6 00065 } AppletState; 00066 KJavaApplet( KJavaAppletWidget* _parent, KJavaAppletContext* _context = 0 ); 00067 ~KJavaApplet(); 00068 00072 void setAppletContext( KJavaAppletContext* _context ); 00073 00077 void setAppletClass( const QString& clazzName ); 00078 00082 QString& appletClass(); 00083 00087 void setBaseURL( const QString& base ); 00088 00092 QString& baseURL(); 00093 00097 void setCodeBase( const QString& codeBase ); 00098 00102 QString& codeBase(); 00103 00108 void setArchives( const QString& _archives ); 00109 00114 QString& archives(); 00115 00119 void setAppletName( const QString& name ); 00120 00124 QString& appletName(); 00125 00129 void setSize( QSize size ); 00130 00134 QSize size(); 00135 00139 void setParameter( const QString& name, const QString& value ); 00140 00145 QString& parameter( const QString& name ); 00146 00150 QMap<QString,QString>& getParams(); 00151 00155 void setWindowName( const QString& title ); 00156 00160 QString& getWindowName(); 00161 00165 void resizeAppletWidget( int width, int height ); 00166 00171 void create(); 00172 00177 void init(); 00178 00182 bool isCreated(); 00183 00187 void start(); 00188 00192 void stop(); 00193 00197 int appletId(); 00198 00202 void setAppletId( int id ); 00203 00204 KJavaAppletContext* getContext() const { return context; } 00205 00209 void setUser(const QString & _user) { username = _user; } 00210 const QString & user () const { return username; } 00211 00215 void setPassword(const QString & _password) { userpassword = _password; } 00216 const QString & password () const { return userpassword; } 00217 00221 void setAuthName(const QString & _auth) { authname = _auth; } 00222 const QString & authName () const { return authname; } 00223 00229 void stateChange ( const int newState ); 00230 void setFailed (); 00231 AppletState state() const; 00232 bool failed() const; 00233 bool isAlive() const; 00237 void jsData (const QStringList & args) { emit jsEvent (args); } 00238 signals: 00239 void jsEvent (const QStringList & args); 00240 private: 00241 void showStatus( const QString &msg); 00242 KJavaAppletPrivate* d; 00243 QMap<QString, QString> params; 00244 KJavaAppletContext* context; 00245 int id; 00246 QString username; 00247 QString userpassword; 00248 QString authname; 00249 }; 00250 00251 #endif // KJAVAAPPLET_H
KDE Logo
This file is part of the documentation for khtml Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 14 00:38:34 2005 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003