VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
makVrf::DtVrfRightClickContextHandler Class Reference

The menu assembler and configuration were combined into one class for convenience. More...

Inheritance diagram for makVrf::DtVrfRightClickContextHandler:
Inheritance graph
[legend]

Public Member Functions

 DtVrfRightClickContextHandler (makVrv::DtDe &de)
 Default constructor that should not be used by users. More...
 
virtual ~DtVrfRightClickContextHandler ()
 Default destructor which should not be used by users. More...
 
virtual void addContext (std::string contextName, DtVrfRightClickContextFunc func)
 Adds a new context to the context handler. This is called by DtVrfRightClickMenu. More...
 
virtual void removeContext (std::string contextName)
 Removes a context from the context handler. This is called by DtVrfRightClickMenu. More...
 
virtual void setDefaultContext (std::string contextName)
 Sets default context of the context handler. This is called by DtVrfRightClickMenu. More...
 
virtual void setCurrentContext (std::string contextName)
 Sets current context of the context handler. This is called by DtVrfRightClickMenu. More...
 
virtual void resetContext ()
 Resets the current context to the default context. More...
 
virtual std::string currentContext ()
 Gets the current context. More...
 
virtual std::string defaultContext ()
 Gets the default context. More...
 
virtual void addMenuPath (const makVrv::DtMenuPath &path, int weight=-1)
 Overridden from base class. More...
 
virtual void removeMenuPath (const makVrv::DtMenuPath &)
 Overridden from base class. More...
 
virtual void addMenuPathAfter (const makVrv::DtMenuPath &newPath, const makVrv::DtMenuPath &relativeTo)
 Overridden from base class. More...
 
virtual void addMenuPathBefore (const makVrv::DtMenuPath &newPath, const makVrv::DtMenuPath &relativeTo)
 Overridden from base class. More...
 
virtual void registerMenu (makVrv::DtMenu *menu)
 Registers a menu object to the right click menu. More...
 
virtual void unregisterMenu (makVrv::DtMenu *menu)
 Unregisters a menu object from the right click menu. More...
 
virtual void registerItem (makVrv::DtMenuItem *item)
 Registers a menu item object to the right click menu. More...
 
virtual void unregisterItem (makVrv::DtMenuItem *item)
 Unregisters a menu item object to the right click menu. More...
 
- Public Member Functions inherited from makVrf::DtSubMenuConfiguration
 DtSubMenuConfiguration ()
 
 DtSubMenuConfiguration (const makVrv::DtMenuConfiguration &c)
 
 DtSubMenuConfiguration (makVrv::DtDe *de)
 
virtual ~DtSubMenuConfiguration ()
 
virtual bool isUnique (const std::string &) const
 Returns true if there is only one occurance of this path. More...
 
int size () const
 
void convert (const std::string &str1, const std::string &str2)
 
virtual void addMenuItemAfter (const std::string &menuItem, const std::string &after)
 Finds the first occurance of a menu item that matches the "after" in the configuration and adds the menu item to add after that item. More...
 
virtual void removeMenuItem (const std::string &menuItem)
 Finds the first occurance of a menu item that matches the "menuItem" in the configuration and removes it. More...
 
virtual void addMenuItemBefore (const std::string &menuItem, const std::string &before)
 Finds the first occurance of a menu item that matches the "after" in the configuration and adds the menu item to add before that item. More...
 
virtual makVrv::DtMenuPath menuPathForItem (const std::string &menuItem) const
 Finds a menu path that contains the menu item. More...
 
virtual std::string mainMenu () const
 Returns the main menu that represents this path. Will be the first items main menu. More...
 
DtSubMenuConfigurationoperator= (const makVrv::DtMenuConfiguration &rhs)
 
virtual bool fixSortChildren (makVrv::DtMenuConfiguration::MenuPathList &, bool checkOnly=false)
 Returns true if something was fixed. More...
 
