.TH "KHelpMenu" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KHelpMenu \- Standard KDE 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
.ti -1c
.RI "void \fBcontextHelpActivated\fP ()"
.br
.ti -1c
.RI "void \fBaboutApplication\fP ()"
.br
.ti -1c
.RI "void \fBaboutKDE\fP ()"
.br
.ti -1c
.RI "void \fBreportBug\fP ()"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBshowAboutApplication\fP ()"
.br
.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
.ti -1c
.RI "\fBKHelpMenu\fP (\fBQWidget\fP *\fBparent\fP, const \fBKAboutData\fP *aboutData, bool showWhatsThis=true, \fBKActionCollection\fP *actions=0)"
.br
.ti -1c
.RI "\fB~KHelpMenu\fP ()"
.br
.ti -1c
.RI "\fBKPopupMenu\fP * \fBmenu\fP ()"
.br
.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 
Standard KDE help menu with dialog boxes. 

This class provides the standard KDE help menu with the default 'about' dialog boxes and help entry.
.PP
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->menu() );
.fi
.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->aboutKDE()));
.fi
.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;
 }
.fi
.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 showAboutApplication signal (preferred) 
.PP
.nf
 void MyClass::myFunc()
 {
   ..
   KHelpMenu *helpMenu = new KHelpMenu( this );
   connect( helpMenu, SIGNAL(showAboutApplication()),
          this, SLOT(myDialogSlot()));
   ..
 }

 void MyClass::myDialogSlot()
 {
   <activate your custom dialog>
 }

.fi
.PP
.PP
Example 2 Old style - connecting directly to the menu entry. 
.PP
.nf
 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>
 }

.fi
.PP
.PP
\fBAuthor:\fP
.RS 4
Espen Sand (espen@kde.org) 
.RE
.PP

.PP
Definition at line 131 of file khelpmenu.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KHelpMenu::KHelpMenu (\fBQWidget\fP * parent = \fC0\fP, const \fBQString\fP & aboutAppText = \fCQString::null\fP, bool showWhatsThis = \fCtrue\fP)"
.PP
Constructor. 
.PP
\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

.PP
Definition at line 61 of file khelpmenu.cpp.
.SS "KHelpMenu::KHelpMenu (\fBQWidget\fP * parent, const \fBKAboutData\fP * aboutData, bool showWhatsThis = \fCtrue\fP, \fBKActionCollection\fP * actions = \fC0\fP)"
.PP
Constructor. 
.PP
This alternative constructor is mainly useful if you want to overide the standard actions (\fBaboutApplication()\fP, \fBaboutKDE()\fP, helpContents(), reportBug, and optionally whatsThis).
.PP
\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. 
.br
\fIactions\fP \fBKActionCollection\fP that is used instead of the standard actions. 
.RE
.PP

.PP
Definition at line 72 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. 
.PP
Destroys dialogs and the menu pointer retuned by menu 
.PP
Definition at line 96 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. 
.PP
Note: This method will only create one instance of the menu. If you call this method twice or more the same pointer is returned 
.PP
Definition at line 106 of file khelpmenu.cpp.
.PP
References aboutApplication(), KInstance::aboutData(), aboutKDE(), appHelpActivated(), KAboutData::bugAddress(), QObject::connect(), QPopupMenu::connectItem(), contextHelpActivated(), QObject::destroyed(), QString::fromLatin1(), QToolButton::iconSet(), QPopupMenu::insertItem(), QPopupMenu::insertSeparator(), KGlobal::instance(), QString::isEmpty(), KAboutData::programName(), reportBug(), QPopupMenu::setAccel(), 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. 
.PP
The application name is used as a key to determine what to display and the system will attempt to open <appName>/index.html. 
.PP
Definition at line 172 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. 
.PP
Definition at line 275 of file khelpmenu.cpp.
.PP
References QWhatsThis::enterWhatsThisMode(), QWidget::isTopLevel(), QWidget::parentWidget(), and QApplication::widgetAt().
.PP
Referenced by KHelpMenu(), and menu().
.SS "void KHelpMenu::aboutApplication ()\fC [slot]\fP"
.PP
Opens an application specific dialog box. 
.PP
The dialog box will display the string that was defined in the constructor. If that string was empty the \fBshowAboutApplication()\fP is emitted instead. 
.PP
Definition at line 178 of file khelpmenu.cpp.
.PP
References QObject::connect(), KDialogBase::disableResize(), QString::isEmpty(), KDialogBase::setMainWidget(), QLabel::setPixmap(), KDialog::setPlainCaption(), QHBox::setSpacing(), QLabel::setText(), QDialog::show(), and showAboutApplication().
.PP
Referenced by KHelpMenu(), and menu().
.SS "void KHelpMenu::aboutKDE ()\fC [slot]\fP"
.PP
Opens the standard 'About KDE' dialog box. 
.PP
Definition at line 222 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. 
.PP
Definition at line 233 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. 
.PP
The standard application specific dialog box that is normally activated in \fBaboutApplication()\fP will not be displayed when this signal is emitted. 
.PP
Referenced by aboutApplication().

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