LibreOffice Module sd (master) 1
|
Manage the set of visible tool bars (and object bars). More...
#include <ToolBarManager.hxx>
Classes | |
class | Implementation |
class | UpdateLock |
Use this class to prevent the visible tool bars from being updated (and thus causing repaints and GUI rearrangements) when several tool bar operations are made in a row. More... | |
Public Types | |
enum class | ToolBarGroup { Permanent , Function , CommonTask , MasterMode , LAST = MasterMode } |
The set of tool bar groups. More... | |
Public Member Functions | |
~ToolBarManager () | |
void | Shutdown () |
Call this method prior to the destructor to prevent the ToolBarManager from accessing the ViewShellManager or the XLayoutManager when those are possibly not well and alive anymore (like during the destruction of the ViewShellBase.) More... | |
void | MainViewShellChanged () |
When the view in the center pane changes then this method sets up the initial set of tool bars for the new view. More... | |
void | MainViewShellChanged (const ViewShell &rMainViewShell) |
void | SelectionHasChanged (const ViewShell &rViewShell, const SdrView &rView) |
Call this method when the selection has changed to update the more temporary tool bars (those in the ToolBarGroup::Function group.) More... | |
void | ResetToolBars (ToolBarGroup eGroup) |
Reset the set of visible object bars in the specified group. More... | |
void | ResetAllToolBars () |
Reset all tool bars, regardless of the group they belong to. More... | |
void | AddToolBar (ToolBarGroup eGroup, const OUString &rsToolBarName) |
Add the tool bar with the given name to the specified group of tool bars. More... | |
void | AddToolBarShell (ToolBarGroup eGroup, ShellId nToolBarId) |
Add the tool bar shell to the shell stack. More... | |
void | RemoveToolBar (ToolBarGroup eGroup, const OUString &rsToolBarName) |
Remove the tool bar with the given name from the specified group. More... | |
void | SetToolBar (ToolBarGroup eGroup, const OUString &rsToolBarName) |
This is basically a shortcut for ResetToolBars(),AddToolBar(). More... | |
void | SetToolBarShell (ToolBarGroup eGroup, ShellId nToolBarId) |
This is basically a shortcut for ResetToolBars(),AddToolBar(). More... | |
void | PreUpdate () |
void | RequestUpdate () |
Request an update of the active tool bars. More... | |
void | LockViewShellManager () |
This is a hint for the ToolBarManager to improve the performance when it updates its tool bars when its own lock is released. More... | |
void | ToolBarsDestroyed () |
Static Public Member Functions | |
static std::shared_ptr< ToolBarManager > | Create (ViewShellBase &rBase, const std::shared_ptr< tools::EventMultiplexer > &rpMultiplexer, const std::shared_ptr< ViewShellManager > &rpViewShellManager) |
Use this method instead of the constructor to create new objects of this class. More... | |
Static Public Attributes | |
static constexpr OUStringLiteral | msToolBar = u"toolbar" |
The set of tool bars that are handled by this manager class. More... | |
static constexpr OUStringLiteral | msOptionsToolBar = u"optionsbar" |
static constexpr OUStringLiteral | msCommonTaskToolBar = u"commontaskbar" |
static constexpr OUStringLiteral | msViewerToolBar = u"viewerbar" |
static constexpr OUStringLiteral | msSlideSorterToolBar = u"slideviewtoolbar" |
static constexpr OUStringLiteral | msSlideSorterObjectBar = u"slideviewobjectbar" |
static constexpr OUStringLiteral | msOutlineToolBar = u"outlinetoolbar" |
static constexpr OUStringLiteral | msMasterViewToolBar = u"masterviewtoolbar" |
static constexpr OUStringLiteral | msDrawingObjectToolBar = u"drawingobjectbar" |
static constexpr OUStringLiteral | msGluePointsToolBar = u"gluepointsobjectbar" |
static constexpr OUStringLiteral | msTextObjectBar = u"textobjectbar" |
static constexpr OUStringLiteral | msBezierObjectBar = u"bezierobjectbar" |
static constexpr OUStringLiteral | msGraphicObjectBar = u"graphicobjectbar" |
static constexpr OUStringLiteral | msMediaObjectBar = u"mediaobjectbar" |
static constexpr OUStringLiteral | msTableObjectBar = u"tableobjectbar" |
Private Member Functions | |
ToolBarManager () | |
The ViewShellBase is used to get the XLayoutManager and to determine the plug in mode. More... | |
void | LockUpdate () |
void | UnlockUpdate () |
Private Attributes | |
std::unique_ptr< Implementation > | mpImpl |
Friends | |
class | UpdateLock |
Manage the set of visible tool bars (and object bars).
Usually they belong to the current view in the center pane.
Tool bars are managed in groups. Each group can be set, reset, or modified independently of the others. This allows for instance to replace the toolbars associated with the current function independently from those associated with the main view.
The ToolBarManager has two high level methods which contain the knowledge about which tool bars to show in a specific context. When the view in the center pane changes then MainViewShellChanged() sets up the tool bars for the new view. On changes of the selection the SelectionHasChanged() method shows the tool bars for the new context.
The update of the actually visible tool bars to the set currently required by the main view shell and its functions is divided into two parts, PreUpdate() and PostUpdate(). This are to be called before respectively after the update of the view shell stack. The reason for this is to save time by not updating tool bars that will not be visible in a short time on a view shell switch.
Definition at line 59 of file ToolBarManager.hxx.
|
strong |
The set of tool bar groups.
Enumerator | |
---|---|
Permanent | |
Function | |
CommonTask | |
MasterMode | |
LAST |
Definition at line 130 of file ToolBarManager.hxx.
sd::ToolBarManager::~ToolBarManager | ( | ) |
Definition at line 349 of file ToolBarManager.cxx.
|
private |
The ViewShellBase is used to get the XLayoutManager and to determine the plug in mode.
Definition at line 345 of file ToolBarManager.cxx.
Referenced by Create().
void sd::ToolBarManager::AddToolBar | ( | ToolBarGroup | eGroup, |
const OUString & | rsToolBarName | ||
) |
Add the tool bar with the given name to the specified group of tool bars.
rParentShell | When this shell is not the main view then the method returns immediately. |
eGroup | The new tool bar is added to this group. |
rsToolBarName | The base name of the tool bar. A proper prefix (like private:resource/toolbar/) is added. The name may be one of the ones defined above. Other names are allowed as well. |
Definition at line 377 of file ToolBarManager.cxx.
References mpImpl.
void sd::ToolBarManager::AddToolBarShell | ( | ToolBarGroup | eGroup, |
ShellId | nToolBarId | ||
) |
Add the tool bar shell to the shell stack.
This method basically forwards the call to the ViewShellManager. For some tool bar shells additional tool bars are made visible.
rParentShell | When this shell is not the main view then the method returns immediately. |
eGroup | The group is used for the actual tool bars. |
nToolBarId | Id of the tool bar shell. |
Definition at line 388 of file ToolBarManager.cxx.
References mpImpl.
|
static |
Use this method instead of the constructor to create new objects of this class.
Definition at line 334 of file ToolBarManager.cxx.
References ToolBarManager().
Referenced by sd::ViewShellBase::LateInit().
|
private |
Definition at line 452 of file ToolBarManager.cxx.
References mpImpl.
void sd::ToolBarManager::LockViewShellManager | ( | ) |
This is a hint for the ToolBarManager to improve the performance when it updates its tool bars when its own lock is released.
Taking control of the release of the update lock of the ViewShellManager avoids some shell stack modifications and tool bar updates.
Definition at line 446 of file ToolBarManager.cxx.
References mpImpl.
void sd::ToolBarManager::MainViewShellChanged | ( | ) |
When the view in the center pane changes then this method sets up the initial set of tool bars for the new view.
The ToolBarManager listens for view switching itself and then calls MainViewShellChanged(). Calling this method from the outside should not be necessary.
nShellType | The type of the new main view shell. |
Definition at line 464 of file ToolBarManager.cxx.
References mpImpl, and sd::ViewShell::ST_NONE.
void sd::ToolBarManager::MainViewShellChanged | ( | const ViewShell & | rMainViewShell | ) |
Definition at line 473 of file ToolBarManager.cxx.
References mpImpl.
void sd::ToolBarManager::PreUpdate | ( | ) |
Definition at line 434 of file ToolBarManager.cxx.
References mpImpl.
Referenced by sd::IMPL_LINK_NOARG(), sd::ToolBarManager::Implementation::RemoveToolBar(), and sd::ToolBarManager::Implementation::Update().
void sd::ToolBarManager::RemoveToolBar | ( | ToolBarGroup | eGroup, |
const OUString & | rsToolBarName | ||
) |
Remove the tool bar with the given name from the specified group.
If the tool bar is not visible then nothing happens. If the tool bar is a member of another group then nothing happens either.
Definition at line 399 of file ToolBarManager.cxx.
References mpImpl.
void sd::ToolBarManager::RequestUpdate | ( | ) |
Request an update of the active tool bars.
The update is made asynchronously.
Definition at line 440 of file ToolBarManager.cxx.
References mpImpl.
void sd::ToolBarManager::ResetAllToolBars | ( | ) |
Reset all tool bars, regardless of the group they belong to.
rParentShell | When this shell is not the main view then the method returns immediately. |
Definition at line 368 of file ToolBarManager.cxx.
References mpImpl.
Referenced by sd::ToolBarManager::Implementation::SetValid().
void sd::ToolBarManager::ResetToolBars | ( | ToolBarGroup | eGroup | ) |
Reset the set of visible object bars in the specified group.
Tool bars in other groups are not affected.
rParentShell | When this shell is not the main view then the method returns immediately. |
eGroup | Only the tool bars in this group are rest. |
Definition at line 359 of file ToolBarManager.cxx.
References mpImpl.
Referenced by sd::ToolBarManager::Implementation::ResetAllToolBars().
void sd::ToolBarManager::SelectionHasChanged | ( | const ViewShell & | rViewShell, |
const SdrView & | rView | ||
) |
Call this method when the selection has changed to update the more temporary tool bars (those in the ToolBarGroup::Function group.)
Definition at line 482 of file ToolBarManager.cxx.
References mpImpl.
void sd::ToolBarManager::SetToolBar | ( | ToolBarGroup | eGroup, |
const OUString & | rsToolBarName | ||
) |
This is basically a shortcut for ResetToolBars(),AddToolBar().
The main difference is, that all sub shells of the specified parent shell are deactivated as well.
rParentShell | When this shell is not the main view then the method returns immediately. |
eGroup | The new tool bar is added to this group. |
rsToolBarName | The base name of the tool bar. A proper prefix (like private:resource/toolbar/) is added. The name may be one of the ones defined above. Other names are allowed as well. |
Definition at line 410 of file ToolBarManager.cxx.
References mpImpl.
void sd::ToolBarManager::SetToolBarShell | ( | ToolBarGroup | eGroup, |
ShellId | nToolBarId | ||
) |
This is basically a shortcut for ResetToolBars(),AddToolBar().
The main difference is, that all sub shells of the specified parent shell are deactivated as well.
rParentShell | When this shell is not the main view then the method returns immediately. |
rParentShell | When this shell is not the main view then the method returns immediately. |
eGroup | The group is currently not used. |
nToolBarId | Id of the tool bar shell. |
Definition at line 422 of file ToolBarManager.cxx.
References mpImpl.
void sd::ToolBarManager::Shutdown | ( | ) |
Call this method prior to the destructor to prevent the ToolBarManager from accessing the ViewShellManager or the XLayoutManager when those are possibly not well and alive anymore (like during the destruction of the ViewShellBase.)
Definition at line 353 of file ToolBarManager.cxx.
References mpImpl.
void sd::ToolBarManager::ToolBarsDestroyed | ( | ) |
Definition at line 490 of file ToolBarManager.cxx.
References mpImpl.
|
private |
Definition at line 458 of file ToolBarManager.cxx.
References mpImpl.
|
friend |
Definition at line 255 of file ToolBarManager.hxx.
|
private |
Definition at line 261 of file ToolBarManager.hxx.
Referenced by AddToolBar(), AddToolBarShell(), LockUpdate(), LockViewShellManager(), MainViewShellChanged(), PreUpdate(), RemoveToolBar(), RequestUpdate(), ResetAllToolBars(), ResetToolBars(), SelectionHasChanged(), SetToolBar(), SetToolBarShell(), Shutdown(), ToolBarsDestroyed(), and UnlockUpdate().
|
staticconstexpr |
Definition at line 119 of file ToolBarManager.hxx.
|
staticconstexpr |
Definition at line 103 of file ToolBarManager.hxx.
Referenced by sd::DrawViewShell::ChangeEditMode().
|
staticconstexpr |
Definition at line 113 of file ToolBarManager.hxx.
Referenced by sd::FuConstruct3dObject::DoExecute(), sd::FuConstructArc::DoExecute(), sd::FuConstructCustomShape::DoExecute(), sd::FuConstructRectangle::DoExecute(), and sd::FuConstructUnoControl::DoExecute().
|
staticconstexpr |
Definition at line 115 of file ToolBarManager.hxx.
Referenced by sd::FuEditGluePoints::DoExecute().
|
staticconstexpr |
Definition at line 121 of file ToolBarManager.hxx.
|
staticconstexpr |
Definition at line 111 of file ToolBarManager.hxx.
Referenced by sd::DrawViewShell::ChangeEditMode().
|
staticconstexpr |
Definition at line 123 of file ToolBarManager.hxx.
|
staticconstexpr |
Definition at line 101 of file ToolBarManager.hxx.
|
staticconstexpr |
Definition at line 110 of file ToolBarManager.hxx.
|
staticconstexpr |
Definition at line 108 of file ToolBarManager.hxx.
|
staticconstexpr |
Definition at line 106 of file ToolBarManager.hxx.
|
staticconstexpr |
Definition at line 125 of file ToolBarManager.hxx.
|
staticconstexpr |
Definition at line 117 of file ToolBarManager.hxx.
|
staticconstexpr |
The set of tool bars that are handled by this manager class.
Definition at line 100 of file ToolBarManager.hxx.
|
staticconstexpr |
Definition at line 105 of file ToolBarManager.hxx.
Referenced by sd::ToolBarManager::Implementation::CheckPlugInMode().