/***************************************************************************
                            kde_KJavaAppletServer.h -  description
                             -------------------
    begin                : Wed Feb  6 15:12:26 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Feb  6 15:12:26 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

#ifndef KDE_KJAVAAPPLETSERVER
#define KDE_KJAVAAPPLETSERVER

#include <qtc/qtc_types.h>

#include <kdec/kde_types.h>


/** 
 Create the applet server.  These shouldn't be used directly,
 use allocateJavaServer instead
     
*/
kde_KJavaAppletServer * kde_new_KJavaAppletServer();
void kde_del_KJavaAppletServer( kde_KJavaAppletServer* p );

/** 
 Create an applet context with the specified id.
     
*/
void kde_KJavaAppletServer_createContext(kde_KJavaAppletServer* instPointer,int contextId, kde_KJavaAppletContext* context);

/** 
 Destroy the applet context with the specified id. All the applets in the
 context will be destroyed as well.
     
*/
void kde_KJavaAppletServer_destroyContext(kde_KJavaAppletServer* instPointer,int contextId);

/** 
 This should be called by the KJavaAppletWidget
     
*/
void kde_KJavaAppletServer_initApplet(kde_KJavaAppletServer* instPointer,int contextId, int appletId);

/** 
 Destroy an applet in the specified context with the specified id.
     
*/
void kde_KJavaAppletServer_destroyApplet(kde_KJavaAppletServer* instPointer,int contextId, int appletId);

/** 
 Start the specified applet.
     
*/
void kde_KJavaAppletServer_startApplet(kde_KJavaAppletServer* instPointer,int contextId, int appletId);

/** 
 Stop the specified applet.
     
*/
void kde_KJavaAppletServer_stopApplet(kde_KJavaAppletServer* instPointer,int contextId, int appletId);

/** 
 Send data we got back from a KJavaDownloader back to the appropriate
 class loader.
 (This is currently unimplemented on the java side.
     
*/
void kde_KJavaAppletServer_sendURLData(kde_KJavaAppletServer* instPointer,qt_QString * loaderID, qt_QString * url, qt_QByteArray* data);

/** 
 Shut down the KJAS server.
     
*/
void kde_KJavaAppletServer_quit(kde_KJavaAppletServer* instPointer);
qt_QString * kde_KJavaAppletServer_appletLabel(kde_KJavaAppletServer* instPointer);

/** 
 A factory method that returns the default server. This is the way this
 class is usually instantiated.
     
*/
kde_KJavaAppletServer* kde_KJavaAppletServer_allocateJavaServer( );

/** 
 When you are done using your reference to the AppletServer,  you must
 dereference it by calling freeJavaServer().
     
*/
void kde_KJavaAppletServer_freeJavaServer( );

/** 
 This allows the KJavaAppletWidget to display some feedback in a QLabel
 while the applet is being loaded.  If the java process could not be
 started, an error message is displayed instead.
     
*/
qt_QString * kde_KJavaAppletServer_getAppletLabel( );
void kde_KJavaAppletServer_setupJava(kde_KJavaAppletServer* instPointer,kde_KJavaProcess* p);
void kde_KJavaAppletServer_slotJavaRequest(kde_KJavaAppletServer* instPointer,qt_QByteArray* qb);
void kde_KJavaAppletServer_checkShutdown(kde_KJavaAppletServer* instPointer);

#endif
