Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > by-pkgid > 6282078ae76a671f49c6af38c67b1a07 > files > 911

kdelibs-devel-2.2.2-49.2mdk.i586.rpm

<HTML>
<HEAD>
<TITLE>class KHelpMenu</TITLE>

<META NAME="Generator" CONTENT="KDOC ">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD>
	<TABLE BORDER="0">
		<TR><TD valign="top" align="left" cellspacing="10">
		<h1>class KHelpMenu</h1>
		</TD>
		<TD valign="top" align="right" colspan="1">Standard KDE help menu with dialog boxes.
 <small><A HREF="#longdesc">More...</A></small></TD></TR>
	</TABLE>
	<HR>
	<TABLE BORDER="0">
		<TR><TH>Definition</TH><TD><code>#include &lt;<A HREF="khelpmenu_h.html">khelpmenu.h</A>&gt;</code></TD></TR>
<TR><TH>Inherits</TH><TD><A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qobject.html">QObject</A> <small>(qt)</small> <small>[public ]</small></TD></TR>
<TR><TH><A HREF="full-list-KHelpMenu.html">List of all Methods</A></TH></TR>
	</TABLE>
	</TD>
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
</TABLE></TD></TR></TABLE>
<h4>Public Types</h4><ul><LI>enum <A HREF="#ref1">MenuId</A> {      menuHelpContents = 0,
      menuWhatsThis = 1,
      menuAboutApp = 2,
      menuAboutKDE = 3,
      menuReportBug = 4
    }
</LI>
</ul><h4>Public Methods</h4><ul><LI>&nbsp;<b><A HREF="#ref2">KHelpMenu</A></b> ( <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qwidget.html">QWidget</A> *parent=0, const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> &aboutAppText=QString::null,
	       bool showWhatsThis=true ) 
</LI>
<LI>&nbsp;<b><A HREF="#ref3">KHelpMenu</A></b> ( <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qwidget.html">QWidget</A> *parent, const <A HREF="../kdecore/KAboutData.html">KAboutData</A> *aboutData,
	       bool showWhatsThis=true, <A HREF="KActionCollection.html">KActionCollection</A> *actions = 0 ) 
</LI>
<LI>&nbsp;<b><A HREF="#ref4">~KHelpMenu</A></b> () 
</LI>
<LI><A HREF="KPopupMenu.html">KPopupMenu</A> *&nbsp;<b><A HREF="#ref5">menu</A></b> () 
</LI>
</ul><h4>Public Slots</h4><ul><LI>void &nbsp;<b><A HREF="#ref6">appHelpActivated</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref7">contextHelpActivated</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref8">aboutApplication</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref9">aboutKDE</A></b> () 
</LI>
<LI>void &nbsp;<b><A HREF="#ref10">reportBug</A></b> () 
</LI>
</ul><h4>Signals</h4><ul><LI>void &nbsp;<b><A HREF="#ref14">showAboutApplication</A></b> () 
</LI>
</ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p>
 This class provides the standard KDE help menu with the default "about"
 dialog boxes and help entry.
</p>
<p> This class is used in <A HREF="KMainWindow.html">KMainWindow</A> 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 <A HREF="KMainWindow.html">KMainWindow</A> you should use this class.
</p>
<p> The usage is simple:
</p>
<p></p><table border="0" width="100%">
<tr>
<td bgcolor="#BEEAE0">
<pre>

 mHelpMenu = new <A HREF="KHelpMenu.html#KHelpMenu">KHelpMenu</A>( this, <someText> );
 kmenubar->insertItem(<A HREF="../kdecore/.html#i18n">i18n</A>("&Help"), mHelpMenu-><A HREF="KHelpMenu.html#menu">menu</A>() );

</pre>
</td></tr>

</table> <p>
</p>
<p> or if you just want to open a dialog box:
</p>
<p></p><table border="0" width="100%">
<tr>
<td bgcolor="#BEEAE0">
<pre>

 mHelpMenu = new <A HREF="KHelpMenu.html#KHelpMenu">KHelpMenu</A>( this, <someText> );
 connect( this, SIGNAL(someSignal()), mHelpMenu,SLOT(mHelpMenu-><A HREF="KHelpMenu.html#aboutKDE">aboutKDE</A>()));

