.TH "KPanelMenu" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KPanelMenu \- Base class to build dynamically loaded menu entries for the K-menu, or the panel. Base class to build dynamically loaded menu entries for the K-menu, or the panel.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kpanelmenu.h>\fP
.PP
Inherits \fBKPopupMenu\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBreinitialize\fP ()"
.br
.RI "\fIReinitialize the menu: the menu is first cleared, the initial state is set to false, and finally \fBinitialize()\fP is called. \fP"
.ti -1c
.RI "void \fBdeinitialize\fP ()"
.br
.RI "\fIDeinitialize the menu: the menu is cleared and the initialized state is set to false. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKPanelMenu\fP (\fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstruct a KPanelMenu object. \fP"
.ti -1c
.RI "\fBKPanelMenu\fP (const  \fBQString\fP &startDir, \fBQWidget\fP *parent=0, const  char *name=0)"
.br
.RI "\fIConstructor used internally by Kicker. \fP"
.ti -1c
.RI "virtual \fB~KPanelMenu\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "const  \fBQString\fP & \fBpath\fP () const "
.br
.RI "\fIGet the directory path associated with this menu, or QString::null if there's no such associated path. \fP"
.ti -1c
.RI "void \fBsetPath\fP (const  \fBQString\fP &p)"
.br
.RI "\fISet a directory path to be associated with this menu. \fP"
.ti -1c
.RI "bool \fBinitialized\fP () const "
.br
.RI "\fITell if the menu has been initialized, that is it already contains items. \fP"
.ti -1c
.RI "void \fBsetInitialized\fP (bool on)"
.br
.RI "\fISet the initial state. \fP"
.ti -1c
.RI "void \fBdisableAutoClear\fP ()"
.br
.RI "\fIDisable the automatic clearing of the menu. \fP"
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "virtual void \fBslotAboutToShow\fP ()"
.br
.RI "\fIThis slot is called just before the menu is shown. \fP"
.ti -1c
.RI "virtual void \fBslotExec\fP (int id)=0"
.br
.RI "\fIThis is slot is called when an item from the menu has been selected. \fP"
.ti -1c
.RI "virtual void \fBinitialize\fP ()=0"
.br
.RI "\fIThis slots is called to initialize the menu. \fP"
.ti -1c
.RI "void \fBslotClear\fP ()"
.br
.RI "\fIClears the menu, and update the initial state accordingly. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBhideEvent\fP (\fBQHideEvent\fP *ev)"
.br
.RI "\fIRe-implemented for internal reasons. \fP"
.ti -1c
.RI "void \fBinit\fP (const  \fBQString\fP &path=QString::null)"
.br
.RI "\fIFor internal use only. \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Base class to build dynamically loaded menu entries for the K-menu, or the panel. Base class to build dynamically loaded menu entries for the K-menu, or the panel. 

This class allows to build menu entries that will be dynamically added either to the K-menu, or to the panel as a normal button. These dynamic menus are located in shared libraries that will be loaded at runtime by Kicker (the \fBKDE\fP panel).
.PP
To build such a menu, you have to inherit this class and implement the pure virtual functions \fBinitialize()\fP and \fBslotExec\fP(). You also have to provide a factory object in your library, see \fBKLibFactory\fP. This factory is only used to construct the menu object.
.PP
Finally, you also have to provide a desktop file describing your dynamic menu. The relevant entries are: Name, Comment, Icon and X-KDE-Library (which contains the library name without any extension). This desktop file has to be installed in $KDEDIR/share/apps/kicker/menuext/.
.PP
\fBAuthor:\fP
.RS 4
The kicker maintainer, Michael Goffioul <goffioul@imec.be> 
.RE
.PP

