OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ak::aWindowManager Class Reference

This class is used to manage a QMainWindow It provides several functions to create and manipulate the UI Also it will connect all created objects to the messaging system and will manage the UIDs of those objects. More...

#include "aWindowManager.h"

Inheritance diagram for ak::aWindowManager:
ak::aObject

Signals

void tabToolBarTabChanged (int _index)
 

Public Member Functions

 aWindowManager (aMessenger *_messenger, aUidManager *_uidManager)
 Constructor.
 
virtual ~aWindowManager ()
 Deconstructor.
 
virtual void removeChildObject (aObject *_child) override
 Will remove the child from this object (not destroy it) This function should be called from the deconstructor of a child.
 
void SetObjectName (const QString &_alias)
 Will set the alias for this object.
 
void setCentralWidget (QWidget *_centralWidget)
 
void setStatusLabelText (const QString &_status)
 Will set the text of the status label.
 
void setStatusLabelVisible (bool _visible=true, bool _hideDelayed=true)
 Will set the visible state of the status label If the show delayed option is active the delay timer will start and set the visible state of the status label on timeout.
 
void setStatusBarProgress (int _progress)
 Will set the progress of the status bar.
 
void setStatusBarVisible (bool _visible, bool _showDelayed=true)
 Will set the visible state of the progress bar If the show delayed option is active the delay timer will start and set the visible state of the progress bar on timeout.
 
void setStatusBarContinuous (bool _continuos=true)
 Will set the status bar to an continuous stage.
 
bool getStatusBarVisible (void) const
 
bool getStatusLabelVisible (void) const
 
QString getStatusLabelText (void) const
 
int getStatusBarProgress (void) const
 
bool getStatusBarContinuous (void) const
 
void setShowStatusObjectDelayTimerInterval (int _interval)
 Will set the interval for the status label and progress bar show timer.
 
void setHideStatusObjectDelayTimerInterval (int _interval)
 Will set the interval for the status label and progress bar hide timer.
 
int getShowStatusObjectDelayTimerInterval (void) const
 Will return the currently set interval for the status label and progress bar show timer.
 
int getHideStatusObjectDelayTimerInterval (void) const
 Will return the currently set interval for the status label and progress bar hide timer.
 
void setWaitingAnimationVisible (bool _visible)
 
void setWaitingAnimation (QMovie *_movie)
 
void setTabToolBarVisible (bool _vis=true)
 Will set the visible status of the tabToolbar.
 
void setTabToolbarDoubleClickEnabled (bool _isEnabled)
 Will set the enabled state of the double click event for the tab toolbar tabs.
 
aTtbPagecreateTabToolbarSubContainer (const QString &_text=QString(""))
 Will add a new sub container to the tab toolbar container.
 
aTtbContainergetTabToolBarSubContainer (const QString &_text)
 Will return the sub container with the specified text Returns nullptr if no sub container with the specified text exists.
 
QString getTabToolBarTabText (ak::ID _tabId)
 
void addTabToolbarWidget (UID _parentUid, UID _objectUid)
 Will add the object with the provided uid to the specified parent object The object must have been creted by the objectManager used in this tab toolbar manager. Valid objects are actions or any object derived from aWidget.
 
ID currentTabToolbarTab (void) const
 Will return the current selected tab toolbar tab.
 
int tabToolbarTabCount (void) const
 Will return the ammount of tabs in the tabToolbar.
 
void enableTabToolbar (bool flag) const
 Will enable or disable the tabToolbar.
 
void setCurrentTabToolBarTab (ID _tabID)
 Will set the specified tab toolbar tab as current.
 
void setCurrentTabToolBarTab (const QString &_tabName)
 
void setCentralWidgetMinimumSize (const QSize &_size)
 Will set the minimum size of the central widget.
 
aWindowwindow (void) const
 Returns a pointer to the QMainWindow this UI Manager is managing.
 
void setWindowTitle (const QString &_title)
 Will est the window title to the title provided.
 
void setWindowIcon (const QIcon &_tcon)
 Will set the window icon to the icon provided.
 
QString windowTitle (void) const
 Will return the currently set window title.
 
void addEventHandler (aWindowEventHandler *_eventHandler)
 Will add the provided event handler to this window.
 
void removeEventHandler (aWindowEventHandler *_eventHandler)
 Will remove the provided event handler from this window.
 
void showMaximized (void)
 Will set the window state to maximized.
 
void showMinimized (void)
 Will set the window state to minimized.
 
void showNormal (void)
 Will set the window state to normal.
 
void close (void)
 Will close the window.
 
void resize (int _width, int _height)
 
std::string saveState (std::string currentState)
 Will return the state of the window so it can be restored.
 
bool restoreState (const std::string &_state, bool _setPositionAndSize=true)
 
void setTabToolBarTabOrder (const QStringList &_list)
 
- Public Member Functions inherited from ak::aObject
 aObject (objectType _type=otNone, UID _UID=ak::invalidUID)
 Constructor.
 
 aObject (const aObject &_other)
 Copy constructor.
 
aObjectoperator= (const aObject &_other)
 Assignment operator.
 
virtual ~aObject ()
 Deconstructor.
 
virtual void addChildObject (aObject *_child)
 Will add the child to this object.
 
void setUniqueName (const QString &_name)
 Will set this objects unique name.
 
virtual void setParentObject (aObject *_parentObject)
 Will set the parent object of this object.
 
QString uniqueName (void) const
 Will return the unique name of this object.
 
aObjectparentObject (void) const
 Will return a pointer to the parent object.
 
int childObjectCount (void) const
 Will return the count of sub objects.
 
aObjectchildObject (UID _childUID)
 Will return the child with the specified UID.
 
void setOwner (aObject *_object)
 Will set the owner of this object.
 
aObjectowner (void) const
 Will return the owner of this object.
 
void setUid (UID _UID)
 Will set the objects UID.
 
UID uid (void) const
 Returns the objects UID.
 
objectType type (void) const
 Returns the objects type.
 
virtual bool isWidgetType (void) const
 Returns true if the object is an object derived from aWidget.
 

Additional Inherited Members

- Protected Attributes inherited from ak::aObject
UID m_uid
 
int m_references
 The objects UID.
 
objectType m_objectType
 The objects references.
 
QString m_uniqueName
 The object type of this object.
 
aObjectm_parentObject
 
aObjectm_owner
 
std::map< UID, aObject * > m_childObjects
 

Detailed Description

This class is used to manage a QMainWindow It provides several functions to create and manipulate the UI Also it will connect all created objects to the messaging system and will manage the UIDs of those objects.

Constructor & Destructor Documentation

◆ aWindowManager()

ak::aWindowManager::aWindowManager ( aMessenger * _messenger,
aUidManager * _uidManager )

Constructor.

Parameters
_messengerThe global messenger used in this object
_uidManagerThe global UID manager used in this object

◆ ~aWindowManager()

ak::aWindowManager::~aWindowManager ( )
virtual

Deconstructor.

Member Function Documentation

◆ addEventHandler()

void ak::aWindowManager::addEventHandler ( aWindowEventHandler * _eventHandler)

Will add the provided event handler to this window.

Parameters
_eventHandlerThe event handler to add

◆ addTabToolbarWidget()

void ak::aWindowManager::addTabToolbarWidget ( ak::UID _parentUid,
ak::UID _objectUid )

Will add the object with the provided uid to the specified parent object The object must have been creted by the objectManager used in this tab toolbar manager. Valid objects are actions or any object derived from aWidget.

Parameters
_objectUidThe UID of the object to be added
_parentUidThe UID of the parent object where to add the Object to

◆ close()

void ak::aWindowManager::close ( void )

Will close the window.

◆ createTabToolbarSubContainer()

ak::aTtbPage * ak::aWindowManager::createTabToolbarSubContainer ( const QString & _text = QString(""))

Will add a new sub container to the tab toolbar container.

Parameters
_textThe initial text of the container

◆ currentTabToolbarTab()

ak::ID ak::aWindowManager::currentTabToolbarTab ( void ) const

Will return the current selected tab toolbar tab.

◆ enableTabToolbar()

void ak::aWindowManager::enableTabToolbar ( bool flag) const

Will enable or disable the tabToolbar.

◆ getHideStatusObjectDelayTimerInterval()

int ak::aWindowManager::getHideStatusObjectDelayTimerInterval ( void ) const

Will return the currently set interval for the status label and progress bar hide timer.

◆ getShowStatusObjectDelayTimerInterval()

int ak::aWindowManager::getShowStatusObjectDelayTimerInterval ( void ) const

Will return the currently set interval for the status label and progress bar show timer.

◆ getStatusBarContinuous()

bool ak::aWindowManager::getStatusBarContinuous ( void ) const

◆ getStatusBarProgress()

int ak::aWindowManager::getStatusBarProgress ( void ) const

◆ getStatusBarVisible()

bool ak::aWindowManager::getStatusBarVisible ( void ) const

◆ getStatusLabelText()

QString ak::aWindowManager::getStatusLabelText ( void ) const

◆ getStatusLabelVisible()

bool ak::aWindowManager::getStatusLabelVisible ( void ) const

◆ getTabToolBarSubContainer()

ak::aTtbContainer * ak::aWindowManager::getTabToolBarSubContainer ( const QString & _text)

Will return the sub container with the specified text Returns nullptr if no sub container with the specified text exists.

Parameters
_textThe text of the sub container to find

◆ getTabToolBarTabText()

QString ak::aWindowManager::getTabToolBarTabText ( ak::ID _tabId)

◆ removeChildObject()

void ak::aWindowManager::removeChildObject ( aObject * _child)
overridevirtual

Will remove the child from this object (not destroy it) This function should be called from the deconstructor of a child.

Reimplemented from ak::aObject.

◆ removeEventHandler()

void ak::aWindowManager::removeEventHandler ( aWindowEventHandler * _eventHandler)

Will remove the provided event handler from this window.

Parameters
_eventHandlerThe event handler to remove

◆ resize()

void ak::aWindowManager::resize ( int _width,
int _height )

◆ restoreState()

bool ak::aWindowManager::restoreState ( const std::string & _state,
bool _setPositionAndSize = true )

◆ saveState()

std::string ak::aWindowManager::saveState ( std::string currentState)

Will return the state of the window so it can be restored.

◆ setCentralWidget()

void ak::aWindowManager::setCentralWidget ( QWidget * _centralWidget)

◆ setCentralWidgetMinimumSize()

void ak::aWindowManager::setCentralWidgetMinimumSize ( const QSize & _size)

Will set the minimum size of the central widget.

Parameters
_sizeThe size to set as minimum size

◆ setCurrentTabToolBarTab() [1/2]

void ak::aWindowManager::setCurrentTabToolBarTab ( const QString & _tabName)

◆ setCurrentTabToolBarTab() [2/2]

void ak::aWindowManager::setCurrentTabToolBarTab ( ak::ID _tabID)

Will set the specified tab toolbar tab as current.

Parameters
_tabIDThe tab to set as current

◆ setHideStatusObjectDelayTimerInterval()

void ak::aWindowManager::setHideStatusObjectDelayTimerInterval ( int _interval)

Will set the interval for the status label and progress bar hide timer.

Parameters
_intervalThe interval to be set

◆ SetObjectName()

void ak::aWindowManager::SetObjectName ( const QString & _alias)

Will set the alias for this object.

Parameters
_aliasThe alias to set

◆ setShowStatusObjectDelayTimerInterval()

void ak::aWindowManager::setShowStatusObjectDelayTimerInterval ( int _interval)

Will set the interval for the status label and progress bar show timer.

Parameters
_intervalThe interval to be set

◆ setStatusBarContinuous()

void ak::aWindowManager::setStatusBarContinuous ( bool _continuos = true)

Will set the status bar to an continuous stage.

◆ setStatusBarProgress()

void ak::aWindowManager::setStatusBarProgress ( int _progress)

Will set the progress of the status bar.

Parameters
_progressThe progress to set the status bar (0 - 100)

◆ setStatusBarVisible()

void ak::aWindowManager::setStatusBarVisible ( bool _visible,
bool _showDelayed = true )

Will set the visible state of the progress bar If the show delayed option is active the delay timer will start and set the visible state of the progress bar on timeout.

Parameters
_visibleIf true, the progress bar will be set to visible, otherwise to hidden
_resetOnHideIf true, the progress bar progress will be set to 0 if it is hidden
_showDelayedIf true, the progress bar will be shown/hidden by the delay timer

◆ setStatusLabelText()

void ak::aWindowManager::setStatusLabelText ( const QString & _status)

Will set the text of the status label.

Parameters
_statusThe text to be set

◆ setStatusLabelVisible()

void ak::aWindowManager::setStatusLabelVisible ( bool _visible = true,
bool _hideDelayed = true )

Will set the visible state of the status label If the show delayed option is active the delay timer will start and set the visible state of the status label on timeout.

Parameters
_visibleIf true, the status label will be set to visible, otherwise to hidden
_hideDelayedIf true, the status label will be hidden by the delay timer

◆ setTabToolbarDoubleClickEnabled()

void ak::aWindowManager::setTabToolbarDoubleClickEnabled ( bool _isEnabled)

Will set the enabled state of the double click event for the tab toolbar tabs.

◆ setTabToolBarTabOrder()

void ak::aWindowManager::setTabToolBarTabOrder ( const QStringList & _list)

◆ setTabToolBarVisible()

void ak::aWindowManager::setTabToolBarVisible ( bool _vis = true)

Will set the visible status of the tabToolbar.

Parameters
_visIf true, the tab toolBar will be visible

◆ setWaitingAnimation()

void ak::aWindowManager::setWaitingAnimation ( QMovie * _movie)

◆ setWaitingAnimationVisible()

void ak::aWindowManager::setWaitingAnimationVisible ( bool _visible)

◆ setWindowIcon()

void ak::aWindowManager::setWindowIcon ( const QIcon & _tcon)

Will set the window icon to the icon provided.

Parameters
_iconThe icon to set

◆ setWindowTitle()

void ak::aWindowManager::setWindowTitle ( const QString & _title)

Will est the window title to the title provided.

Parameters
_titleThe title to set

◆ showMaximized()

void ak::aWindowManager::showMaximized ( void )

Will set the window state to maximized.

◆ showMinimized()

void ak::aWindowManager::showMinimized ( void )

Will set the window state to minimized.

◆ showNormal()

void ak::aWindowManager::showNormal ( void )

Will set the window state to normal.

◆ tabToolBarTabChanged

void ak::aWindowManager::tabToolBarTabChanged ( int _index)
signal

◆ tabToolbarTabCount()

int ak::aWindowManager::tabToolbarTabCount ( void ) const

Will return the ammount of tabs in the tabToolbar.

◆ window()

ak::aWindow * ak::aWindowManager::window ( void ) const

Returns a pointer to the QMainWindow this UI Manager is managing.

◆ windowTitle()

QString ak::aWindowManager::windowTitle ( void ) const

Will return the currently set window title.


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