.TH "KHelpMenu" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KHelpMenu \- This class provides the standard \fBKDE\fP help menu with the default 'about' dialog boxes and help entry. Standard \fBKDE\fP help menu with dialog boxes.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <khelpmenu.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBMenuId\fP { \fBmenuHelpContents\fP =  0, \fBmenuWhatsThis\fP =  1, \fBmenuAboutApp\fP =  2, \fBmenuAboutKDE\fP =  3, \fBmenuReportBug\fP =  4 }"
.br
.in -1c
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBappHelpActivated\fP ()"
.br
.RI "\fIOpens the help page for the application. \fP"
.ti -1c
.RI "void \fBcontextHelpActivated\fP ()"
.br
.RI "\fIActivates What's This help for the application. \fP"
.ti -1c
.RI "void \fBaboutApplication\fP ()"
.br
.RI "\fIOpens an application specific dialog box. \fP"
.ti -1c
.RI "void \fBaboutKDE\fP ()"
.br
.RI "\fIOpens the standard 'About KDE' dialog box. \fP"
.ti -1c
.RI "void \fBreportBug\fP ()"
.br
.RI "\fIOpens the standard 'Report Bugs' dialog box. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBshowAboutApplication\fP ()"
.br
.RI "\fIThis signal is emitted from \fBaboutApplication\fP() if no 'about application' string has been defined. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKHelpMenu\fP (\fBQWidget\fP *\fBparent\fP=0, const  \fBQString\fP &aboutAppText=QString::null, bool showWhatsThis=true)"
.br
.RI "\fIConstructor. \fP"
.ti -1c
.RI "\fBKHelpMenu\fP (\fBQWidget\fP *\fBparent\fP, const  \fBKAboutData\fP *aboutData, bool showWhatsThis=true, \fBKActionCollection\fP *actions=0)"
.br
.RI "\fIConstructor. \fP"
.ti -1c
.RI "\fB~KHelpMenu\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "\fBKPopupMenu\fP * \fBmenu\fP ()"
.br
.RI "\fIReturns a popup menu you can use in the menu bar or where you need it. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class provides the standard \fBKDE\fP help menu with the default 'about' dialog boxes and help entry. Standard \fBKDE\fP help menu with dialog boxes. 

This class is used in \fBKMainWindow\fP 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 \fBKMainWindow\fP you should use this class.
.PP
The usage is simple:
.PP
.PP
.nf

 mHelpMenu = new KHelpMenu( this, <someText> );
 kmenubar->insertItem(i18n('&Help'), mHelpMenu->\fBmenu()\fP );
 
.PP
.PP
or if you just want to open a dialog box:
.PP
.PP
.nf

 mHelpMenu = new KHelpMenu( this, <someText> );
 connect( this, SIGNAL(someSignal()), mHelpMenu,SLOT(mHelpMenu->\fBaboutKDE()\fP));
 
.PP
.PP
IMPORTANT: The first time you use \fBKHelpMenu::menu\fP(), a \fBKPopupMenu\fP object is allocated. Only one object is created by the class so if you call \fBKHelpMenu::menu\fP() twice or more, the same pointer is returned. The class will destroy the popupmenu in the destructor so do not delete this pointer yourself.
.PP
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.
.PP
.PP
.nf

 MyClass::~MyClass()
 {
   delete mHelpMenu;
 }
 
.PP
.PP
Using your own 'about application' dialog box:
.PP
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:
.PP
Example 1 Using \fBshowAboutApplication\fP signal (preferred) 
.PP
.nf

.PP
.PP
.PP
.nf
 void MyClass::myFunc()
 {
   ..
   KHelpMenu *helpMenu = new KHelpMenu( this );
   connect( helpMenu, SIGNAL(\fBshowAboutApplication()\fP),
          this, SLOT(myDialogSlot()));
   ..
 }
.PP
.PP
.PP
.nf
 void MyClass::myDialogSlot()
 {
   
 }
 
.PP
.PP
Example 2 Old style - connecting directly to the menu entry. 
.PP
.nf

.PP
.PP
.PP
.nf
 void MyClass::myFunc()
 {
   KHelpMenu *helpMenu = new KHelpMenu( this );
   \fBKPopupMenu\fP *help = mHelpMenu->\fBmenu()\fP;
   help->connectItem( KHelpMenu::menuAboutApp, this, SLOT(myDialogSlot()) );
 }
.PP
.PP
.PP
.nf
 void MyClass::myDialogSlot()
 {
   
 }
 
.PP
.PP
\fBAuthor:\fP
.RS 4
Espen Sand (espen@kde.org) 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkhelpmenu.h\fP,v 1.24 2002/08/01 14:19:52 coolo Exp 
.RE
.PP
.RE
.PP