.PP
Definition at line 54 of file kpanelmenu.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KPanelMenu::KPanelMenu (\fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Construct a KPanelMenu object. This is the normal constructor to use when building extrernal menu entries. Definition at line 49 of file kpanelmenu.cpp.
.PP
References init(), and KStdAccel::name().
.SS "KPanelMenu::KPanelMenu (const \fBQString\fP & startDir, \fBQWidget\fP * parent = 0, const char * name = 0)"
.PP
Constructor used internally by Kicker. You don't really want to use it. 
.PP
\fBParameters:\fP
.RS 4
\fIstartDir\fP a directory to associate with this menu 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBpath()\fP, \fBsetPath()\fP 
.RE
.PP
Definition at line 43 of file kpanelmenu.cpp.
.PP
References init(), and KStdAccel::name().
.SS "KPanelMenu::~\fBKPanelMenu\fP ()\fC [virtual]\fP"
.PP
Destructor. Definition at line 74 of file kpanelmenu.cpp.
.SH "Member Function Documentation"
.PP 
.SS "const  \fBQString\fP & KPanelMenu::path () const"
.PP
Get the directory path associated with this menu, or QString::null if there's no such associated path. \fBReturns:\fP
.RS 4
the associated directory path 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetPath()\fP 
.RE
.PP
Definition at line 114 of file kpanelmenu.cpp.
.SS "void KPanelMenu::setPath (const \fBQString\fP & p)"
.PP
Set a directory path to be associated with this menu. \fBParameters:\fP
.RS 4
\fIp\fP the directory path 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBpath()\fP 
.RE
.PP
Definition at line 119 of file kpanelmenu.cpp.
.SS "bool KPanelMenu::initialized () const"
.PP
Tell if the menu has been initialized, that is it already contains items. This is useful when you need to know if you have to clear the menu, or to fill it. 
.PP
\fBReturns:\fP
.RS 4
the initial state 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetInitialized()\fP, \fBinitialize()\fP 
.RE
.PP
Definition at line 124 of file kpanelmenu.cpp.
.SS "void KPanelMenu::setInitialized (bool on)"
.PP
Set the initial state. Set it to true when you menu is filled with the items you want. 
.PP
\fBParameters:\fP
.RS 4
\fIon\fP the initial state 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBinitialized()\fP, \fBinitialize()\fP 
.RE
.PP
Definition at line 129 of file kpanelmenu.cpp.
.PP
Referenced by init(), and slotClear().
.SS "void KPanelMenu::disableAutoClear ()"
.PP
Disable the automatic clearing of the menu. Kicker uses a cache system for its menus. After a specific configurable delay, the menu will be cleared. Use this function if you want to disable kicker's cache system, and avoid the clearing of your menu. Definition at line 109 of file kpanelmenu.cpp.
.SS "void KPanelMenu::reinitialize ()\fC [slot]\fP"
.PP
Reinitialize the menu: the menu is first cleared, the initial state is set to false, and finally \fBinitialize()\fP is called. Use this if you want to refill your menu immediately. Definition at line 134 of file kpanelmenu.cpp.
.PP
References deinitialize().
.SS "void KPanelMenu::deinitialize ()\fC [slot]\fP"
.PP
Deinitialize the menu: the menu is cleared and the initialized state is set to false. \fBinitialize()\fP is NOT called. It will be called before the menu is next shown, however. Use this slot if you want a delayed reinitialization. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 143 of file kpanelmenu.cpp.
.PP
References slotClear().
.PP
Referenced by reinitialize().
.SS "void KPanelMenu::slotAboutToShow ()\fC [protected, virtual, slot]\fP"
.PP
This slot is called just before the menu is shown. This allows your menu to update itself if needed. However you should instead re-implement \fBinitialize\fP to provide this feature. This function is responsible for the cache system handling, so if you re-implement it, you should call the base function also. Calls \fBinitialize()\fP. 
.PP
\fBSee also:\fP
.RS 4
\fBdisableAutoClear()\fP 
.RE
.PP
Definition at line 79 of file kpanelmenu.cpp.
.PP
Referenced by init().
.SS "virtual void KPanelMenu::slotExec (int id)\fC [protected, pure virtual, slot]\fP"
.PP
This is slot is called when an item from the menu has been selected. Your applet is then supposed to perform some action. You must re-implement this function. 
.PP
\fBParameters:\fP
.RS 4
\fIid\fP the ID associated with the selected item 
.RE
.PP
Referenced by init().
.SS "virtual void KPanelMenu::initialize ()\fC [protected, pure virtual, slot]\fP"
.PP
This slots is called to initialize the menu. It is called automatically by \fBslotAboutToShow\fP(). By re-implementing this functions, you can reconstruct the menu before it is being shown. At the end of this function, you should call \fBsetInitialize\fP() with true to tell the system that the menu is OK. You applet must re-implement this function. 
.PP
\fBSee also:\fP
.RS 4
\fBslotAboutToShow()\fP, \fBinitialized()\fP, \fBsetInitialized()\fP 
.RE
.PP

.SS "void KPanelMenu::slotClear ()\fC [protected, slot]\fP"
.PP
Clears the menu, and update the initial state accordingly. \fBSee also:\fP
.RS 4
\fBinitialized()\fP 
.RE
.PP
Definition at line 92 of file kpanelmenu.cpp.
.PP
References QPopupMenu::clear(), and setInitialized().
.PP
Referenced by deinitialize(), and hideEvent().
.SS "void KPanelMenu::hideEvent (\fBQHideEvent\fP * ev)\fC [protected, virtual]\fP"
.PP
Re-implemented for internal reasons. Definition at line 98 of file kpanelmenu.cpp.
.PP
References slotClear().
.SS "void KPanelMenu::init (const \fBQString\fP & path = QString::null)\fC [protected]\fP"
.PP
For internal use only. Used by constructors. Definition at line 55 of file kpanelmenu.cpp.
.PP
References QPopupMenu::aboutToShow(), QPopupMenu::activated(), KGlobal::config(), KConfigBase::readNumEntry(), KConfigBase::setGroup(), setInitialized(), KPopupMenu::setKeyboardShortcutsEnabled(), slotAboutToShow(), and slotExec().
.PP
Referenced by KPanelMenu().

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