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

The DtLayoutManager class allows for the managing (adding, setting and deleting) of UI Layout configurations. More...

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

Classes

struct  Configuration
 

Public Member Functions

 DtLayoutManager (makVrv::DtDe &de)
 
virtual ~DtLayoutManager ()
 
virtual void setLayout (const DtFilename &, bool updateCurrentLayoutBeforeSwitch=false)
 Sets a new GUI layout from the given uisx layout file. More...
 
virtual void setLayoutFromClass (const DtString &, bool updateCurrentLayoutBeforeSwitch=false, bool force=false)
 Sets a new GUI layout from the given class name. More...
 
virtual DtString layout () const
 Currently selected layout. If blank is the default layout. The layout returned is the class name. More...
 
virtual std::vector< DtStringlayouts () const
 Returns a list of all the layouts available. More...
 
virtual bool hasFactoryDefault (const DtString &) const
 Returns true if there is a file in the factory settings folder that matches the given class name's file. More...
 
virtual void restoreFromFactory (const DtString &)
 Restores the layout settings from the factory file specified by the class name, if it exists. More...
 
virtual bool copyToFactory (const DtString &)
 Copies the settings to the factory directory. Will overwrite existing. More...
 
virtual void revertCurrentLayout ()
 Reverts the current layout. More...
 
virtual void revertLayout (const DtString &)
 Reverts the layout to the original layout (by class name) More...
 
virtual DtString classNameFrom (const DtFilename &f) const
 Given the ui layout file, return the class name from it. More...
 
virtual void uiConfigurationFor (const DtFilename &, makVrv::DtVrvApplicationConfiguration::UIConfiguration &)
 Returns the current configuration for the given uisx file. If does not exist will load it. More...
 
virtual void updateCurrentLayout ()
 Updates the current layout (toolbars and dock widgets) with the state of the pages. More...
 
virtual void updateLayout (const DtString &)
 Updates the specified layout (className) with the current state of toolsbars and pages. More...
 
virtual void setIgnoreGeometryChange (bool b)
 Sets whether or not to ignore geometry changes and leave the window as is regardless of what the layout wants. Default is false. More...
 
virtual bool ignoreGeometryChange () const
 
virtual void resetLayoutFromMasterModeConfiguration ()
 Resets the layout to the current global master configuration. More...
 
virtual void setDefaultLayout (const DtString &)
 Sets/gets the default layout. More...
 
virtual void clearDefaultLayout ()
 
virtual DtString defaultLayout () const
 
virtual bool duplicateLayout (const DtString &classNameFrom, const DtString &classNameTo)
 Duplicates the from layout from the specified class to the given class. More...
 
virtual DtFilename layoutFilename (const DtString &) const
 Returns the filename associated with the layout class. More...
 
virtual void addConfiguration (const DtFilename &, const makVrv::DtVrvApplicationConfiguration::UIConfiguration &)
 Creates a new configuration slot based on the supplied configuration and filename. More...
 
virtual bool hasLayout (const DtString &) const
 Returns true if this layout exists. More...
 
virtual void addPageCollectionFromMaster (const DtString &)
 Looks in the master mode configuration for the page collection, and, if present, adds to all page collections that is not currently in. More...
 
virtual void addToolbarFromMaster (const DtString &)
 Looks in the master mode configuration for the toolbar, and, if present, adds to all toolbar collections that is not currently in. More...
 
virtual void setPanelVisible (const DtString &className, const DtString &panel, bool b)
 Sets the page panel visible. More...
 
virtual void setToolbarVisible (const DtString &className, const DtString &toolbar, bool b)
 Sets the toolbar visible. More...
 
virtual void setPaletteItemVisible (const std::string &, bool)
 Sets whether or not the given palette item is visible. More...
 
virtual bool paletteItemVisible (const std::string &, bool *keyExists=0) const
 
virtual void addPaletteItemIfDoesNotExistAndSetToVisible (const std::string &, bool b)
 If this palette item is not present, add it and set its visiblity to the given flag. More...
 