.PP
Definition at line 129 of file khelpmenu.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KHelpMenu::KHelpMenu (\fBQWidget\fP * parent = 0, const \fBQString\fP & aboutAppText = QString::null, bool showWhatsThis = true)"
.PP
Constructor. \fBParameters:\fP
.RS 4
\fIparent\fP The parent of the dialog boxes. The boxes are modeless and will be centered with respect to the parent. 
.br
\fIaboutAppText\fP 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 \fBshowAboutApplication\fP() for more information. 
.br
\fIshowWhatsThis\fP Decides whether a 'Whats this' entry will be added to the dialog. 
.RE
.PP
Definition at line 60 of file khelpmenu.cpp.
.SS "KHelpMenu::KHelpMenu (\fBQWidget\fP * parent, const \fBKAboutData\fP * aboutData, bool showWhatsThis = true, \fBKActionCollection\fP * actions = 0)"
.PP
Constructor. \fBParameters:\fP
.RS 4
\fIparent\fP The parent of the dialog boxes. The boxes are modeless and will be centered with respect to the parent. 
.br
\fIaboutData\fP User and app data used in the About app dialog 
.br
\fIshowWhatsThis\fP Decides whether a 'Whats this' entry will be added to the dialog. 
.RE
.PP
Definition at line 71 of file khelpmenu.cpp.
.PP
References KStdAction::aboutApp(), aboutApplication(), aboutKDE(), KStdAction::aboutKDE(), appHelpActivated(), contextHelpActivated(), KStdAction::helpContents(), reportBug(), KStdAction::reportBug(), and KStdAction::whatsThis().
.SS "KHelpMenu::~\fBKHelpMenu\fP ()"
.PP
Destructor. Destroys dialogs and the menu pointer retuned by \fBmenu\fP Definition at line 95 of file khelpmenu.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBKPopupMenu\fP * KHelpMenu::menu ()"
.PP
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 Definition at line 105 of file khelpmenu.cpp.
.PP
References aboutApplication(), KInstance::aboutData(), aboutKDE(), appHelpActivated(), QObject::connect(), QPopupMenu::connectItem(), contextHelpActivated(), QObject::destroyed(), QString::fromLatin1(), QToolButton::iconSet(), QPopupMenu::insertItem(), QPopupMenu::insertSeparator(), KGlobal::instance(), KAboutData::programName(), reportBug(), QPopupMenu::setAccel(), KIcon::SizeSmall, and QWhatsThis::whatsThisButton().
.PP
Referenced by KMainWindow::customHelpMenu(), and KMainWindow::helpMenu().
.SS "void KHelpMenu::appHelpActivated ()\fC [slot]\fP"
.PP
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 /index.html. Definition at line 171 of file khelpmenu.cpp.
.PP
Referenced by KMainWindow::appHelpActivated(), KHelpMenu(), and menu().
.SS "void KHelpMenu::contextHelpActivated ()\fC [slot]\fP"
.PP
Activates What's This help for the application. Definition at line 274 of file khelpmenu.cpp.
.PP
References QWhatsThis::enterWhatsThisMode(), QWidget::isTopLevel(), QWidget::parentWidget(), QCursor::pos(), and QApplication::widgetAt().
.PP
Referenced by KHelpMenu(), and menu().
.SS "void KHelpMenu::aboutApplication ()\fC [slot]\fP"
.PP
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 \fBshowAboutApplication\fP() is emitted instead. Definition at line 177 of file khelpmenu.cpp.
.PP
References QObject::connect(), KDialogBase::disableResize(), QString::isEmpty(), KDialog::marginHint(), KDialogBase::setMainWidget(), QLabel::setPixmap(), KDialog::setPlainCaption(), QHBox::setSpacing(), QLabel::setText(), QDialog::show(), showAboutApplication(), and KDialog::spacingHint().
.PP
Referenced by KHelpMenu(), and menu().
.SS "void KHelpMenu::aboutKDE ()\fC [slot]\fP"
.PP
Opens the standard 'About KDE' dialog box. Definition at line 221 of file khelpmenu.cpp.
.PP
References QObject::connect(), and KAboutDialog::show().
.PP
Referenced by KHelpMenu(), and menu().
.SS "void KHelpMenu::reportBug ()\fC [slot]\fP"
.PP
Opens the standard 'Report Bugs' dialog box. Definition at line 232 of file khelpmenu.cpp.
.PP
References QObject::connect(), and QDialog::show().
.PP
Referenced by KHelpMenu(), and menu().
.SS "void KHelpMenu::showAboutApplication ()\fC [signal]\fP"
.PP
This signal is emitted from \fBaboutApplication\fP() if no 'about application' string has been defined. The standard application specific dialog box that is normally activated in \fBaboutApplication\fP() will not be displayed when this signal is emitted. Referenced by aboutApplication().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
