LibreOffice Module sd (master) 1
|
Base class of a menu that lets the user select from a list of templates or designs that are loaded from files. More...
#include <MasterPagesSelector.hxx>
Public Member Functions | |
MasterPagesSelector (weld::Widget *pParent, SdDrawDocument &rDocument, ViewShellBase &rBase, std::shared_ptr< MasterPageContainer > pContainer, css::uno::Reference< css::ui::XSidebar > xSidebar, const OUString &rUIFileName, const OUString &rValueSetName) | |
virtual | ~MasterPagesSelector () override |
virtual void | LateInit () |
sal_Int32 | GetPreferredHeight (sal_Int32 nWidth) |
void | ClearPageSet () |
Make the selector empty. More... | |
void | SetHelpId (const OUString &aId) |
void | InvalidatePreview (const SdPage *pPage) |
Mark the preview that belongs to the given index as not up-to-date anymore with respect to page content or preview size. More... | |
void | UpdateAllPreviews () |
void | ShowContextMenu (const Point *pPos) |
virtual css::ui::LayoutSize | GetHeightForWidth (const sal_Int32 nWidth) override |
![]() | |
PanelLayout (weld::Widget *pParent, const OUString &rID, const OUString &rUIXMLDescription) | |
void | SetPanel (sfx2::sidebar::Panel *pPanel) |
virtual | ~PanelLayout () |
Size | get_preferred_size () const |
void | queue_resize () |
Protected Types | |
typedef ::std::pair< int, MasterPageContainer::Token > | UserData |
typedef ::std::vector< MasterPageContainer::Token > | ItemList |
typedef ::std::map< MasterPageContainer::Token, sal_Int32 > | TokenToValueSetIndex |
Protected Member Functions | |
SdPage * | GetSelectedMasterPage () |
void | AssignMasterPageToAllSlides (SdPage *pMasterPage) |
Assign the given master page to all slides of the document. More... | |
void | AssignMasterPageToSelectedSlides (SdPage *pMasterPage) |
Assign the given master page to all slides that are selected in a slide sorter that is displayed in the lef or center pane. More... | |
virtual void | AssignMasterPageToPageList (SdPage *pMasterPage, const std::shared_ptr< std::vector< SdPage * > > &rPageList) |
virtual void | NotifyContainerChangeEvent (const MasterPageContainerChangeEvent &rEvent) |
UserData * | GetUserData (int nIndex) const |
void | SetUserData (int nIndex, std::unique_ptr< UserData > pData) |
sal_Int32 | GetIndexForToken (MasterPageContainer::Token aToken) const |
void | UpdateItemList (::std::unique_ptr< ItemList > &&pList) |
void | Clear () |
void | InvalidateItem (MasterPageContainer::Token aToken) |
Invalidate the specified item so that on the next Fill() this item is updated. More... | |
void | UpdateLocks (const ItemList &rItemList) |
Lock master pages in the given list and release locks that were previously acquired. More... | |
void | Fill () |
virtual void | Fill (ItemList &rItemList)=0 |
virtual OUString | GetContextMenuUIFile () const |
Give derived classes the opportunity to provide their own context menu. More... | |
virtual void | ProcessPopupMenu (weld::Menu &rMenu) |
virtual void | ExecuteCommand (const OUString &rIdent) |
![]() | |
virtual void | DataChanged (const DataChangedEvent &rEvent) |
virtual void | DumpAsPropertyTree (tools::JsonWriter &) |
virtual weld::Window * | GetFrameWeld () const |
Protected Attributes | |
mutable::osl::Mutex | maMutex |
std::shared_ptr< MasterPageContainer > | mpContainer |
std::unique_ptr< PreviewValueSet > | mxPreviewValueSet |
std::unique_ptr< weld::CustomWeld > | mxPreviewValueSetWin |
SdDrawDocument & | mrDocument |
ViewShellBase & | mrBase |
ItemList | maCurrentItemList |
TokenToValueSetIndex | maTokenToValueSetIndex |
ItemList | maLockedMasterPages |
![]() | |
std::unique_ptr< weld::Builder > | m_xBuilder |
std::unique_ptr< weld::Container > | m_xContainer |
sfx2::sidebar::Panel * | m_pPanel |
Private Member Functions | |
DECL_LINK (ClickHandler, ValueSet *, void) | |
The offset between ValueSet index and MasterPageContainer::Token last seen. More... | |
DECL_LINK (ContextMenuHandler, const Point *, void) | |
DECL_LINK (ContainerChangeListener, MasterPageContainerChangeEvent &, void) | |
void | SetItem (sal_uInt16 nIndex, MasterPageContainer::Token aToken) |
void | AddTokenToIndexEntry (sal_uInt16 nIndex, MasterPageContainer::Token aToken) |
void | RemoveTokenToIndexEntry (sal_uInt16 nIndex, MasterPageContainer::Token aToken) |
Private Attributes | |
css::uno::Reference< css::ui::XSidebar > | mxSidebar |
Base class of a menu that lets the user select from a list of templates or designs that are loaded from files.
Definition at line 45 of file MasterPagesSelector.hxx.
|
protected |
Definition at line 124 of file MasterPagesSelector.hxx.
|
protected |
Definition at line 135 of file MasterPagesSelector.hxx.
|
protected |
Definition at line 119 of file MasterPagesSelector.hxx.
sd::sidebar::MasterPagesSelector::MasterPagesSelector | ( | weld::Widget * | pParent, |
SdDrawDocument & | rDocument, | ||
ViewShellBase & | rBase, | ||
std::shared_ptr< MasterPageContainer > | pContainer, | ||
css::uno::Reference< css::ui::XSidebar > | xSidebar, | ||
const OUString & | rUIFileName, | ||
const OUString & | rValueSetName | ||
) |
Definition at line 53 of file MasterPagesSelector.cxx.
References sfx2::sidebar::Theme::Color_PanelBackground, sfx2::sidebar::Theme::GetColor(), sd::sidebar::MasterPageContainer::LARGE, LINK, mpContainer, mxPreviewValueSet, and WB_NO_DIRECTSELECT.
|
overridevirtual |
Definition at line 87 of file MasterPagesSelector.cxx.
References Clear(), LINK, mpContainer, mxPreviewValueSet, mxPreviewValueSetWin, and UpdateLocks().
|
private |
Definition at line 459 of file MasterPagesSelector.cxx.
References maMutex, maTokenToValueSetIndex, and nIndex.
Referenced by SetItem().
|
protected |
Assign the given master page to all slides of the document.
Assemble a list of all slides of the document and pass it to AssignMasterPageToPageList().
pMasterPage | The master page to assign to all slides. |
Definition at line 290 of file MasterPagesSelector.cxx.
References AssignMasterPageToPageList(), SdPage::GetLayoutName(), SdDrawDocument::GetSdPage(), SdDrawDocument::GetSdPageCount(), mrDocument, and Standard.
Referenced by ExecuteCommand().
|
protectedvirtual |
Reimplemented in sd::sidebar::RecentMasterPagesSelector.
Definition at line 345 of file MasterPagesSelector.cxx.
References sd::sidebar::DocumentHelper::AssignMasterPageToPageList(), and mrDocument.
Referenced by AssignMasterPageToAllSlides(), sd::sidebar::RecentMasterPagesSelector::AssignMasterPageToPageList(), and AssignMasterPageToSelectedSlides().
|
protected |
Assign the given master page to all slides that are selected in a slide sorter that is displayed in the lef or center pane.
Assemble a list of the currently selected slides (selected in a visible slide sorter) and pass it to AssignMasterPageToPageList().
When both panes display a slide sorter then the one in the center pane is used.
Definition at line 320 of file MasterPagesSelector.cxx.
References AssignMasterPageToPageList(), and mrBase.
Referenced by ExecuteCommand().
|
protected |
Definition at line 558 of file MasterPagesSelector.cxx.
References ClearPageSet(), and maMutex.
Referenced by ~MasterPagesSelector().
void sd::sidebar::MasterPagesSelector::ClearPageSet | ( | ) |
Make the selector empty.
This method clear the value set from any entries. Override this method to add functionality, especially to destroy objects set as data items at the value set.
Definition at line 528 of file MasterPagesSelector.cxx.
References GetUserData(), maMutex, mxPreviewValueSet, nIndex, and pData.
Referenced by Clear().
|
private |
The offset between ValueSet index and MasterPageContainer::Token last seen.
This value is used heuristically to speed up the lookup of an index for a token.
|
private |
|
private |
|
protectedvirtual |
Reimplemented in sd::sidebar::CurrentMasterPagesSelector.
Definition at line 215 of file MasterPagesSelector.cxx.
References AssignMasterPageToAllSlides(), AssignMasterPageToSelectedSlides(), SfxDispatcher::Execute(), SfxViewFrame::GetDispatcher(), sd::ViewShellBase::GetDrawController(), GetSelectedMasterPage(), SdrPage::getUnoPage(), SfxViewShell::GetViewFrame(), sd::sidebar::MasterPageContainer::LARGE, mpContainer, mrBase, mxPreviewValueSet, mxSidebar, nIndex, sd::ViewShellBase::SetBusyState(), sd::DrawController::setCurrentPage(), and sd::sidebar::MasterPageContainer::SMALL.
Referenced by sd::sidebar::CurrentMasterPagesSelector::ExecuteCommand(), and ShowContextMenu().
|
protected |
Definition at line 134 of file MasterPagesSelector.cxx.
References Fill(), UpdateItemList(), and UpdateLocks().
Referenced by sd::sidebar::AllMasterPagesSelector::AllMasterPagesSelector(), Fill(), sd::sidebar::IMPL_LINK(), sd::sidebar::IMPL_LINK_NOARG(), sd::sidebar::CurrentMasterPagesSelector::LateInit(), sd::sidebar::RecentMasterPagesSelector::LateInit(), NotifyContainerChangeEvent(), and sd::sidebar::AllMasterPagesSelector::NotifyContainerChangeEvent().
|
protectedpure virtual |
|
protectedvirtual |
Give derived classes the opportunity to provide their own context menu.
If they do then they probably have to provide their own Execute() and GetState() methods as well.
Reimplemented in sd::sidebar::CurrentMasterPagesSelector.
Definition at line 144 of file MasterPagesSelector.cxx.
Referenced by ShowContextMenu().
|
overridevirtual |
Definition at line 612 of file MasterPagesSelector.cxx.
References GetPreferredHeight().
|
protected |
Definition at line 547 of file MasterPagesSelector.cxx.
References maMutex, and maTokenToValueSetIndex.
Referenced by NotifyContainerChangeEvent(), and RemoveTokenToIndexEntry().
sal_Int32 sd::sidebar::MasterPagesSelector::GetPreferredHeight | ( | sal_Int32 | nWidth | ) |
Definition at line 103 of file MasterPagesSelector.cxx.
References maMutex, and mxPreviewValueSet.
Referenced by GetHeightForWidth().
|
protected |
Definition at line 273 of file MasterPagesSelector.cxx.
References GetUserData(), maMutex, mpContainer, mxPreviewValueSet, nIndex, and pData.
Referenced by ExecuteCommand(), sd::sidebar::CurrentMasterPagesSelector::ExecuteCommand(), and sd::sidebar::CurrentMasterPagesSelector::ProcessPopupMenu().
|
protected |
Definition at line 395 of file MasterPagesSelector.cxx.
References o3tl::make_unsigned(), maMutex, mxPreviewValueSet, and nIndex.
Referenced by ClearPageSet(), GetSelectedMasterPage(), InvalidatePreview(), RemoveTokenToIndexEntry(), SetUserData(), and UpdateAllPreviews().
|
protected |
Invalidate the specified item so that on the next Fill() this item is updated.
Definition at line 565 of file MasterPagesSelector.cxx.
References maCurrentItemList, maMutex, and sd::sidebar::MasterPageContainer::NIL_TOKEN.
Referenced by NotifyContainerChangeEvent().
void sd::sidebar::MasterPagesSelector::InvalidatePreview | ( | const SdPage * | pPage | ) |
Mark the preview that belongs to the given index as not up-to-date anymore with respect to page content or preview size.
The implementation of this method will either sunchronously or asynchronously call UpdatePreview().
nIndex | Index into the value set control that is used for displaying the previews. |
Definition at line 488 of file MasterPagesSelector.cxx.
References GetUserData(), maMutex, mpContainer, mxPreviewValueSet, nIndex, and pData.
|
virtual |
Reimplemented in sd::sidebar::CurrentMasterPagesSelector, and sd::sidebar::RecentMasterPagesSelector.
Definition at line 99 of file MasterPagesSelector.cxx.
Referenced by sd::sidebar::CurrentMasterPagesSelector::LateInit(), and sd::sidebar::RecentMasterPagesSelector::LateInit().
|
protectedvirtual |
Reimplemented in sd::sidebar::AllMasterPagesSelector.
Definition at line 352 of file MasterPagesSelector.cxx.
References sd::sidebar::MasterPageContainerChangeEvent::CHILD_REMOVED, sd::sidebar::MasterPageContainerChangeEvent::DATA_CHANGED, Fill(), GetIndexForToken(), InvalidateItem(), sd::sidebar::MasterPageContainerChangeEvent::maChildToken, maMutex, sd::sidebar::MasterPageContainerChangeEvent::meEventType, mpContainer, mxPreviewValueSet, sd::sidebar::MasterPageContainer::NIL_TOKEN, nIndex, sd::sidebar::MasterPageContainerChangeEvent::PREVIEW_CHANGED, SetItem(), sd::sidebar::MasterPageContainerChangeEvent::SIZE_CHANGED, and UpdateAllPreviews().
Referenced by sd::sidebar::AllMasterPagesSelector::NotifyContainerChangeEvent().
|
protectedvirtual |
Reimplemented in sd::sidebar::CurrentMasterPagesSelector.
Definition at line 206 of file MasterPagesSelector.cxx.
References mpContainer, weld::Menu::set_sensitive(), and sd::sidebar::MasterPageContainer::SMALL.
Referenced by sd::sidebar::CurrentMasterPagesSelector::ProcessPopupMenu(), and ShowContextMenu().
|
private |
Definition at line 468 of file MasterPagesSelector.cxx.
References GetIndexForToken(), GetUserData(), maMutex, maTokenToValueSetIndex, nIndex, and pData.
Referenced by SetItem().
void sd::sidebar::MasterPagesSelector::SetHelpId | ( | const OUString & | aId | ) |
Definition at line 540 of file MasterPagesSelector.cxx.
References maMutex, and mxPreviewValueSet.
|
private |
Definition at line 413 of file MasterPagesSelector.cxx.
References AddTokenToIndexEntry(), Image::GetSizePixel(), maMutex, mpContainer, mxPreviewValueSet, sd::sidebar::MasterPageContainer::NIL_TOKEN, nIndex, sd::sidebar::MasterPageContainer::PS_CREATABLE, RemoveTokenToIndexEntry(), SetUserData(), VALUESET_ITEM_NOTFOUND, and Size::Width().
Referenced by NotifyContainerChangeEvent(), and UpdateItemList().
|
protected |
Definition at line 405 of file MasterPagesSelector.cxx.
References GetUserData(), maMutex, mxPreviewValueSet, nIndex, and pData.
Referenced by SetItem().
void sd::sidebar::MasterPagesSelector::ShowContextMenu | ( | const Point * | pPos | ) |
Definition at line 175 of file MasterPagesSelector.cxx.
References tools::Rectangle::Center(), Application::CreateBuilder(), ExecuteCommand(), GetContextMenuUIFile(), mxPreviewValueSet, nIndex, and ProcessPopupMenu().
void sd::sidebar::MasterPagesSelector::UpdateAllPreviews | ( | ) |
Definition at line 508 of file MasterPagesSelector.cxx.
References GetUserData(), maMutex, mpContainer, mxPreviewValueSet, nIndex, pData, and sd::sidebar::MasterPageContainer::PS_CREATABLE.
Referenced by NotifyContainerChangeEvent().
|
protected |
Definition at line 574 of file MasterPagesSelector.cxx.
References maCurrentItemList, maMutex, mxPreviewValueSet, mxSidebar, sd::sidebar::MasterPageContainer::NIL_TOKEN, nIndex, and SetItem().
Referenced by Fill().
|
protected |
Lock master pages in the given list and release locks that were previously acquired.
Definition at line 110 of file MasterPagesSelector.cxx.
References maLockedMasterPages, and mpContainer.
Referenced by Fill(), and ~MasterPagesSelector().
|
protected |
Definition at line 134 of file MasterPagesSelector.hxx.
Referenced by InvalidateItem(), and UpdateItemList().
|
protected |
Definition at line 138 of file MasterPagesSelector.hxx.
Referenced by UpdateLocks().
|
protected |
Definition at line 89 of file MasterPagesSelector.hxx.
Referenced by AddTokenToIndexEntry(), Clear(), ClearPageSet(), GetIndexForToken(), GetPreferredHeight(), GetSelectedMasterPage(), GetUserData(), InvalidateItem(), InvalidatePreview(), NotifyContainerChangeEvent(), RemoveTokenToIndexEntry(), SetHelpId(), SetItem(), SetUserData(), UpdateAllPreviews(), and UpdateItemList().
|
protected |
Definition at line 136 of file MasterPagesSelector.hxx.
Referenced by AddTokenToIndexEntry(), GetIndexForToken(), and RemoveTokenToIndexEntry().
|
protected |
Definition at line 90 of file MasterPagesSelector.hxx.
Referenced by sd::sidebar::AllMasterPagesSelector::AddItem(), ExecuteCommand(), sd::sidebar::CurrentMasterPagesSelector::Fill(), sd::sidebar::RecentMasterPagesSelector::Fill(), GetSelectedMasterPage(), InvalidatePreview(), MasterPagesSelector(), NotifyContainerChangeEvent(), ProcessPopupMenu(), SetItem(), UpdateAllPreviews(), UpdateLocks(), sd::sidebar::AllMasterPagesSelector::UpdateMasterPageList(), and ~MasterPagesSelector().
|
protected |
Definition at line 96 of file MasterPagesSelector.hxx.
Referenced by AssignMasterPageToSelectedSlides(), ExecuteCommand(), sd::sidebar::CurrentMasterPagesSelector::ProcessPopupMenu(), and sd::sidebar::CurrentMasterPagesSelector::~CurrentMasterPagesSelector().
|
protected |
Definition at line 95 of file MasterPagesSelector.hxx.
Referenced by AssignMasterPageToAllSlides(), AssignMasterPageToPageList(), sd::sidebar::CurrentMasterPagesSelector::ExecuteCommand(), sd::sidebar::CurrentMasterPagesSelector::Fill(), sd::sidebar::RecentMasterPagesSelector::Fill(), sd::sidebar::CurrentMasterPagesSelector::LateInit(), sd::sidebar::CurrentMasterPagesSelector::ProcessPopupMenu(), sd::sidebar::CurrentMasterPagesSelector::UpdateSelection(), and sd::sidebar::CurrentMasterPagesSelector::~CurrentMasterPagesSelector().
|
protected |
Definition at line 92 of file MasterPagesSelector.hxx.
Referenced by sd::sidebar::RecentMasterPagesSelector::AssignMasterPageToPageList(), ClearPageSet(), ExecuteCommand(), GetPreferredHeight(), GetSelectedMasterPage(), GetUserData(), InvalidatePreview(), MasterPagesSelector(), NotifyContainerChangeEvent(), SetHelpId(), SetItem(), SetUserData(), ShowContextMenu(), UpdateAllPreviews(), UpdateItemList(), sd::sidebar::CurrentMasterPagesSelector::UpdateSelection(), and ~MasterPagesSelector().
|
protected |
Definition at line 93 of file MasterPagesSelector.hxx.
Referenced by ~MasterPagesSelector().
|
private |
Definition at line 157 of file MasterPagesSelector.hxx.
Referenced by ExecuteCommand(), and UpdateItemList().