virtual void newLayout (const DtString &, bool basedOnCurrent=true)
 Creates a new layout based on the current UI configuration and makes it the current layout. More...
 
virtual void writeLayouts ()
 Saves all the layouts to their respective files (unless the flag to save layouts is turned off) More...
 
virtual void saveLayout (const DtString &)
 Saves the specified layout class to the directory where it was read from. More...
 
virtual bool deleteLayout (const DtString &s)
 Deletes the layout (class name) from disk and internal structures. More...
 
virtual void renameLayout (const DtString &oldName, const DtString &newName)
 Renames the layout internally and on disk from the old to the new name. More...
 
virtual void setCurrentLayoutUsesFullScreen ()
 Sets/gets current configuration using full screen. More...
 
virtual bool currentLayoutUsesFullScreen () const
 
virtual void setLayoutUsesFullScreen (const DtString &)
 
virtual bool layoutUsesFullScreen (const DtString &) const
 
virtual void setCurrentLayoutIsAlwaysMaximized ()
 Sets/gets current configuration using full screen. More...
 
virtual bool currentLayoutIsAlwaysMaximized () const
 
virtual void setLayoutIsAlwaysMaximized (const DtString &)
 
virtual bool layoutIsAlwaysMaximized (const DtString &) const
 
virtual void setCurrentLayoutUsesWindowGeometry ()
 Gets/sets whether or not the layout, when updates, will store the current windows geometry. More...
 
virtual bool currentLayoutUsesWindowGeometry () const
 
virtual void setLayoutUsesWindowGeometry (const DtString &)
 
virtual bool layoutUsesWindowGeometry (const DtString &) const
 
virtual void updateWithCurrentWindowGeometry (const DtString &)
 If top, left, width and height are all 0 means this window is maximized. More...
 
virtual void setWindowGeometry (const DtString &, int top, int left, int width, int height)
 
virtual void layoutWindowGeometry (const DtString &, int &top, int &left, int &width, int &height) const
 
virtual void updateWindowWithGeometryFrom (const DtString &)
 Updates the window with the geometry found in the class configuration. More...
 
virtual void initialize ()
 Called after the gui has been assembled. More...
 
virtual void setSaveLayouts (bool)
 Sets whether or not layouts can be saved (default is true) More...
 
bool saveLayouts () const
 
virtual void setSaveLastSavedLayout (bool)
 Sets whether or not to save the last saved layout. This flag is checked before saving in the application. More...
 
bool saveLastSavedLayout () const
 
virtual void addClassToIgnore (const DtString &)
 Classes to ignore when initializing. More...
 
virtual void removeClassToIgnore (const DtString &)
 
const std::set< DtString > & classesToIgnore () const
 
virtual bool ignoreClass (const DtString &) const
 
virtual void setLastSavedLayoutClassName (const DtString &)
 Get/set the class name of the file used to save the GUI layout in the case of no default layout. More...
 
virtual const DtStringlastSavedLayoutClassName () const
 
virtual void preAssemble ()
 Pre/post gui assembly. More...
 
virtual void postAssemble ()
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Static Public Member Functions

static DtLayoutManagerinstance (makVrv::DtDe &)
 Get an instance of the creator. More...
 
static void registerInstance (makVrv::DtDe &de, DtLayoutManager *instance)
 Register an instance of the creator. More...
 

Public Attributes

boost::signals2::signal< void(const
DtString &newLayout, const
DtString &oldLayout)> 
signal_layoutSelected
 Signal sent when a layout is selected. More...
 
boost::signals2::signal< void(const
DtString &)> 
signal_layoutAdded
 Signal sent when a layout is added. More...
 
boost::signals2::signal< void(const
DtString &)> 
signal_layoutUpdated
 Signal sent when a layout is updated. More...
 
boost::signals2::signal< void(const
DtString &)> 
signal_layoutDeleted
 Signal sent when a layout is removed. More...
 
