Theupdateoftheactuallyvisibletoolbarstothesetcurrently requiredbythemainviewshellanditsfunctionsisdividedintotwo parts,PreUpdate()andPostUpdate().Thisaretobecalledbefore respectivelyaftertheupdateoftheviewshellstack.Thereasonfor thisistosavetimebynotupdatingtoolbarsthatwillnotbevisible inashorttimeonaviewshellswitch.
*/ class ToolBarManager
: public std::enable_shared_from_this<ToolBarManager>
{ public: /** Use this method instead of the constructor to create new objects of thisclass.
*/ static std::shared_ptr<ToolBarManager> Create (
ViewShellBase& rBase, const std::shared_ptr<tools::EventMultiplexer>& rpMultiplexer, const std::shared_ptr<ViewShellManager>& rpViewShellManager);
~ToolBarManager();
/** Call this method prior to the destructor to prevent the ToolBarManagerfromaccessingtheViewShellManagerorthe XLayoutManagerwhenthosearepossiblynotwellandaliveanymore (likeduringthedestructionoftheViewShellBase.)
*/ void Shutdown();
/** When the view in the center pane changes then this method sets up theinitialsetoftoolbarsforthenewview. TheToolBarManagerlistensforviewswitchingitselfandthencalls MainViewShellChanged().Callingthismethodfromtheoutsideshould notbenecessary. @paramnShellType Thetypeofthenewmainviewshell.
*/ void MainViewShellChanged (); void MainViewShellChanged (const ViewShell& rMainViewShell);
/** Call this method when the selection has changed to update the more temporarytoolbars(thoseintheToolBarGroup::Functiongroup.)
*/ void SelectionHasChanged ( const ViewShell& rViewShell, const SdrView& rView);
/** The set of tool bar groups.
*/ enumclass ToolBarGroup {
Permanent,
Function,
CommonTask,
MasterMode,
LAST = MasterMode
};
/** Reset the set of visible object bars in the specified group. Tool barsinothergroupsarenotaffected. @paramrParentShell Whenthisshellisnotthemainviewthenthemethodreturns immediately. @parameGroup Onlythetoolbarsinthisgrouparerest.
*/ void ResetToolBars (ToolBarGroup eGroup);
/** Reset all tool bars, regardless of the group they belong to. @paramrParentShell Whenthisshellisnotthemainviewthenthemethodreturns immediately.
*/ void ResetAllToolBars();
/** Add the tool bar with the given name to the specified group of tool bars. @paramrParentShell Whenthisshellisnotthemainviewthenthemethodreturns immediately. @parameGroup Thenewtoolbarisaddedtothisgroup. @paramrsToolBarName Thebasenameofthetoolbar.Aproperprefix(like private:resource/toolbar/)isadded.Thenamemaybeoneofthe onesdefinedabove.Othernamesareallowedaswell.
*/ void AddToolBar (
ToolBarGroup eGroup, const OUString& rsToolBarName);
/** Add the tool bar shell to the shell stack. This method basically forwardsthecalltotheViewShellManager. Forsometoolbarshellsadditionaltoolbarsaremadevisible. @paramrParentShell Whenthisshellisnotthemainviewthenthemethodreturns immediately. @parameGroup Thegroupisusedfortheactualtoolbars. @paramnToolBarId Idofthetoolbarshell.
*/ void AddToolBarShell (
ToolBarGroup eGroup,
ShellId nToolBarId);
/** Remove the tool bar with the given name from the specified group. Ifthetoolbarisnotvisiblethennothinghappens. Ifthetoolbarisamemberofanothergroupthennothinghappens either.
*/ void RemoveToolBar (
ToolBarGroup eGroup, const OUString& rsToolBarName);
/** This is basically a shortcut for ResetToolBars(),AddToolBar(). The maindifferenceis,thatallsubshellsofthespecifiedparent shellaredeactivatedaswell. @paramrParentShell Whenthisshellisnotthemainviewthenthemethodreturns immediately. @parameGroup Thenewtoolbarisaddedtothisgroup. @paramrsToolBarName Thebasenameofthetoolbar.Aproperprefix(like private:resource/toolbar/)isadded.Thenamemaybeoneofthe onesdefinedabove.Othernamesareallowedaswell.
*/ void SetToolBar (
ToolBarGroup eGroup, const OUString& rsToolBarName);
/** This is basically a shortcut for ResetToolBars(),AddToolBar(). The maindifferenceis,thatallsubshellsofthespecifiedparent shellaredeactivatedaswell. @paramrParentShell Whenthisshellisnotthemainviewthenthemethodreturns immediately. @paramrParentShell Whenthisshellisnotthemainviewthenthemethodreturns immediately. @parameGroup Thegroupiscurrentlynotused. @paramnToolBarId Idofthetoolbarshell.
*/ void SetToolBarShell (
ToolBarGroup eGroup,
ShellId nToolBarId);
void PreUpdate();
/** Request an update of the active tool bars. The update is made asynchronously.
*/ void RequestUpdate();
/** This is a hint for the ToolBarManager to improve the performance whenitupdatesitstoolbarswhenitsownlockisreleased.Taking controlofthereleaseoftheupdatelockoftheViewShellManager avoidssomeshellstackmodificationsandtoolbarupdates.
*/ void LockViewShellManager();
/** Use this class to prevent the visible tool bars from being updated (andthuscausingrepaintsandGUIrearrangements)whenseveraltool baroperationsaremadeinarow.
*/ class UpdateLock { public:
UpdateLock(std::shared_ptr<ToolBarManager> pManager)
: mpManager(std::move(pManager)) { mpManager->LockUpdate(); }
~UpdateLock() COVERITY_NOEXCEPT_FALSE { mpManager->UnlockUpdate(); } private:
std::shared_ptr<ToolBarManager> mpManager;
}; friendclass UpdateLock;
void ToolBarsDestroyed();
private: class Implementation;
std::unique_ptr<Implementation> mpImpl;
/** The ViewShellBase is used to get the XLayoutManager and to determine thepluginmode.
*/
ToolBarManager();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.