don't discard iframe children.
[kdelibs.git] / khtml / java / kjavaappletcontext.h
blob340c319bbd61fb3be80d6b6c4957086ab1c7ed44
1 // -*- c++ -*-
3 /* This file is part of the KDE project
5 * Copyright (C) 2000 Richard Moore <rich@kde.org>
6 * 2000 Wynn Wilkes <wynnw@caldera.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
24 #ifndef KJAVAAPPLETCONTEXT_H
25 #define KJAVAAPPLETCONTEXT_H
27 #include <QtCore/QObject>
29 /**
30 * @short Provides a context for KJavaAppletWidgets
32 * Applets run in a context- (see the Java documentation for more information
33 * on contexts). Currently, each document in KHTML creates one context, in
34 * which multiple applets can run.
36 * @author Richard J. Moore, rich@kde.org
37 * @author Wynn Wilkes, wynnw@caldera.com
41 class KJavaAppletServer;
42 class KJavaApplet;
43 class KJavaAppletContextPrivate;
45 class KJavaAppletContext : public QObject
47 Q_OBJECT
49 public:
50 KJavaAppletContext();
51 ~KJavaAppletContext();
53 /**
54 * Returns the ID of this context.
56 int contextId();
58 /**
59 * Sets the ID of this context.
61 void setContextId( int id );
63 /**
64 * registers applet
65 **/
66 void registerApplet( KJavaApplet* );
68 /**
69 * Sends a message to create the applet.
71 bool create( KJavaApplet* );
73 /**
74 * Sends a message to destroy the applet.
76 void destroy( KJavaApplet* );
78 /**
79 * Sends a message to initialize the applet.
81 void init( KJavaApplet* );
83 /**
84 * Sends a message to start the applet.
86 void start( KJavaApplet* );
88 /**
89 * Sends a message to stop the applet.
91 void stop( KJavaApplet* );
93 /**
94 * use this for applet call backs, the AppletServer
95 * calls this directly.
97 void processCmd( QString cmd, QStringList args );
99 /**
100 * LiveConnect functions
102 bool getMember(QStringList & args, QStringList & ret_args);
103 bool putMember(QStringList & args);
104 bool callMember(QStringList & args, QStringList & ret_args);
105 void derefObject(QStringList & args);
107 KJavaAppletServer* getServer() const { return server; }
108 Q_SIGNALS:
110 * Signals the KHMTL Part to show this as the status message.
112 void showStatus ( const QString& txt );
115 * Signals the KHTML Part to show a url in a given target
117 void showDocument( const QString& url, const QString& target );
120 * Signals the KHTML Part an applet is loaded
122 void appletLoaded();
124 protected:
125 //The counter to generate ID's for the contexts
126 static int contextCount;
128 // The applet server this context is attached to.
129 KJavaAppletServer* server;
131 protected Q_SLOTS:
132 void received( const QString& cmd, const QStringList& arg );
133 void javaProcessExited(int);
135 private:
136 int id;
137 KJavaAppletContextPrivate* const d;
141 #endif // KJAVAAPPLETCONTEXT_H