\section{KHelp\-Menu Class Reference}
\label{classKHelpMenu}\index{KHelpMenu@{KHelpMenu}}
Standard KDE help menu with dialog boxes.  


{\tt \#include $<$khelpmenu.h$>$}

Inheritance diagram for KHelp\-Menu:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=52pt]{classKHelpMenu__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KHelp\-Menu:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=310pt]{classKHelpMenu__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Menu\-Id} \{ \par
{\bf menu\-Help\-Contents} =  0, 
{\bf menu\-Whats\-This} =  1, 
{\bf menu\-About\-App} =  2, 
{\bf menu\-About\-KDE} =  3, 
\par
{\bf menu\-Report\-Bug} =  4
 \}
\end{CompactItemize}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf app\-Help\-Activated} ()
\item 
void {\bf context\-Help\-Activated} ()
\item 
void {\bf about\-Application} ()
\item 
void {\bf about\-KDE} ()
\item 
void {\bf report\-Bug} ()
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf show\-About\-Application} ()
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KHelp\-Menu} ({\bf QWidget} $\ast${\bf parent}=0, const {\bf QString} \&about\-App\-Text=QString::null, bool show\-Whats\-This=true)
\item 
{\bf KHelp\-Menu} ({\bf QWidget} $\ast${\bf parent}, const {\bf KAbout\-Data} $\ast$about\-Data, bool show\-Whats\-This=true, {\bf KAction\-Collection} $\ast$actions=0)
\item 
{\bf $\sim$KHelp\-Menu} ()
\item 
{\bf KPopup\-Menu} $\ast$ {\bf menu} ()
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKHelpMenu_b0}

\end{CompactItemize}


\subsection{Detailed Description}
Standard KDE help menu with dialog boxes. 

This class provides the standard KDE help menu with the default \char`\"{}about\char`\"{} dialog boxes and help entry.

This class is used in {\bf KMain\-Window}{\rm (p.\,\pageref{classKMainWindow})} 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 {\bf KMain\-Window}{\rm (p.\,\pageref{classKMainWindow})} you should use this class.

The usage is simple:



\footnotesize\begin{verbatim} mHelpMenu = new KHelpMenu( this, <someText> );
 kmenubar->insertItem(i18n("&Help"), mHelpMenu->menu() );
\end{verbatim}
\normalsize


or if you just want to open a dialog box:



\footnotesize\begin{verbatim} mHelpMenu = new KHelpMenu( this, <someText> );
 connect( this, SIGNAL(someSignal()), mHelpMenu,SLOT(mHelpMenu->aboutKDE()));
\end{verbatim}
\normalsize


IMPORTANT: The first time you use {\bf KHelp\-Menu::menu()}{\rm (p.\,\pageref{classKHelpMenu_a3})}, a {\bf KPopup\-Menu}{\rm (p.\,\pageref{classKPopupMenu})} object is allocated. Only one object is created by the class so if you call {\bf KHelp\-Menu::menu()}{\rm (p.\,\pageref{classKHelpMenu_a3})} 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 KHelp\-Menu object will be deleted when its parent is destroyed but you can delete it yourself if you want. The code below will always work.



\footnotesize\begin{verbatim} MyClass::~MyClass()
 {
   delete mHelpMenu;
 }
\end{verbatim}
\normalsize


Using your own \char`\"{}about application\char`\"{} dialog box:

The standard \char`\"{}about application\char`\"{} 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 show\-About\-Application signal (preferred) 

\footnotesize\begin{verbatim} void MyClass::myFunc()
 {
   ..
   KHelpMenu *helpMenu = new KHelpMenu( this );
   connect( helpMenu, SIGNAL(showAboutApplication()),
          this, SLOT(myDialogSlot()));
   ..
 }

 void MyClass::myDialogSlot()
 {
   <activate your custom dialog>
 }
\end{verbatim}
\normalsize


Example 2 Old style - connecting directly to the menu entry. 

\footnotesize\begin{verbatim} 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>
 }
\end{verbatim}
\normalsize


\begin{Desc}
\item[Author:]Espen Sand ({\tt espen@kde.org}) \end{Desc}




Definition at line 131 of file khelpmenu.h.

\subsection{Constructor \& Destructor Documentation}
\index{KHelpMenu@{KHelp\-Menu}!KHelpMenu@{KHelpMenu}}
\index{KHelpMenu@{KHelpMenu}!KHelpMenu@{KHelp\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KHelp\-Menu::KHelp\-Menu ({\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const {\bf QString} \& {\em about\-App\-Text} = {\tt QString::null}, bool {\em show\-Whats\-This} = {\tt true})}\label{classKHelpMenu_a0}


Constructor. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]The parent of the dialog boxes. The boxes are modeless and will be centered with respect to the parent. \item[{\em about\-App\-Text}]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 {\bf show\-About\-Application()}{\rm (p.\,\pageref{classKHelpMenu_l0})} for more information. \item[{\em show\-Whats\-This}]Decides whether a \char`\"{}Whats this\char`\"{} entry will be added to the dialog. \end{description}
\end{Desc}


Definition at line 61 of file khelpmenu.cpp.\index{KHelpMenu@{KHelp\-Menu}!KHelpMenu@{KHelpMenu}}
\index{KHelpMenu@{KHelpMenu}!KHelpMenu@{KHelp\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KHelp\-Menu::KHelp\-Menu ({\bf QWidget} $\ast$ {\em parent}, const {\bf KAbout\-Data} $\ast$ {\em about\-Data}, bool {\em show\-Whats\-This} = {\tt true}, {\bf KAction\-Collection} $\ast$ {\em actions} = {\tt 0})}\label{classKHelpMenu_a1}


Constructor. 

This alternative constructor is mainly useful if you want to overide the standard actions ({\bf about\-Application()}{\rm (p.\,\pageref{classKHelpMenu_i2})}, {\bf about\-KDE()}{\rm (p.\,\pageref{classKHelpMenu_i3})}, help\-Contents(), report\-Bug, and optionally whats\-This).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]The parent of the dialog boxes. The boxes are modeless and will be centered with respect to the parent. \item[{\em about\-Data}]User and app data used in the About app dialog \item[{\em show\-Whats\-This}]Decides whether a \char`\"{}Whats this\char`\"{} entry will be added to the dialog. \item[{\em actions}]{\bf KAction\-Collection}{\rm (p.\,\pageref{classKActionCollection})} that is used instead of the standard actions. \end{description}
\end{Desc}


Definition at line 72 of file khelpmenu.cpp.

References KStd\-Action::about\-App(), about\-Application(), about\-KDE(), KStd\-Action::about\-KDE(), app\-Help\-Activated(), context\-Help\-Activated(), KStd\-Action::help\-Contents(), report\-Bug(), KStd\-Action::report\-Bug(), and KStd\-Action::whats\-This().\index{KHelpMenu@{KHelp\-Menu}!~KHelpMenu@{$\sim$KHelpMenu}}
\index{~KHelpMenu@{$\sim$KHelpMenu}!KHelpMenu@{KHelp\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KHelp\-Menu::$\sim${\bf KHelp\-Menu} ()}\label{classKHelpMenu_a2}


Destructor. 

Destroys dialogs and the menu pointer retuned by menu 

Definition at line 96 of file khelpmenu.cpp.

\subsection{Member Function Documentation}
\index{KHelpMenu@{KHelp\-Menu}!menu@{menu}}
\index{menu@{menu}!KHelpMenu@{KHelp\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPopup\-Menu} $\ast$ KHelp\-Menu::menu ()}\label{classKHelpMenu_a3}


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 106 of file khelpmenu.cpp.

References about\-Application(), KInstance::about\-Data(), about\-KDE(), app\-Help\-Activated(), KAbout\-Data::bug\-Address(), QObject::connect(), QPopup\-Menu::connect\-Item(), context\-Help\-Activated(), QObject::destroyed(), QString::from\-Latin1(), QTool\-Button::icon\-Set(), QPopup\-Menu::insert\-Item(), QPopup\-Menu::insert\-Separator(), KGlobal::instance(), QString::is\-Empty(), KAbout\-Data::program\-Name(), report\-Bug(), QPopup\-Menu::set\-Accel(), and QWhats\-This::whats\-This\-Button().

Referenced by KMain\-Window::custom\-Help\-Menu(), and KMain\-Window::help\-Menu().\index{KHelpMenu@{KHelp\-Menu}!appHelpActivated@{appHelpActivated}}
\index{appHelpActivated@{appHelpActivated}!KHelpMenu@{KHelp\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHelp\-Menu::app\-Help\-Activated ()\hspace{0.3cm}{\tt  [slot]}}\label{classKHelpMenu_i0}


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 $<$app\-Name$>$/index.html. 

Definition at line 172 of file khelpmenu.cpp.

Referenced by KMain\-Window::app\-Help\-Activated(), KHelp\-Menu(), and menu().\index{KHelpMenu@{KHelp\-Menu}!contextHelpActivated@{contextHelpActivated}}
\index{contextHelpActivated@{contextHelpActivated}!KHelpMenu@{KHelp\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHelp\-Menu::context\-Help\-Activated ()\hspace{0.3cm}{\tt  [slot]}}\label{classKHelpMenu_i1}


Activates What's This help for the application. 



Definition at line 275 of file khelpmenu.cpp.

References QWhats\-This::enter\-Whats\-This\-Mode(), QWidget::is\-Top\-Level(), QWidget::parent\-Widget(), and QApplication::widget\-At().

Referenced by KHelp\-Menu(), and menu().\index{KHelpMenu@{KHelp\-Menu}!aboutApplication@{aboutApplication}}
\index{aboutApplication@{aboutApplication}!KHelpMenu@{KHelp\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHelp\-Menu::about\-Application ()\hspace{0.3cm}{\tt  [slot]}}\label{classKHelpMenu_i2}


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 {\bf show\-About\-Application()}{\rm (p.\,\pageref{classKHelpMenu_l0})} is emitted instead. 

Definition at line 178 of file khelpmenu.cpp.

References QObject::connect(), KDialog\-Base::disable\-Resize(), QString::is\-Empty(), KDialog\-Base::set\-Main\-Widget(), QLabel::set\-Pixmap(), KDialog::set\-Plain\-Caption(), QHBox::set\-Spacing(), QLabel::set\-Text(), QDialog::show(), and show\-About\-Application().

Referenced by KHelp\-Menu(), and menu().\index{KHelpMenu@{KHelp\-Menu}!aboutKDE@{aboutKDE}}
\index{aboutKDE@{aboutKDE}!KHelpMenu@{KHelp\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHelp\-Menu::about\-KDE ()\hspace{0.3cm}{\tt  [slot]}}\label{classKHelpMenu_i3}


Opens the standard \char`\"{}About KDE\char`\"{} dialog box. 



Definition at line 222 of file khelpmenu.cpp.

References QObject::connect(), and KAbout\-Dialog::show().

Referenced by KHelp\-Menu(), and menu().\index{KHelpMenu@{KHelp\-Menu}!reportBug@{reportBug}}
\index{reportBug@{reportBug}!KHelpMenu@{KHelp\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHelp\-Menu::report\-Bug ()\hspace{0.3cm}{\tt  [slot]}}\label{classKHelpMenu_i4}


Opens the standard \char`\"{}Report Bugs\char`\"{} dialog box. 



Definition at line 233 of file khelpmenu.cpp.

References QObject::connect(), and QDialog::show().

Referenced by KHelp\-Menu(), and menu().\index{KHelpMenu@{KHelp\-Menu}!showAboutApplication@{showAboutApplication}}
\index{showAboutApplication@{showAboutApplication}!KHelpMenu@{KHelp\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHelp\-Menu::show\-About\-Application ()\hspace{0.3cm}{\tt  [signal]}}\label{classKHelpMenu_l0}


This signal is emitted from {\bf about\-Application()}{\rm (p.\,\pageref{classKHelpMenu_i2})} if no \char`\"{}about application\char`\"{} string has been defined. 

The standard application specific dialog box that is normally activated in {\bf about\-Application()}{\rm (p.\,\pageref{classKHelpMenu_i2})} will not be displayed when this signal is emitted. 

Referenced by about\-Application().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
khelpmenu.h\item 
khelpmenu.cpp\end{CompactItemize}
