/***************************************************************************
                            KPopupFrame.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;

/**

 Frame with popup menu behaviour.

 See {@link KPopupFrameSignals} for signals emitted by KPopupFrame.

 See {@link KPopupFrameEventHandling} for event handlers to override in subclasses of KPopupFrame.

 @author Tim Gilman, Mirko Boehm

 @version $Id: KPopupFrame.java,v 1.6 2002/01/31 04:48:59 rdale Exp $

 @short 
 Frame with popup menu behaviour.
*/
public class KPopupFrame extends QFrame  {
	protected KPopupFrame(Class dummy){super((Class) null);}

	private native void newKPopupFrame( QWidget parent, String name);

/**  The contructor. Creates a dialog without buttons. 
*/
	public KPopupFrame( QWidget parent, String name) {
		super((Class) null);
		newKPopupFrame( parent, name);
	}
	private native void newKPopupFrame();
	public KPopupFrame() {
		super((Class) null);
		newKPopupFrame();
	}

/**  Set the main widget. You cannot set the main widget from the constructor,
      since it must be a child of the frame itselfes.
      Be careful: the size is set to the main widgets size. It is up to you to
      set the main widgets correct size before setting it as the main
      widget. 
*/
	public native void setMainWidget( QWidget m);

/**  The resize event. Simply resizes the main widget to the whole
      widgets client size. 
*/
	public native void resizeEvent( QResizeEvent arg1);

/**  Open the popup window at position pos. 
*/
	public native void popup( QPoint pos);

/**  Execute the popup window. 
*/
	public native int exec( QPoint p);

/**  Dito. 
*/
	public native int exec( int x, int y);

/**  Close the popup window. This is called from the main widget, usually.
      r is the result returned from exec(). 
*/
	public native void close( int r);

/**  Catch key press events. 
*/
	protected native void keyPressEvent( QKeyEvent e);
}
