diff options
Diffstat (limited to 'kdejava/koala/org/kde/koala/KHelpMenu.java')
-rw-r--r-- | kdejava/koala/org/kde/koala/KHelpMenu.java | 197 |
1 files changed, 197 insertions, 0 deletions
diff --git a/kdejava/koala/org/kde/koala/KHelpMenu.java b/kdejava/koala/org/kde/koala/KHelpMenu.java new file mode 100644 index 00000000..2f448c71 --- /dev/null +++ b/kdejava/koala/org/kde/koala/KHelpMenu.java @@ -0,0 +1,197 @@ +//Auto-generated by kalyptus. DO NOT EDIT. +package org.kde.koala; + +import org.kde.qt.Qt; +import org.kde.qt.QMetaObject; +import org.kde.qt.QtSupport; +import org.kde.qt.QWidget; +import org.kde.qt.QObject; + +/** + + This class provides the standard %KDE help menu with the default "about" + dialog boxes and help entry. + This class is used in KMainWindow 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 KMainWindow you should use this class. + The usage is simple: + <pre> + mHelpMenu = new KHelpMenu( this, <someText> ); + kmenubar.insertItem(i18n("&Help"), mHelpMenu.menu() ); + </pre> + or if you just want to open a dialog box: + <pre> + mHelpMenu = new KHelpMenu( this, <someText> ); + connect( this, SIGNAL("someSignal()"), mHelpMenu,SLOT("mHelpMenu.aboutKDE()")); + </pre> + IMPORTANT: + The first time you use KHelpMenu.menu(), a KPopupMenu 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, SIGNAL("showAboutApplication()"), + this, 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 ); + KPopupMenu help = mHelpMenu.menu(); + help.connectItem( KHelpMenu.menuAboutApp, this, 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 QObject { + 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 QMetaObject 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(QWidget parent, String aboutAppText, boolean showWhatsThis) { + super((Class) null); + newKHelpMenu(parent,aboutAppText,showWhatsThis); + } + private native void newKHelpMenu(QWidget parent, String aboutAppText, boolean showWhatsThis); + public KHelpMenu(QWidget parent, String aboutAppText) { + super((Class) null); + newKHelpMenu(parent,aboutAppText); + } + private native void newKHelpMenu(QWidget parent, String aboutAppText); + public KHelpMenu(QWidget parent) { + super((Class) null); + newKHelpMenu(parent); + } + private native void newKHelpMenu(QWidget 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 KActionCollection that is used instead of the + standard actions. + @short Constructor. + */ + public KHelpMenu(QWidget parent, KAboutData aboutData, boolean showWhatsThis, KActionCollection actions) { + super((Class) null); + newKHelpMenu(parent,aboutData,showWhatsThis,actions); + } + private native void newKHelpMenu(QWidget parent, KAboutData aboutData, boolean showWhatsThis, KActionCollection actions); + public KHelpMenu(QWidget parent, KAboutData aboutData, boolean showWhatsThis) { + super((Class) null); + newKHelpMenu(parent,aboutData,showWhatsThis); + } + private native void newKHelpMenu(QWidget parent, KAboutData aboutData, boolean showWhatsThis); + public KHelpMenu(QWidget parent, KAboutData aboutData) { + super((Class) null); + newKHelpMenu(parent,aboutData); + } + private native void newKHelpMenu(QWidget parent, KAboutData 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 KPopupMenu 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(); +} |