KHtml

kjavaappletcontext.h
1 // -*- c++ -*-
2 
3 /* This file is part of the KDE project
4  *
5  * Copyright (C) 2000 Richard Moore <[email protected]>
6  * 2000 Wynn Wilkes <[email protected]>
7  *
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.
12  *
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.
17  *
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.
22  */
23 
24 #ifndef KJAVAAPPLETCONTEXT_H
25 #define KJAVAAPPLETCONTEXT_H
26 
27 #include <QObject>
28 
29 /**
30  * @short Provides a context for KJavaAppletWidgets
31  *
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.
35  *
36  * @author Richard J. Moore, [email protected]
37  * @author Wynn Wilkes, [email protected]
38  */
39 
40 class KJavaAppletServer;
41 class KJavaApplet;
42 class KJavaAppletContextPrivate;
43 
44 class KJavaAppletContext : public QObject
45 {
46  Q_OBJECT
47 
48 public:
49  KJavaAppletContext();
50  ~KJavaAppletContext();
51 
52  /**
53  * Returns the ID of this context.
54  */
55  int contextId();
56 
57  /**
58  * Sets the ID of this context.
59  */
60  void setContextId(int id);
61 
62  /**
63  * registers applet
64  **/
65  void registerApplet(KJavaApplet *);
66 
67  /**
68  * Sends a message to create the applet.
69  */
70  bool create(KJavaApplet *);
71 
72  /**
73  * Sends a message to destroy the applet.
74  */
75  void destroy(KJavaApplet *);
76 
77  /**
78  * Sends a message to initialize the applet.
79  */
80  void init(KJavaApplet *);
81 
82  /**
83  * Sends a message to start the applet.
84  */
85  void start(KJavaApplet *);
86 
87  /**
88  * Sends a message to stop the applet.
89  */
90  void stop(KJavaApplet *);
91 
92  /**
93  * use this for applet call backs, the AppletServer
94  * calls this directly.
95  */
96  void processCmd(QString cmd, QStringList args);
97 
98  /**
99  * LiveConnect functions
100  */
101  bool getMember(QStringList &args, QStringList &ret_args);
102  bool putMember(QStringList &args);
103  bool callMember(QStringList &args, QStringList &ret_args);
104  void derefObject(QStringList &args);
105 
106  KJavaAppletServer *getServer() const
107  {
108  return server;
109  }
110 Q_SIGNALS:
111  /**
112  * Signals the KHMTL Part to show this as the status message.
113  */
114  void showStatus(const QString &txt);
115 
116  /**
117  * Signals the KHTML Part to show a url in a given target
118  */
119  void showDocument(const QString &url, const QString &target);
120 
121  /**
122  * Signals the KHTML Part an applet is loaded
123  **/
124  void appletLoaded();
125 
126 protected:
127  //The counter to generate ID's for the contexts
128  static int contextCount;
129 
130  // The applet server this context is attached to.
131  KJavaAppletServer *server;
132 
133 protected Q_SLOTS:
134  void received(const QString &cmd, const QStringList &arg);
135  void javaProcessExited(int);
136 
137 private:
138  int id;
139  KJavaAppletContextPrivate *const d;
140 
141 };
142 
143 #endif // KJAVAAPPLETCONTEXT_H
QAction * create(StandardAction id, const QObject *recvr, Func slot, QObject *parent)
Q_SIGNALSQ_SIGNALS
KGuiItem stop()
Q_OBJECTQ_OBJECT
QCA_EXPORT void init()
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:04 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.