ParaView
Public Slots | Public Member Functions | List of all members
pqViewContextMenuManager Class Reference

The pqViewContextMenuManager class manages the setup and cleanup of view context menus. More...

#include <pqViewContextMenuManager.h>

Inherits QObject.

Public Slots

void setupContextMenu (pqView *view)
 Sets up the context menu for the given view. More...
 
void cleanupContextMenu (pqView *view)
 Cleans up the context menu for the given view. More...
 

Public Member Functions

 pqViewContextMenuManager (QObject *parent=0)
 Creates a view context menu manager. More...
 
virtual ~pqViewContextMenuManager ()
 
bool registerHandler (const QString &viewType, pqViewContextMenuHandler *handler)
 Registers a context menu handler with a view type. More...
 
void unregisterHandler (pqViewContextMenuHandler *handler)
 Removes the context menu from the name mapping. More...
 
bool isRegistered (pqViewContextMenuHandler *handler) const
 Gets whether or not the context menu handler is registered. More...
 
pqViewContextMenuHandlergetHandler (const QString &viewType) const
 Gets the context menu handler for the specified view type. More...
 

Detailed Description

The pqViewContextMenuManager class manages the setup and cleanup of view context menus.

Definition at line 55 of file pqViewContextMenuManager.h.

Constructor & Destructor Documentation

§ pqViewContextMenuManager()

pqViewContextMenuManager::pqViewContextMenuManager ( QObject *  parent = 0)

Creates a view context menu manager.

Parameters
parentThe parent object.

§ ~pqViewContextMenuManager()

virtual pqViewContextMenuManager::~pqViewContextMenuManager ( )
virtual

Member Function Documentation

§ registerHandler()

bool pqViewContextMenuManager::registerHandler ( const QString &  viewType,
pqViewContextMenuHandler handler 
)

Registers a context menu handler with a view type.

Parameters
viewTypeThe name of the view type.
handlerThe context menu handler.
Returns
True if the registration was successful.

§ unregisterHandler()

void pqViewContextMenuManager::unregisterHandler ( pqViewContextMenuHandler handler)

Removes the context menu from the name mapping.

Parameters
handlerThe context menu handler.

§ isRegistered()

bool pqViewContextMenuManager::isRegistered ( pqViewContextMenuHandler handler) const

Gets whether or not the context menu handler is registered.

Returns
True if the context menu handler is associated with a view type.

§ getHandler()

pqViewContextMenuHandler* pqViewContextMenuManager::getHandler ( const QString &  viewType) const

Gets the context menu handler for the specified view type.

Parameters
viewTypeThe name of the view type.
Returns
A pointer to the context menu handler.

§ setupContextMenu

void pqViewContextMenuManager::setupContextMenu ( pqView view)
slot

Sets up the context menu for the given view.

The context menu is only set up for the view if there is a registered handler for the view type.

Parameters
viewThe view to initialize.

§ cleanupContextMenu

void pqViewContextMenuManager::cleanupContextMenu ( pqView view)
slot

Cleans up the context menu for the given view.

Parameters
viewThe view to clean up.

The documentation for this class was generated from the following file: