Gui::WorkbenchManager Class Reference

The WorkbenchManager class manages all workbench objects. More...

#include <WorkbenchManager.h>

List of all members.

Public Member Functions

bool activate (const std::string &name, const std::string &className)
 Activates the workbench with name name.
Workbenchactive () const
 Returns the active workbench.
WorkbenchcreateWorkbench (const std::string &name, const std::string &className)
 Searches for and returns an existing workbench object with name name.
WorkbenchgetWorkbench (const std::string &name) const
 Returns an instance of the workbench with name name.
void removeWorkbench (const std::string &name)
 Removes the workbench with name name.
std::list< std::string > workbenches () const
 Returns a list of all created workbench objects.

Static Public Member Functions

static void destruct ()
static WorkbenchManagerinstance ()
 Creates the only instance of the WorkbenchManager.

Protected Member Functions

 WorkbenchManager ()
 ~WorkbenchManager ()

Detailed Description

The WorkbenchManager class manages all workbench objects.

Author:
Werner Mayer

Definition at line 37 of file WorkbenchManager.h.


Constructor & Destructor Documentation

WorkbenchManager::WorkbenchManager (  )  [protected]

Definition at line 56 of file WorkbenchManager.cpp.

WorkbenchManager::~WorkbenchManager (  )  [protected]

Definition at line 60 of file WorkbenchManager.cpp.

References destruct().


Member Function Documentation

bool WorkbenchManager::activate ( const std::string &  name,
const std::string &  className 
)

Activates the workbench with name name.

Definition at line 126 of file WorkbenchManager.cpp.

References Gui::Workbench::activate(), and createWorkbench().

Referenced by Gui::WorkbenchPy::activate(), and Gui::Application::activateWorkbench().

Workbench * WorkbenchManager::active (  )  const
Workbench * WorkbenchManager::createWorkbench ( const std::string &  name,
const std::string &  className 
)

Searches for and returns an existing workbench object with name name.

If no such workbench exists then a workbench of class className gets created, if possible. If the workbench cannot be created 0 is returned.

Definition at line 73 of file WorkbenchManager.cpp.

References Base::Console(), Base::Type::createInstanceByName(), Gui::Workbench::getClassTypeId(), Base::BaseClass::getTypeId(), getWorkbench(), and Gui::Workbench::setName().

Referenced by activate(), and Gui::Application::activateWorkbench().

void WorkbenchManager::destruct ( void   )  [static]

Definition at line 50 of file WorkbenchManager.cpp.

Referenced by Gui::Application::~Application(), and ~WorkbenchManager().

Workbench * WorkbenchManager::getWorkbench ( const std::string &  name  )  const

Returns an instance of the workbench with name name.

If there is no such workbench 0 is returned.

Definition at line 113 of file WorkbenchManager.cpp.

Referenced by Gui::Application::activateWorkbench(), and createWorkbench().

WorkbenchManager * WorkbenchManager::instance ( void   )  [static]
void WorkbenchManager::removeWorkbench ( const std::string &  name  ) 

Removes the workbench with name name.

If there is no such workbench exists nothing happens.

Definition at line 101 of file WorkbenchManager.cpp.

Referenced by Gui::Application::sRemoveWorkbenchHandler().

std::list< std::string > WorkbenchManager::workbenches ( void   )  const

Returns a list of all created workbench objects.

Definition at line 143 of file WorkbenchManager.cpp.


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

Generated on Wed Nov 23 19:02:05 2011 for FreeCAD by  doxygen 1.6.1