</pre>
</td></tr>

</table> <p>
</p>
<p> IMPORTANT:
 The first time you use mHelpMenu->menu(), a <A HREF="KPopupMenu.html">KPopupMenu</A> object is
 allocated. Only one object is created by the class so if you call
 mHelpMenu->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.
</p>
<p> The <A HREF="KHelpMenu.html#KHelpMenu">KHelpMenu</A> object will be deleted when its parent is destroyed but you
 can delete it yourself if you want. The code below will always work.
</p>
<p></p><table border="0" width="100%">
<tr>
<td bgcolor="#BEEAE0">
<pre>

 MyClass::~MyClass()
 {
   delete mHelpMenu;
 }

</pre>
</td></tr>

</table> <p>
</p>
<p></p>
<p> Using your own "about application" dialog box:
</p>
<p> 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:
</p>
<p> Example 1 Using <A HREF="KHelpMenu.html#showAboutApplication">showAboutApplication</A> signal (preferred)
</p><table border="0" width="100%">
<tr>
<td bgcolor="#BEEAE0">
<pre>


 void MyClass::myFunc()
 {
   ..
   <A HREF="KHelpMenu.html#KHelpMenu">KHelpMenu</A> *helpMenu = new <A HREF="KHelpMenu.html#KHelpMenu">KHelpMenu</A>( this );
   connect( helpMenu, SIGNAL(<A HREF="KHelpMenu.html#showAboutApplication">showAboutApplication</A>()),
          this, SLOT(myDialogSlot()));
   ..
 }

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

</pre>
</td></tr>

</table> <p>
</p>
<p></p>
<p> Example 2 Old style - connecting directly to the menu entry.
</p><table border="0" width="100%">
<tr>
<td bgcolor="#BEEAE0">
<pre>


 void MyClass::myFunc()
 {
   <A HREF="KHelpMenu.html#KHelpMenu">KHelpMenu</A> *helpMenu = new <A HREF="KHelpMenu.html#KHelpMenu">KHelpMenu</A>( this );
   <A HREF="KPopupMenu.html">KPopupMenu</A> *help = mHelpMenu-><A HREF="KHelpMenu.html#menu">menu</A>();
   help->connectItem( KHelpMenu::menuAboutApp, this, SLOT(myDialogSlot()) );
 }

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

</pre>
</td></tr>

</table> <p>
</p>
<p></p>
<A NAME="MenuId"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td>enum <strong>MenuId</strong> {      menuHelpContents = 0,
      menuWhatsThis = 1,
      menuAboutApp = 2,
      menuAboutKDE = 3,
      menuReportBug = 4
    }
</td><td align="right"><h3><strong>MenuId</strong></h3></td></tr></table><p></p><A NAME="KHelpMenu"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KHelpMenu</strong> ( <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qwidget.html">QWidget</A> *parent=0, const <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qstring.html">QString</A> &aboutAppText=QString::null,
	       bool showWhatsThis=true )
<br></td><td align="right"><h3><strong>KHelpMenu</strong></h3></td></tr></table><p></p><p>
 Constructor.
</p>
<p></p>
<p>     </p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>parent</i></TD><TD align="left" valign="top">The parent of the dialog boxes. The boxes are modeless
        and will be centered with respect to the parent.
</TD></TR>
<TR><TD align="left" valign="top"><i>aboutAppText</i></TD><TD align="left" valign="top">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
        <A HREF="KHelpMenu.html#showAboutApplication">showAboutApplication</A>() for more information.
</TD></TR>
<TR><TD align="left" valign="top"><i>showWhatsThis</i></TD><TD align="left" valign="top">Decides whether a "Whats this" entry will be
        added to the dialog.
</TD></TR>
</TABLE></P>
<A NAME="KHelpMenu"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>KHelpMenu</strong> ( <A HREF="../../../../../../../../../usr/share/doc/qt-2.3.1/html/qwidget.html">QWidget</A> *parent, const <A HREF="../kdecore/KAboutData.html">KAboutData</A> *aboutData,
	       bool showWhatsThis=true, <A HREF="KActionCollection.html">KActionCollection</A> *actions = 0 )