boost::signals2::signal< void(const
DtString &newFav, const
DtString &oldFav)> 
signal_defaultChanged
 Signal sent when a layout is made the default. More...
 
boost::signals2::signal< void(const
DtString &oldName, const
DtString &newName)> 
signal_layoutRenamed
 Signal sent when a layout is renamed. More...
 
boost::signals2::signal< void(const
DtString &className,
makVrv::DtVrvApplicationConfiguration::UIConfiguration &)> 
signal_layoutToBeRealized
 Signal sent before layout is to be realized. More...
 

Protected Types

typedef std::map< DtString,
std::pair< DtFilename,
Configuration > > 
Configurations
 
typedef std::map< std::string,
bool
PanelItems
 

Protected Member Functions

virtual void updateToolbarStates (const makVrv::DtToolbarConfiguration &)
 No-op at this level. More...
 
virtual void updatePageStates (const makVrv::DtPageConfiguration &)
 
virtual bool addConfigurationFor (const DtFilename &, bool addAny=false)
 Adds a new configuration for the given class name. More...
 
virtual void createLayoutBasedOnCurrentConfiguration (const DtString &, bool andUpdateLayout=true)
 Creates a new layout based on the current configuration (does not signal addition nor make current – call newLayout for that) More...
 

Protected Attributes

makVrv::DtDemyDe
 
DtFilename myLayout
 
Configurations myConfigurations
 
bool mySaveLayouts
 
bool mySaveLastSavedLayout
 
PanelItems myPanelItems
 
std::set< DtStringmyClassesToIgnore
 
DtString myLastSavedLayoutClassName
 
bool myIgnoreGeometryChange
 

Static Protected Attributes

static DtString theLayoutFilePrefix
 Prefix used for the layout files on disk. Defaults to "layout_". More...
 

Detailed Description

The DtLayoutManager class allows for the managing (adding, setting and deleting) of UI Layout configurations.

Member Typedef Documentation

typedef std::map<DtString, std::pair<DtFilename, Configuration> > makVrf::DtLayoutManager::Configurations
protected
typedef std::map<std::string, bool> makVrf::DtLayoutManager::PanelItems
protected

Constructor & Destructor Documentation

makVrf::DtLayoutManager::DtLayoutManager ( makVrv::DtDe de)
virtual makVrf::DtLayoutManager::~DtLayoutManager ( )
virtual

Member Function Documentation

static DtLayoutManager& makVrf::DtLayoutManager::instance ( makVrv::DtDe )
static

Get an instance of the creator.

static void makVrf::DtLayoutManager::registerInstance ( makVrv::DtDe de,
DtLayoutManager instance 
)
static

Register an instance of the creator.

virtual void makVrf::DtLayoutManager::setLayout ( const DtFilename &  ,
bool  updateCurrentLayoutBeforeSwitch = false 
)
virtual

Sets a new GUI layout from the given uisx layout file.

virtual void makVrf::DtLayoutManager::setLayoutFromClass ( const DtString ,
bool  updateCurrentLayoutBeforeSwitch = false,
bool  force = false 
)
virtual

Sets a new GUI layout from the given class name.

virtual DtString makVrf::DtLayoutManager::layout ( ) const
virtual

Currently selected layout. If blank is the default layout. The layout returned is the class name.

virtual std::vector<DtString> makVrf::DtLayoutManager::layouts ( ) const
virtual

Returns a list of all the layouts available.

virtual bool makVrf::DtLayoutManager::hasFactoryDefault ( const DtString ) const
virtual

Returns true if there is a file in the factory settings folder that matches the given class name's file.

virtual void makVrf::DtLayoutManager::restoreFromFactory ( const DtString )
virtual

Restores the layout settings from the factory file specified by the class name, if it exists.

virtual bool makVrf::DtLayoutManager::copyToFactory ( const DtString )
virtual

Copies the settings to the factory directory. Will overwrite existing.

virtual void makVrf::DtLayoutManager::revertCurrentLayout ( )
virtual

Reverts the current layout.

virtual void makVrf::DtLayoutManager::revertLayout ( const DtString )
virtual

Reverts the layout to the original layout (by class name)

virtual DtString makVrf::DtLayoutManager::classNameFrom ( const DtFilename &  f) const
virtual

Given the ui layout file, return the class name from it.

virtual void makVrf::DtLayoutManager::uiConfigurationFor ( const DtFilename &  ,
makVrv::DtVrvApplicationConfiguration::UIConfiguration  
)
virtual

Returns the current configuration for the given uisx file. If does not exist will load it.

virtual void makVrf::DtLayoutManager::updateCurrentLayout ( )
virtual

Updates the current layout (toolbars and dock widgets) with the state of the pages.

virtual void makVrf::DtLayoutManager::updateLayout ( const DtString )
virtual

Updates the specified layout (className) with the current state of toolsbars and pages.

Reimplemented in makVrf::DtQtLayoutManager.

virtual void makVrf::DtLayoutManager::setIgnoreGeometryChange ( bool  b)
virtual

Sets whether or not to ignore geometry changes and leave the window as is regardless of what the layout wants. Default is false.

virtual bool makVrf::DtLayoutManager::ignoreGeometryChange ( ) const
virtual
virtual void makVrf::DtLayoutManager::resetLayoutFromMasterModeConfiguration ( )
virtual

Resets the layout to the current global master configuration.

Reimplemented in makVrf::DtQtLayoutManager.

virtual void makVrf::DtLayoutManager::setDefaultLayout ( const DtString )
virtual

Sets/gets the default layout.

virtual void makVrf::DtLayoutManager::clearDefaultLayout ( )
virtual
virtual DtString makVrf::DtLayoutManager::defaultLayout ( ) const
virtual
virtual bool makVrf::DtLayoutManager::duplicateLayout ( const DtString classNameFrom,
const DtString classNameTo 
)
virtual

Duplicates the from layout from the specified class to the given class.

IF the specified class does not exist it will attempted to be loaded from disk

virtual DtFilename makVrf::DtLayoutManager::layoutFilename ( const DtString ) const
virtual

Returns the filename associated with the layout class.

virtual void makVrf::DtLayoutManager::addConfiguration ( const DtFilename &  ,
const makVrv::DtVrvApplicationConfiguration::UIConfiguration  
)
virtual

Creates a new configuration slot based on the supplied configuration and filename.

virtual bool makVrf::DtLayoutManager::hasLayout ( const DtString ) const
virtual

Returns true if this layout exists.

virtual void makVrf::DtLayoutManager::addPageCollectionFromMaster ( const DtString )
virtual

Looks in the master mode configuration for the page collection, and, if present, adds to all page collections that is not currently in.

virtual void makVrf::DtLayoutManager::addToolbarFromMaster ( const DtString )
virtual

Looks in the master mode configuration for the toolbar, and, if present, adds to all toolbar collections that is not currently in.

virtual void makVrf::DtLayoutManager::setPanelVisible ( const DtString className,
const DtString panel,
bool  b 
)
virtual

Sets the page panel visible.

Reimplemented in makVrf::DtQtLayoutManager.

virtual void makVrf::DtLayoutManager::setToolbarVisible ( const DtString className,
const DtString toolbar,
bool  b 
)
virtual

Sets the toolbar visible.

Reimplemented in makVrf::DtQtLayoutManager.

virtual void makVrf::DtLayoutManager::setPaletteItemVisible ( const std::string &  ,
bool   
)
virtual

Sets whether or not the given palette item is visible.

Palette items are treated a bit differently than normal pages, so are handled a bit differently

virtual bool makVrf::DtLayoutManager::paletteItemVisible ( const std::string &  ,
bool keyExists = 0 
) const
virtual
virtual void makVrf::DtLayoutManager::addPaletteItemIfDoesNotExistAndSetToVisible ( const std::string &  ,
bool  b 
)
virtual

