/***************************************************************************
                            DCOPStub.java -  description
                             -------------------
    begin                : Sun Jan 27 16:22:17 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Jan 27 16:22:17 2002, using kalyptus 0.9.
 ***************************************************************************/

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

package org.kde.koala;

import org.kde.qt.*;
import java.util.*;
import java.lang.Error;

/**

 Abstract base class for dcop stubs as created by the
 dcopidl2cpp compiler

 @short 
 Abstract base class for dcop stubs as created by the
 dcopidl2cpp compiler

*/
public class  DCOPStub implements QtSupport {
	private long _qt;
	private boolean _allocatedInJavaWorld = true;

	protected DCOPStub(Class dummy){}

	private native void newDCOPStub( String app, String obj);

/** 
       Creates a DCOPStub for application <code>app</code> and object <code>obj</code>
     
*/
	public DCOPStub( String app, String obj) {
		newDCOPStub( app, obj);
	}
	private native void newDCOPStub( DCOPClient client, String app, String obj);

/**  
      Creates a DCOPStub for application <code>app</code> and object <code>obj</code>
       that operates on the DCOPClient <code>client</code>
     
*/
	public DCOPStub( DCOPClient client, String app, String obj) {
		newDCOPStub( client, app, obj);
	}
	protected native void finalize() throws InternalError;
	public native void dispose();
	public native boolean isDisposed();

/** 
       Return the application id.
     
*/
	public native String app();

/** 
       Return the object  id.
     
*/
	public native String obj();

/** 
 Return the status of the last call, either <code>CallSucceeded</code> or
 <code>CallFailed</code>

See {@link #ok};
     
*/
	public native int status();

/** 
Return whether no error occured

 See {@link #status};
     
*/
	public native boolean ok();

/** 
       Sets the status to status. Possible values are 'CallSucceeded' and 'CallFailed'
     
*/
	protected native void setStatus( int _status);

/** 
      Invoked whenever a call fails.  The default implementation
      sets the status to CallFailed.
     
*/
	protected native void callFailed();

/**  
      The dcopClient this stub operates on. Either the specific one
       specified in the constructor or DCOPClient.mainClient.
    
*/
	protected native DCOPClient dcopClient();
	public static final int CallSucceeded = 0;
	public static final int CallFailed = 1;
}