void makeChangesTo (makVrv::DtMenuConfiguration *c)
 
void clearMakeChangesTo ()
 
const MenuPathSetpathsRemoved () const
 
const MenuPathSetmenuPaths () const
 
void setProtected (const std::string &p, bool b)
 
bool isProtected (const std::string &p) const
 
bool isGoingToBeRemoved (const makVrv::DtMenuPath &p) const
 
virtual void reworkRelativeOrder ()
 Reworks the relativeTo items to do a closest match and then use that based on the menu paths. More...
 
- Public Member Functions inherited from makVrv::DtMenuConfiguration
 DtMenuConfiguration ()
 CTOR. More...
 
virtual ~DtMenuConfiguration ()
 DTOR. More...
 
void addMenuPath (const DtMenuPath &, int weight=-1)
 Adds the menu path (as well as its entire family). More...
 
void addMenuPathAfter (const DtMenuPath &newPath, const DtMenuPath &relativeTo)
 Adds the menu path after a relative (they must share the same parent). More...
 
void addMenuPathBefore (const DtMenuPath &newPath, const DtMenuPath &relativeTo)
 Adds the menu path before a relative (they must share the same parent). More...
 
void addConfiguration (const DtMenuConfiguration &subConfiguration)
 Merges from an external configurations into this configuration. More...
 
void removeMenuPath (const DtMenuPath &)
 Remove the menu path. More...
 
void getRootPaths (MenuPathList &children) const
 Get all paths which have no parents (aka top level paths). More...
 
void getChildren (const DtMenuPath &path, MenuPathList &children) const
 Get a list of children (first generation only) for a given path. More...
 
void sortChildren (MenuPathList &children) const
 Sort the list of children. More...
 
int getNewWeight ()
 Get new weight. More...
 
DtMenuConfigurationoperator= (const DtMenuConfiguration &rhs)
 
void merge (const DtMenuConfiguration &rhs)
 Merges in contents of supplied configuration, adding new paths. More...
 
bool hasMenuPath (const DtMenuPath &p) const
 Returns true if has the menu path. More...
 
- Public Member Functions inherited from makVrv::DtConfiguration
 DtConfiguration (const std::string &name="")
 CTOR. More...
 
 DtConfiguration (const DtConfiguration &)
 Copy CTOR. More...
 
DtConfigurationoperator= (const DtConfiguration &)
 Assignment OP. More...
 
virtual ~DtConfiguration ()
 DTOR. More...
 
virtual const std::string & name () const
 Get the configuration name. More...
 
virtual void setName (const std::string &name)
 Set the configuration name. More...
 
virtual const std::string * findOptionalParameter (const std::string &name) const
 Find an optional parameters. More...
 
virtual void setOptionalParameter (const std::string &name, const std::string &value)
 Set an optional parameter. More...
 
virtual void setOptionalParameters (const ParameterMap &)
 Set an optional parameters. More...
 
virtual void removeOptionalParameter (const std::string &name)
 Remove an optional parameter. More...
 
const ParameterMapoptionalParameters () const
 Get the optional parameters. More...
 
- Public Member Functions inherited from makVrf::DtConfigurableMenuAssembler
 DtConfigurableMenuAssembler (makVrv::DtDe &de)
 
virtual ~DtConfigurableMenuAssembler ()
 
void setDeleteReferences (bool b)
 
bool deleteReferences () const
 
void setLocalOnly (bool b)
 
void setLocalMenuManager (bool b)
 
virtual void assemble (const makVrv::DtMenuConfiguration &configuration)
 Check for circular dependencies. If they exist, remove the before on one of them, warn, and create the menu. More...
 
virtual void fixCircularDependencies (DtSubMenuConfiguration &configuration) const
 
virtual bool hasCircularDependency (DtSubMenuConfiguration &configuration) const
 Returns true if there is a circular dependency. More...
 
bool localOnly () const
 