If this palette item is not present, add it and set its visiblity to the given flag.

virtual void makVrf::DtLayoutManager::newLayout ( const DtString ,
bool  basedOnCurrent = true 
)
virtual

Creates a new layout based on the current UI configuration and makes it the current layout.

virtual void makVrf::DtLayoutManager::writeLayouts ( )
virtual

Saves all the layouts to their respective files (unless the flag to save layouts is turned off)

virtual void makVrf::DtLayoutManager::saveLayout ( const DtString )
virtual

Saves the specified layout class to the directory where it was read from.

virtual bool makVrf::DtLayoutManager::deleteLayout ( const DtString s)
virtual

Deletes the layout (class name) from disk and internal structures.

virtual void makVrf::DtLayoutManager::renameLayout ( const DtString oldName,
const DtString newName 
)
virtual

Renames the layout internally and on disk from the old to the new name.

virtual void makVrf::DtLayoutManager::setCurrentLayoutUsesFullScreen ( )
virtual

Sets/gets current configuration using full screen.

virtual bool makVrf::DtLayoutManager::currentLayoutUsesFullScreen ( ) const
virtual
virtual void makVrf::DtLayoutManager::setLayoutUsesFullScreen ( const DtString )
virtual

Reimplemented in makVrf::DtQtLayoutManager.

virtual bool makVrf::DtLayoutManager::layoutUsesFullScreen ( const DtString ) const
virtual
virtual void makVrf::DtLayoutManager::setCurrentLayoutIsAlwaysMaximized ( )
virtual

Sets/gets current configuration using full screen.

virtual bool makVrf::DtLayoutManager::currentLayoutIsAlwaysMaximized ( ) const
virtual
virtual void makVrf::DtLayoutManager::setLayoutIsAlwaysMaximized ( const DtString )
virtual

Reimplemented in makVrf::DtQtLayoutManager.

virtual bool makVrf::DtLayoutManager::layoutIsAlwaysMaximized ( const DtString ) const
virtual
virtual void makVrf::DtLayoutManager::setCurrentLayoutUsesWindowGeometry ( )
virtual

Gets/sets whether or not the layout, when updates, will store the current windows geometry.

virtual bool makVrf::DtLayoutManager::currentLayoutUsesWindowGeometry ( ) const
virtual
virtual void makVrf::DtLayoutManager::setLayoutUsesWindowGeometry ( const DtString )
virtual
virtual bool makVrf::DtLayoutManager::layoutUsesWindowGeometry ( const DtString ) const
virtual
virtual void makVrf::DtLayoutManager::updateWithCurrentWindowGeometry ( const DtString )
virtual

If top, left, width and height are all 0 means this window is maximized.

Reimplemented in makVrf::DtQtLayoutManager.

virtual void makVrf::DtLayoutManager::setWindowGeometry ( const DtString ,
int  top,
int  left,
int  width,
int  height 
)
virtual
virtual void makVrf::DtLayoutManager::layoutWindowGeometry ( const DtString ,
int top,
int left,
int width,
int height 
) const
virtual
virtual void makVrf::DtLayoutManager::updateWindowWithGeometryFrom ( const DtString )
virtual

Updates the window with the geometry found in the class configuration.

Since there is no geometry handling here this must be implemented in a subclass

Reimplemented in makVrf::DtQtLayoutManager.

virtual void makVrf::DtLayoutManager::initialize ( )
virtual

Called after the gui has been assembled.

Reimplemented in makVrf::DtQtLayoutManager.

virtual void makVrf::DtLayoutManager::setSaveLayouts ( bool  )
virtual

Sets whether or not layouts can be saved (default is true)

bool makVrf::DtLayoutManager::saveLayouts ( ) const
virtual void makVrf::DtLayoutManager::setSaveLastSavedLayout ( bool  )
virtual

Sets whether or not to save the last saved layout. This flag is checked before saving in the application.