<br></td><td align="right"><h3><strong>KHelpMenu</strong></h3></td></tr></table><p></p><p>
 Constructor.
</p>
<p></p>
<p>     </p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>parent</i></TD><TD align="left" valign="top">The parent of the dialog boxes. The boxes are modeless
        and will be centered with respect to the parent.
</TD></TR>
<TR><TD align="left" valign="top"><i>aboutData</i></TD><TD align="left" valign="top">User and app data used in the About app dialog
</TD></TR>
<TR><TD align="left" valign="top"><i>showWhatsThis</i></TD><TD align="left" valign="top">Decides whether a "Whats this" entry will be
        added to the dialog.
</TD></TR>
</TABLE></P>
<A NAME="~KHelpMenu"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td>&nbsp;<strong>~KHelpMenu</strong> ()
<br></td><td align="right"><h3><strong>~KHelpMenu</strong></h3></td></tr></table><p></p><p>
 Destructor
</p>
<p> Destroys dialogs and the menu pointer retuned by <A HREF="KHelpMenu.html#menu">menu</A>
     </p>
<A NAME="menu"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td><A HREF="KPopupMenu.html">KPopupMenu</A> *&nbsp;<strong>menu</strong> ()
<br></td><td align="right"><h3><strong>menu</strong></h3></td></tr></table><p></p><p>
 Returns a popup menu you can use in the menu bar or where you
 need it.
</p>
<p> Note: This method will only create one instance of the menu. If
 you call this method twice or more the same pointer is returned
     </p>
<A NAME="appHelpActivated"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>appHelpActivated</strong> ()
<br></td><td align="right"><h3><strong>appHelpActivated</strong></h3></td></tr></table><p> <small>[slot]</small></p><p>
 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.
     </p>
<A NAME="contextHelpActivated"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>contextHelpActivated</strong> ()
<br></td><td align="right"><h3><strong>contextHelpActivated</strong></h3></td></tr></table><p> <small>[slot]</small></p><p>
 Activates What's This help for the application.
     </p>
<A NAME="aboutApplication"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>aboutApplication</strong> ()
<br></td><td align="right"><h3><strong>aboutApplication</strong></h3></td></tr></table><p> <small>[slot]</small></p><p>
 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 <A HREF="KHelpMenu.html#showAboutApplication">showAboutApplication</A>() is emitted instead.
     </p>
<A NAME="aboutKDE"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>aboutKDE</strong> ()
<br></td><td align="right"><h3><strong>aboutKDE</strong></h3></td></tr></table><p> <small>[slot]</small></p><p>
 Opens the standard "About KDE" dialog box.
     </p>
<A NAME="reportBug"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>reportBug</strong> ()
<br></td><td align="right"><h3><strong>reportBug</strong></h3></td></tr></table><p> <small>[slot]</small></p><p>
 Opens the standard "Report Bugs" dialog box.
     </p>
<A NAME="showAboutApplication"></A><A NAME="ref14"></A><table width="100%"><tr bgcolor="#eeeeee"><td>void &nbsp;<strong>showAboutApplication</strong> ()
<br></td><td align="right"><h3><strong>showAboutApplication</strong></h3></td></tr></table><p> <small>[signal]</small></p><p>
 This signal is emitted from <A HREF="KHelpMenu.html#aboutApplication">aboutApplication</A>() if no
 "about application" string has been defined. The standard
 application specific dialog box that is normally activated in
 <A HREF="KHelpMenu.html#aboutApplication">aboutApplication</A>() will not be displayed when this signal
 is emitted.
     </p>
<HR><UL><LI><i>Version</i>: $Id: khelpmenu.h,v 1.21 2000/09/14 23:41:54 waba Exp $
 </LI><LI><i>Author</i>: Espen Sand (espen@kde.org)
</LI><LI><i>Generated</i>: qateam on updates.mandrakesoft.com on Mon Dec 30 16:09:05 2002, using kdoc 2.0a53.</LI></UL></BODY></HTML>