void cleanup ()
 
makVrv::DtMenuManagermenuManager ()
 Returns menu manager. More...
 
const makVrv::DtMenuManagermenuManager () const
 
QMenufindMenu (const makVrv::DtMenuPath &path)
 Returns the QMenu object for the given path. More...
 
QActionfindMenuItem (const makVrv::DtMenuPath &path)
 
virtual void merge (const DtQtMenuAssembler::MenuBuilderMap &)
 Merges the contents of the supplied menu builder map, adding new entries and replacing existing. More...
 
virtual void merge (const DtQtMenuAssembler::MenuItemBuilderMap &)
 Merges the contents of the supplied menu item builder map, adding new entries and replacing existing. More...
 
void makeChangesTo (makVrv::DtQtMenuAssembler *c)
 
void clearMakeChangesTo ()
 
virtual QMenuBar * menuBar ()
 
virtual QWidget * menuWindow ()
 
void setCreateSubMenusForMissingMenus (bool b)
 If true, for any missing sub-menu item, create a menu builder and add it. Default is false. More...
 
virtual void assembleMenu (const makVrv::DtMenuPath &menuPath)
 Assemble a menu from the path. More...
 
- Public Member Functions inherited from makVrv::DtQtMenuAssembler
virtual ~DtQtMenuAssembler ()
 DTOR. More...
 
void registerMenu (DtMenu *)
 Register a menu builder. More...
 
DtMenumenuBuilder (const std::string &) const
 Returns a menu builder given the menu id name. More...
 
void unregisterMenu (DtMenu *, bool deleteBuilder=true)
 Register a menu builder. More...
 
void registerMenu (DtMenuItem *)
 Register a menu item builder. More...
 
DtMenuItemmenuItemBuilder (const std::string &) const
 Returns a menu item builder given the menu id name. More...
 
void unregisterMenu (DtMenuItem *, bool deleteBuilder=true)
 Register a menu item builder. More...
 
const MenuBuilderMapmenuBuilderMap () const
 
const MenuItemBuilderMapmenuItemBuilderMap () const
 
MenuBuilderMapmenuBuilderMap ()
 
MenuItemBuilderMapmenuItemBuilderMap ()
 
virtual void merge (const DtQtMenuAssembler::MenuBuilderMap &)
 Merges the contents of the supplied menu builder map, adding new entries and replacing existing. More...
 
virtual void merge (const DtQtMenuAssembler::MenuItemBuilderMap &)
 Merges the contents of the supplied menu item builder map, adding new entries and replacing existing. More...
 
- Public Member Functions inherited from makVrv::DtMenuAssembler
virtual ~DtMenuAssembler ()
 DTOR. More...
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Protected Member Functions

virtual void applyContext (std::string contextName, makVrv::DtMenuConfiguration &config)
 Internally used function to apply contexts to the configuration. More...
 
virtual void applyRegistrations (makVrv::DtQtMenuAssembler &assembler)
 Internally used function to apply registrations to the menu assembler. More...
 
virtual void slot_modifyRightClickMenu (makVrv::DtQtMenuAssembler &, makVrv::DtMenuConfiguration &, const makVrv::DtSelectionManager::IdSet &, int, makVrv::DtDe &)
 Internally used function to handle right click at the time it happens. More...
 
virtual void registerMenu (makVrv::DtMenuItem *)
 Use registerItem() instead. More...
 
virtual void unregisterMenu (makVrv::DtMenu *, bool deleteBuilder=true)
 Use unregisterMenu() instead. More...
 
virtual void unregisterMenu (makVrv::DtMenuItem *, bool deleteBuilder=true)
 Use unregisterItem() instead. More...
 
- Protected Member Functions inherited from makVrf::DtSubMenuConfiguration
bool sortAbsolute (const makVrv::DtMenuPath &a, const makVrv::DtMenuPath &b) const
 
- Protected Member Functions inherited from makVrv::DtMenuConfiguration
bool sortAbsolute (const DtMenuPath &a, const DtMenuPath &b) const
 
- Protected Member Functions inherited from makVrv::DtConfiguration
template<class Archive >
void _serialize (Archive &ar, const unsigned int version)
 Declare serialize functions Call via serialize(Archive ar, unsigned int version); Where Archive can be any of : xml_oarchive,xml_iarchive,binary_oarchive binary_iarchive,text_oarchive, or text_iarchive example: fstream fo("test.xml",std;:ios_base::out); xml_oarchive os(fo); DtConfiguration aConfig; aConfig.serialize(os,0);. More...
 
- Protected Member Functions inherited from makVrf::DtConfigurableMenuAssembler
virtual bool fixMenuPath (const makVrv::DtMenuPath &menuPath, DtSubMenuConfiguration &configuration, bool checkOnly=false) const
 Returns true if something was changed. More...
 
- Protected Member Functions inherited from makVrv::DtQtMenuAssembler
 DtQtMenuAssembler (DtDe &)
 CTOR. More...
 
virtual void assembleMenuItem (const DtMenuPath &menuPath)
 Assemble a menu item from the path. More...
 
- Protected Member Functions inherited from makVrv::DtMenuAssembler
 DtMenuAssembler (DtDe &de)
 
void assembleMenuPath (const DtMenuPath &menuPath, const DtMenuConfiguration &configuration)
 Assemble a menu path. More...
 

Protected Attributes

std::map< std::string,
DtVrfRightClickContextFunc
myChangeRules
 
std::map< std::string,
DtVrfRightClickChanges * > 
myChanges
 
std::string myDefaultContext
 
std::string myCurrentContext
 
std::vector< makVrv::DtMenu * > myUnregisterMenus
 
std::vector< makVrv::DtMenu * > myRegisterMenus
 
std::vector< makVrv::DtMenuItem * > myRegisterItems
 
std::vector< makVrv::DtMenuItem * > myUnregisterItems
 
- Protected Attributes inherited from makVrf::DtSubMenuConfiguration
makVrv::DtDemyDe
 
std::vector
< makVrv::DtMenuConfiguration * > 
myMakeChangesTo
 
MenuPathSet myPathsRemoved
 
std::map< std::string, boolmyIsProtected
 
- Protected Attributes inherited from makVrv::DtMenuConfiguration
MenuPathSet myMenuPaths
 
MenuPathOrderMap myMenuOrder
 
int myCurrentWeight
 
- Protected Attributes inherited from makVrv::DtConfiguration
std::string myName
 
ParameterMap myOptionalParameters
 
DtProxyWP myAttachedInterface
 
- Protected Attributes inherited from makVrf::DtConfigurableMenuAssembler
DtConfigurationMenuManager myMenuManager
 
std::vector
< makVrv::DtQtMenuAssembler * > 
myMakeChangesTo
 
bool myDeleteReferences
 
bool myLocalOnly
 
bool myCreateSubMenusForMissingMenus
 
bool myLocalMenuManager
 
- Protected Attributes inherited from makVrv::DtQtMenuAssembler
MenuBuilderMap myMenuBuilders
 
MenuItemBuilderMap myMenuItemBuilders
 
- Protected Attributes inherited from makVrv::DtMenuAssembler
std::stack< DtMenuPathmyMenuStack
 
DtDemyDe
 

Additional Inherited Members

- Public Types inherited from makVrv::DtMenuConfiguration
typedef std::list< DtMenuPathMenuPathList
 
typedef std::set< DtMenuPathMenuPathSet
 
- Public Types inherited from makVrv::DtConfiguration
typedef std::map< std::string,
std::string > 
ParameterMap
 
- Public Types inherited from makVrv::DtQtMenuAssembler
typedef boost::unordered_map
< std::string, DtMenu * > 
MenuBuilderMap
 