bool makVrf::DtLayoutManager::saveLastSavedLayout ( ) const
virtual void makVrf::DtLayoutManager::addClassToIgnore ( const DtString )
virtual

Classes to ignore when initializing.

virtual void makVrf::DtLayoutManager::removeClassToIgnore ( const DtString )
virtual
const std::set<DtString>& makVrf::DtLayoutManager::classesToIgnore ( ) const
inline
virtual bool makVrf::DtLayoutManager::ignoreClass ( const DtString ) const
virtual
virtual void makVrf::DtLayoutManager::setLastSavedLayoutClassName ( const DtString )
virtual

Get/set the class name of the file used to save the GUI layout in the case of no default layout.

virtual const DtString& makVrf::DtLayoutManager::lastSavedLayoutClassName ( ) const
virtual
virtual void makVrf::DtLayoutManager::preAssemble ( )
virtual

Pre/post gui assembly.

virtual void makVrf::DtLayoutManager::postAssemble ( )
virtual
virtual void makVrf::DtLayoutManager::updateToolbarStates ( const makVrv::DtToolbarConfiguration )
protectedvirtual

No-op at this level.

Reimplemented in makVrf::DtQtLayoutManager.

virtual void makVrf::DtLayoutManager::updatePageStates ( const makVrv::DtPageConfiguration )
protectedvirtual

Reimplemented in makVrf::DtQtLayoutManager.

virtual bool makVrf::DtLayoutManager::addConfigurationFor ( const DtFilename &  ,
bool  addAny = false 
)
protectedvirtual

Adds a new configuration for the given class name.

If addAny is true will add any class else will check if is in ignore list

virtual void makVrf::DtLayoutManager::createLayoutBasedOnCurrentConfiguration ( const DtString ,
bool  andUpdateLayout = true 
)
protectedvirtual

Creates a new layout based on the current configuration (does not signal addition nor make current – call newLayout for that)

Member Data Documentation

boost::signals2::signal<void (const DtString& newLayout, const DtString& oldLayout)> makVrf::DtLayoutManager::signal_layoutSelected

Signal sent when a layout is selected.

boost::signals2::signal<void (const DtString&)> makVrf::DtLayoutManager::signal_layoutAdded

Signal sent when a layout is added.

boost::signals2::signal<void (const DtString&)> makVrf::DtLayoutManager::signal_layoutUpdated

Signal sent when a layout is updated.

boost::signals2::signal<void (const DtString&)> makVrf::DtLayoutManager::signal_layoutDeleted

Signal sent when a layout is removed.

boost::signals2::signal<void (const DtString& newFav, const DtString& oldFav)> makVrf::DtLayoutManager::signal_defaultChanged

Signal sent when a layout is made the default.

boost::signals2::signal<void (const DtString& oldName, const DtString& newName)> makVrf::DtLayoutManager::signal_layoutRenamed

Signal sent when a layout is renamed.

boost::signals2::signal<void (const DtString& className, makVrv::DtVrvApplicationConfiguration::UIConfiguration&)> makVrf::DtLayoutManager::signal_layoutToBeRealized

Signal sent before layout is to be realized.

makVrv::DtDe& makVrf::DtLayoutManager::myDe
protected
DtFilename makVrf::DtLayoutManager::myLayout
protected
Configurations makVrf::DtLayoutManager::myConfigurations
protected
bool makVrf::DtLayoutManager::mySaveLayouts
protected
bool makVrf::DtLayoutManager::mySaveLastSavedLayout
protected
PanelItems makVrf::DtLayoutManager::myPanelItems
protected
std::set<DtString> makVrf::DtLayoutManager::myClassesToIgnore
protected
DtString makVrf::DtLayoutManager::myLastSavedLayoutClassName
protected
bool makVrf::DtLayoutManager::myIgnoreGeometryChange
protected
DtString makVrf::DtLayoutManager::theLayoutFilePrefix
staticprotected

Prefix used for the layout files on disk. Defaults to "layout_".


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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)