class KPanelMenu

Base class to build dynamically loaded menu entries for the K-menu, or the panel. More...

Contains pure virtuals
Definition#include <kpanelmenu.h>
InheritsKPopupMenu [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Slots

Protected Methods

Protected Slots


Detailed Description

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 KDE panel).

To build such a menu, you have to inherit this class and implement the pure virtual functions initialize() and slotExec(). You also have to provide a factory object in your library, see KLibFactory. This factory is only used to construct the menu object.

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/.

 KPanelMenu (QWidget *parent=0, const char *name=0)

KPanelMenu

Construct a KPanelMenu object. This is the normal constructor to use when building extrernal menu entries.

 KPanelMenu (const QString &startDir, QWidget *parent=0, const char *name=0)

KPanelMenu

Constructor used internally by Kicker. You don't really want to use it.

Parameters:
startDira directory to associate with this menu

See also: path(), setPath()

 ~KPanelMenu ()

~KPanelMenu

[virtual]

Destructor.

const QString&  path ()

path

[const]

Get the directory path associated with this menu, or QString::null if there's no such associated path.

Returns: the associated directory path

See also: setPath()

void  setPath (const QString &p)

setPath

Set a directory path to be associated with this menu.

Parameters:
pthe directory path

See also: path()

bool  initialized ()

initialized

[const]

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.

Returns: the initial state

See also: setInitialized(), initialize()

void  setInitialized (bool on)

setInitialized

Set the initial state. Set it to true when you menu is filled with the items you want.

Parameters:
onthe initial state

See also: initialized(), initialize()

void  disableAutoClear ()

disableAutoClear

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.

void  reinitialize ()

reinitialize

[slot]

Reinitialize the menu: the menu is first cleared, the initial state is set to false, and finally initialize() is called. Use this if you want to refill your menu.

void  slotAboutToShow ()

slotAboutToShow

[protected slots virtual slot]

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 initialize 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 initialize().

See also: disableAutoClear()

void  slotExec (int id)

slotExec

[protected slots pure virtual slot]

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.

Parameters:
idthe ID associated with the selected item

void  initialize ()

initialize

[protected slots pure virtual slot]

This slots is called to initialize the menu. It is called automatically by slotAboutToShow(). By re-implementing this functions, you can reconstruct the menu before it is being shown. At the end of this function, you should call setInitialize() with true to tell the system that the menu is OK. You applet must re-implement this function.

See also: slotAboutToShow(), initialized(), setInitialized()

void  slotClear ()

slotClear

[protected slots slot]

Clears the menu, and update the initial state accordingly.

See also: initialized()

void  hideEvent (QHideEvent *ev)

hideEvent

[protected virtual]

Re-implemented for internal reasons.

void  init (const QString& path = QString::null)

init

[protected]

For internal use only. Used by constructors.

void  virtual_hook ( int id, void* data )

virtual_hook

[protected virtual]

Reimplemented from KPopupMenu.