typedef boost::unordered_map
< std::string, DtMenuItem * > 
MenuItemBuilderMap
 
- Static Public Member Functions inherited from makVrv::DtQtMenuAssembler
static DtQtMenuAssemblerinstance (DtDe &de)
 Get an instance of the assembler. More...
 
- Static Public Member Functions inherited from makVrv::DtMenuAssembler
static DtMenuAssemblerinstance (DtDe &)
 Get an instance of the assembler. More...
 
- Protected Types inherited from makVrv::DtMenuConfiguration
typedef std::map< DtMenuPath,
OrderParameters
MenuPathOrderMap
 

Detailed Description

The menu assembler and configuration were combined into one class for convenience.

Most users won't really notice this or care.

Constructor & Destructor Documentation

makVrf::DtVrfRightClickContextHandler::DtVrfRightClickContextHandler ( makVrv::DtDe de)

Default constructor that should not be used by users.

virtual makVrf::DtVrfRightClickContextHandler::~DtVrfRightClickContextHandler ( )
virtual

Default destructor which should not be used by users.

Member Function Documentation

virtual void makVrf::DtVrfRightClickContextHandler::addContext ( std::string  contextName,
DtVrfRightClickContextFunc  func 
)
virtual

Adds a new context to the context handler. This is called by DtVrfRightClickMenu.

virtual void makVrf::DtVrfRightClickContextHandler::removeContext ( std::string  contextName)
virtual

Removes a context from the context handler. This is called by DtVrfRightClickMenu.

virtual void makVrf::DtVrfRightClickContextHandler::setDefaultContext ( std::string  contextName)
virtual

Sets default context of the context handler. This is called by DtVrfRightClickMenu.

virtual void makVrf::DtVrfRightClickContextHandler::setCurrentContext ( std::string  contextName)
virtual

Sets current context of the context handler. This is called by DtVrfRightClickMenu.

virtual void makVrf::DtVrfRightClickContextHandler::resetContext ( )
inlinevirtual

Resets the current context to the default context.

virtual std::string makVrf::DtVrfRightClickContextHandler::currentContext ( )
inlinevirtual

Gets the current context.

virtual std::string makVrf::DtVrfRightClickContextHandler::defaultContext ( )
inlinevirtual

Gets the default context.

virtual void makVrf::DtVrfRightClickContextHandler::addMenuPath ( const makVrv::DtMenuPath path,
int  weight = -1 
)
virtual

Overridden from base class.

Adds a menu path to the right click menu based on the current context. To change contexts, you should call setCurrentContext() before calling this function to ensure your right click change happens when you want it to. This function assumes the menu/item at the end of the path is already registered to this class or to DtVrfMainMenu.

Reimplemented from makVrf::DtSubMenuConfiguration.

virtual void makVrf::DtVrfRightClickContextHandler::removeMenuPath ( const makVrv::DtMenuPath )
virtual

Overridden from base class.

Removes a menu path from the right click menu based on the current context. To change contexts, you should call setCurrentContext() before calling this function to ensure your right click change happens when you want it to. This function assumes the menu/item at the end of the path is already registered to this class or to DtVrfMainMenu.

Reimplemented from makVrf::DtSubMenuConfiguration.

virtual void makVrf::DtVrfRightClickContextHandler::addMenuPathAfter ( const makVrv::DtMenuPath newPath,
const makVrv::DtMenuPath relativeTo 
)
virtual

Overridden from base class.

Adds a menu path to the right click menu based on the current context. To change contexts, you should call setCurrentContext() before calling this function to ensure your right click change happens when you want it to. This function assumes the menu/item at the end of the path is already registered to this class or to DtVrfMainMenu.

Reimplemented from makVrf::DtSubMenuConfiguration.

virtual void makVrf::DtVrfRightClickContextHandler::addMenuPathBefore ( const makVrv::DtMenuPath newPath,
const makVrv::DtMenuPath relativeTo 
)
virtual

