• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
K3PanelMenu Class Referenceabstract

#include <k3panelmenu.h>

Inheritance diagram for K3PanelMenu:
Inheritance graph
[legend]

Public Slots

void deinitialize ()
 
void reinitialize ()
 

Public Member Functions

 K3PanelMenu (QWidget *parent)
 
 K3PanelMenu (const QString &startDir, QWidget *parent)
 
virtual ~K3PanelMenu ()
 
void disableAutoClear ()
 
bool initialized () const
 
const QString & path () const
 
void setInitialized (bool on)
 
void setPath (const QString &p)
 
- Public Member Functions inherited from KMenu
 KMenu (QWidget *parent=0L)
 
 KMenu (const QString &title, QWidget *parent=0L)
 
 ~KMenu ()
 
QAction * addTitle (const QString &text, QAction *before=0L)
 
QAction * addTitle (const QIcon &icon, const QString &text, QAction *before=0L)
 
QMenu * contextMenu ()
 
const QMenu * contextMenu () const
 
void hideContextMenu ()
 
Qt::KeyboardModifiers keyboardModifiers () const
 
Qt::MouseButtons mouseButtons () const
 
void setKeyboardShortcutsEnabled (bool enable)
 
void setKeyboardShortcutsExecute (bool enable)
 

Protected Slots

virtual void initialize ()=0
 
virtual void slotAboutToShow ()
 
void slotClear ()
 
virtual void slotExec (int id)=0
 

Protected Member Functions

virtual void hideEvent (QHideEvent *ev)
 
void init (const QString &path=QString())
 
- Protected Member Functions inherited from KMenu
virtual void closeEvent (QCloseEvent *)
 
virtual void contextMenuEvent (QContextMenuEvent *e)
 
virtual bool focusNextPrevChild (bool next)
 
virtual void keyPressEvent (QKeyEvent *e)
 
virtual void mousePressEvent (QMouseEvent *e)
 
virtual void mouseReleaseEvent (QMouseEvent *e)
 

Additional Inherited Members

- Signals inherited from KMenu
void aboutToShowContextMenu (KMenu *menu, QAction *menuAction, QMenu *ctxMenu)
 
- Static Public Member Functions inherited from KMenu
static KMenu * contextMenuFocus ()
 
static QAction * contextMenuFocusAction ()
 

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

Author
The kicker maintainers, Michael Goffioul kdepr.nosp@m.int@.nosp@m.swing.nosp@m..be

Definition at line 52 of file k3panelmenu.h.

Constructor & Destructor Documentation

K3PanelMenu::K3PanelMenu ( QWidget *  parent)

Construct a K3PanelMenu object.

This is the normal constructor to use when building extrernal menu entries.

Definition at line 49 of file k3panelmenu.cpp.

K3PanelMenu::K3PanelMenu ( const QString &  startDir,
QWidget *  parent 
)

Constructor used internally by Kicker.

You don't really want to use it.

Parameters
startDira directory to associate with this menu
parentparent object
namename of the object
See also
path(), setPath()

Definition at line 43 of file k3panelmenu.cpp.

K3PanelMenu::~K3PanelMenu ( )
virtual

Destructor.

Definition at line 73 of file k3panelmenu.cpp.

Member Function Documentation

void K3PanelMenu::deinitialize ( )
slot

Deinitialize the menu: the menu is cleared and the initialized state is set to false.

initialize() is NOT called. It will be called before the menu is next shown, however. Use this slot if you want a delayed reinitialization.

Definition at line 143 of file k3panelmenu.cpp.

void K3PanelMenu::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.

Definition at line 109 of file k3panelmenu.cpp.

void K3PanelMenu::hideEvent ( QHideEvent *  ev)
protectedvirtual

Re-implemented for internal reasons.

Reimplemented from KMenu.

Definition at line 97 of file k3panelmenu.cpp.

void K3PanelMenu::init ( const QString &  path = QString())
protected

For internal use only.

Used by constructors.

Definition at line 55 of file k3panelmenu.cpp.

virtual void K3PanelMenu::initialize ( )
protectedpure virtualslot

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()
bool K3PanelMenu::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()

Definition at line 124 of file k3panelmenu.cpp.

const QString & K3PanelMenu::path ( ) const

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

Returns
the associated directory path
See also
setPath()

Definition at line 114 of file k3panelmenu.cpp.

void K3PanelMenu::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 immediately.

Definition at line 134 of file k3panelmenu.cpp.

void K3PanelMenu::setInitialized ( bool  on)

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

Definition at line 129 of file k3panelmenu.cpp.

void K3PanelMenu::setPath ( const QString &  p)

Set a directory path to be associated with this menu.

Parameters
pthe directory path
See also
path()

Definition at line 119 of file k3panelmenu.cpp.

void K3PanelMenu::slotAboutToShow ( )
protectedvirtualslot

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

Definition at line 78 of file k3panelmenu.cpp.

void K3PanelMenu::slotClear ( )
protectedslot

Clears the menu, and update the initial state accordingly.

See also
initialized()

Definition at line 91 of file k3panelmenu.cpp.

virtual void K3PanelMenu::slotExec ( int  id)
protectedpure virtualslot

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

The documentation for this class was generated from the following files:
  • k3panelmenu.h
  • k3panelmenu.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal