You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdebindings/tdejava/koala/org/trinitydesktop/koala/KHelpMenu.java

198 lines
7.3 KiB

//Auto-generated by kalyptus. DO NOT EDIT.
package org.trinitydesktop.koala;
import org.trinitydesktop.qt.Qt;
import org.trinitydesktop.qt.TQMetaObject;
import org.trinitydesktop.qt.QtSupport;
import org.trinitydesktop.qt.TQWidget;
import org.trinitydesktop.qt.TQObject;
/**
This class provides the standard %KDE help menu with the default "about"
dialog boxes and help entry.
This class is used in TDEMainWindow so
normally you don't need to use this class yourself. However, if you
need the help menu or any of its dialog boxes in your code that is
not subclassed from TDEMainWindow you should use this class.
The usage is simple:
<pre>
mHelpMenu = new KHelpMenu( this, <someText> );
tdemenubar.insertItem(i18n("&Help"), mHelpMenu.menu() );
</pre>
or if you just want to open a dialog box:
<pre>
mHelpMenu = new KHelpMenu( this, <someText> );
connect( this, TQ_SIGNAL("someSignal()"), mHelpMenu,TQ_SLOT("mHelpMenu.aboutKDE()"));
</pre>
IMPORTANT:
The first time you use KHelpMenu.menu(), a TDEPopupMenu object is
allocated. Only one object is created by the class so if you call
KHelpMenu.menu() twice or more, the same pointer is returned. The class
will destroy the popupmenu in the destructor so do not delete this
pointer yourself.
The KHelpMenu object will be deleted when its parent is destroyed but you
can delete it yourself if you want. The code below will always work.
<pre>
MyClass.~MyClass()
{
delete mHelpMenu;
}
</pre>
Using your own "about application" dialog box:
The standard "about application" dialog box is quite simple. If you
need a dialog box with more functionality you must design that one
yourself. When you want to display the dialog you can choose one of
two methods. Common for both is that you must make a help menu object
with no text argument If the text is missing the default dialog box
will not be displayed:
Example 1 Using showAboutApplication signal (preferred)
<pre>
void MyClass.myFunc()
{
..
KHelpMenu helpMenu = new KHelpMenu( this );
connect( helpMenu, TQ_SIGNAL("showAboutApplication()"),
this, TQ_SLOT("myDialogSlot()"));
..
}
void MyClass.myDialogSlot()
{
<activate your custom dialog>
}
</pre>
Example 2 Old style - connecting directly to the menu entry.
<pre>
void MyClass.myFunc()
{
KHelpMenu helpMenu = new KHelpMenu( this );
TDEPopupMenu help = mHelpMenu.menu();
help.connectItem( KHelpMenu.menuAboutApp, this, TQ_SLOT("myDialogSlot()") );
}
void MyClass.myDialogSlot()
{
<activate your custom dialog>
}
</pre>
See {@link KHelpMenuSignals} for signals emitted by KHelpMenu
@author Espen Sand (espen@kde.org)
@short Standard %KDE help menu with dialog boxes.
*/
public class KHelpMenu extends TQObject {
protected KHelpMenu(Class dummy){super((Class) null);}
public static final int menuHelpContents = 0;
public static final int menuWhatsThis = 1;
public static final int menuAboutApp = 2;
public static final int menuAboutKDE = 3;
public static final int menuReportBug = 4;
public native TQMetaObject metaObject();
public native String className();
/**
Constructor.
@param parent The parent of the dialog boxes. The boxes are modeless
and will be centered with respect to the parent.
@param aboutAppText User definable string that is used in the
application specific dialog box. Note: The help menu will
not open this dialog box if you don't define a string. See
showAboutApplication() for more information.
@param showWhatsThis Decides whether a "Whats this" entry will be
added to the dialog.
@short Constructor.
*/
public KHelpMenu(TQWidget parent, String aboutAppText, boolean showWhatsThis) {
super((Class) null);
newKHelpMenu(parent,aboutAppText,showWhatsThis);
}
private native void newKHelpMenu(TQWidget parent, String aboutAppText, boolean showWhatsThis);
public KHelpMenu(TQWidget parent, String aboutAppText) {
super((Class) null);
newKHelpMenu(parent,aboutAppText);
}
private native void newKHelpMenu(TQWidget parent, String aboutAppText);
public KHelpMenu(TQWidget parent) {
super((Class) null);
newKHelpMenu(parent);
}
private native void newKHelpMenu(TQWidget parent);
public KHelpMenu() {
super((Class) null);
newKHelpMenu();
}
private native void newKHelpMenu();
/**
Constructor.
This alternative constructor is mainly useful if you want to
overide the standard actions (aboutApplication(), aboutKDE(),
helpContents(), reportBug, and optionally whatsThis).
@param parent The parent of the dialog boxes. The boxes are modeless
and will be centered with respect to the parent.
@param aboutData User and app data used in the About app dialog
@param showWhatsThis Decides whether a "Whats this" entry will be
added to the dialog.
@param actions TDEActionCollection that is used instead of the
standard actions.
@short Constructor.
*/
public KHelpMenu(TQWidget parent, TDEAboutData aboutData, boolean showWhatsThis, TDEActionCollection actions) {
super((Class) null);
newKHelpMenu(parent,aboutData,showWhatsThis,actions);
}
private native void newKHelpMenu(TQWidget parent, TDEAboutData aboutData, boolean showWhatsThis, TDEActionCollection actions);
public KHelpMenu(TQWidget parent, TDEAboutData aboutData, boolean showWhatsThis) {
super((Class) null);
newKHelpMenu(parent,aboutData,showWhatsThis);
}
private native void newKHelpMenu(TQWidget parent, TDEAboutData aboutData, boolean showWhatsThis);
public KHelpMenu(TQWidget parent, TDEAboutData aboutData) {
super((Class) null);
newKHelpMenu(parent,aboutData);
}
private native void newKHelpMenu(TQWidget parent, TDEAboutData aboutData);
/**
Returns a popup menu you can use in the menu bar or where you
need it.
Note: This method will only create one instance of the menu. If
you call this method twice or more the same pointer is returned
@short Returns a popup menu you can use in the menu bar or where you need it.
*/
public native TDEPopupMenu menu();
/**
Opens the help page for the application. The application name is
used as a key to determine what to display and the system will attempt
to open \<appName\>/index.html.
@short Opens the help page for the application.
*/
public native void appHelpActivated();
/**
Activates What's This help for the application.
@short Activates What's This help for the application.
*/
public native void contextHelpActivated();
/**
Opens an application specific dialog box. The dialog box will display
the string that was defined in the constructor. If that string was
empty the showAboutApplication() is emitted instead.
@short Opens an application specific dialog box.
*/
public native void aboutApplication();
/**
Opens the standard "About KDE" dialog box.
@short Opens the standard "About KDE" dialog box.
*/
public native void aboutKDE();
/**
Opens the standard "Report Bugs" dialog box.
@short Opens the standard "Report Bugs" dialog box.
*/
public native void reportBug();
/** Deletes the wrapped C++ instance */
protected native void finalize() throws InternalError;
/** Delete the wrapped C++ instance ahead of finalize() */
public native void dispose();
/** Has the wrapped C++ instance been deleted? */
public native boolean isDisposed();
}