Overridden from base class.

Adds a menu path to the right click menu based on the current context. To change contexts, you should call setCurrentContext() before calling this function to ensure your right click change happens when you want it to. This function assumes the menu/item at the end of the path is already registered to this class or to DtVrfMainMenu.

Reimplemented from makVrf::DtSubMenuConfiguration.

virtual void makVrf::DtVrfRightClickContextHandler::registerMenu ( makVrv::DtMenu menu)
virtual

Registers a menu object to the right click menu.

Menus registered in the DtVrfMainMenu do not need to be re-registered.

Reimplemented from makVrf::DtConfigurableMenuAssembler.

virtual void makVrf::DtVrfRightClickContextHandler::unregisterMenu ( makVrv::DtMenu menu)
virtual

Unregisters a menu object from the right click menu.

virtual void makVrf::DtVrfRightClickContextHandler::registerItem ( makVrv::DtMenuItem item)
virtual

Registers a menu item object to the right click menu.

Menus itmes registered in the DtVrfMainMenu do not need to be re-registered.

virtual void makVrf::DtVrfRightClickContextHandler::unregisterItem ( makVrv::DtMenuItem item)
virtual

Unregisters a menu item object to the right click menu.

virtual void makVrf::DtVrfRightClickContextHandler::applyContext ( std::string  contextName,
makVrv::DtMenuConfiguration config 
)
protectedvirtual

Internally used function to apply contexts to the configuration.

virtual void makVrf::DtVrfRightClickContextHandler::applyRegistrations ( makVrv::DtQtMenuAssembler assembler)
protectedvirtual

Internally used function to apply registrations to the menu assembler.

virtual void makVrf::DtVrfRightClickContextHandler::slot_modifyRightClickMenu ( makVrv::DtQtMenuAssembler ,
makVrv::DtMenuConfiguration ,
const makVrv::DtSelectionManager::IdSet ,
int  ,
makVrv::DtDe  
)
protectedvirtual

Internally used function to handle right click at the time it happens.

The user's entry point into this is to call addContext() and add functions which will eventually be called.

virtual void makVrf::DtVrfRightClickContextHandler::registerMenu ( makVrv::DtMenuItem )
protectedvirtual

Use registerItem() instead.

Reimplemented from makVrf::DtConfigurableMenuAssembler.

virtual void makVrf::DtVrfRightClickContextHandler::unregisterMenu ( makVrv::DtMenu ,
bool  deleteBuilder = true 
)
protectedvirtual

Use unregisterMenu() instead.

Reimplemented from makVrf::DtConfigurableMenuAssembler.

virtual void makVrf::DtVrfRightClickContextHandler::unregisterMenu ( makVrv::DtMenuItem ,
bool  deleteBuilder = true 
)
protectedvirtual

Use unregisterItem() instead.

Reimplemented from makVrf::DtConfigurableMenuAssembler.

Member Data Documentation

std::map<std::string, DtVrfRightClickContextFunc> makVrf::DtVrfRightClickContextHandler::myChangeRules
protected
std::map<std::string, DtVrfRightClickChanges*> makVrf::DtVrfRightClickContextHandler::myChanges
protected
std::string makVrf::DtVrfRightClickContextHandler::myDefaultContext
protected
std::string makVrf::DtVrfRightClickContextHandler::myCurrentContext
protected
std::vector<makVrv::DtMenu*> makVrf::DtVrfRightClickContextHandler::myUnregisterMenus
protected
std::vector<makVrv::DtMenu*> makVrf::DtVrfRightClickContextHandler::myRegisterMenus
protected
std::vector<makVrv::DtMenuItem*> makVrf::DtVrfRightClickContextHandler::myRegisterItems
protected
std::vector<makVrv::DtMenuItem*> makVrf::DtVrfRightClickContextHandler::myUnregisterItems
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)