LibreOffice Module sd (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sd::sidebar::LayoutMenu Class Reference

#include <LayoutMenu.hxx>

Inheritance diagram for sd::sidebar::LayoutMenu:
[legend]
Collaboration diagram for sd::sidebar::LayoutMenu:
[legend]

Public Member Functions

 LayoutMenu (weld::Widget *pParent, ViewShellBase &rViewShellBase, css::uno::Reference< css::ui::XSidebar > xSidebar)
 Create a new layout menu. More...
 
virtual ~LayoutMenu () override
 
void Dispose ()
 
AutoLayout GetSelectedAutoLayout () const
 Return a numerical value representing the currently selected layout. More...
 
virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) override
 
void InvalidateContent ()
 Call this method when the set of displayed layouts is not up-to-date anymore. More...
 
void ShowContextMenu (const Point *pPos)
 The context menu is requested over this ShowContextMenu() method. More...
 
virtual void DataChanged (const DataChangedEvent &rEvent) override
 Call Fill() when switching to or from high contrast mode so that the correct set of icons is displayed. More...
 
- Public Member Functions inherited from PanelLayout
 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 ()
 

Private Member Functions

void Fill ()
 Fill the value set with the layouts that are applicable to the current main view shell. More...
 
void Clear ()
 Remove all items from the value set. More...
 
void AssignLayoutToSelectedSlides (AutoLayout aLayout)
 Assign the given layout to all selected slides of a slide sorter. More...
 
void InsertPageWithLayout (AutoLayout aLayout)
 Insert a new page with the given layout. More...
 
SfxRequest CreateRequest (sal_uInt16 nSlotId, AutoLayout aLayout)
 Create a request structure that can be used with the SID_INSERTPAGE and SID_MODIFYPAGE slots. More...
 
void UpdateSelection ()
 Select the layout that is used by the current page. More...
 
void implConstruct (DrawDocShell &rDocumentShell)
 
 DECL_LINK (ClickHandler, ValueSet *, void)
 When clicked then set the current page of the view in the center pane. More...
 
 DECL_LINK (StateChangeHandler, const OUString &, void)
 
 DECL_LINK (EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent &, void)
 
void OnMenuItemSelected (std::u16string_view ident)
 

Private Attributes

ViewShellBasemrBase
 
std::unique_ptr< LayoutValueSetmxLayoutValueSet
 
std::unique_ptr< weld::CustomWeldmxLayoutValueSetWin
 
css::uno::Reference< css::frame::XStatusListener > mxListener
 If we are asked for the preferred window size, then use this many columns for the calculation. More...
 
bool mbIsMainViewChangePending
 
css::uno::Reference< css::ui::XSidebar > mxSidebar
 
bool mbIsDisposed
 

Additional Inherited Members

- Protected Member Functions inherited from PanelLayout
virtual void DataChanged (const DataChangedEvent &rEvent)
 
virtual void DumpAsPropertyTree (tools::JsonWriter &)
 
virtual weld::WindowGetFrameWeld () const
 
- Protected Attributes inherited from PanelLayout
std::unique_ptr< weld::Builderm_xBuilder
 
std::unique_ptr< weld::Containerm_xContainer
 
sfx2::sidebar::Panelm_pPanel
 

Detailed Description

Definition at line 53 of file LayoutMenu.hxx.

Constructor & Destructor Documentation

◆ LayoutMenu()

sd::sidebar::LayoutMenu::LayoutMenu ( weld::Widget pParent,
ViewShellBase rViewShellBase,
css::uno::Reference< css::ui::XSidebar >  xSidebar 
)

Create a new layout menu.

Depending on the given flag it displays its own scroll bar or lets a surrounding window handle that.

Parameters
i_pParentthe parent node in the control tree
i_rPanelViewShellthe view shell of the task pane.

Definition at line 158 of file LayoutMenu.cxx.

References sfx2::sidebar::Theme::Color_PanelBackground, sfx2::sidebar::Theme::GetColor(), SdDrawDocument::GetDocSh(), sd::ViewShellBase::GetDocument(), implConstruct(), mrBase, mxLayoutValueSet, SAL_INFO, WB_FLATVALUESET, WB_ITEMBORDER, and WB_TABSTOP.

◆ ~LayoutMenu()

sd::sidebar::LayoutMenu::~LayoutMenu ( )
overridevirtual

Definition at line 208 of file LayoutMenu.cxx.

References Dispose(), mxLayoutValueSet, mxLayoutValueSetWin, and SAL_INFO.

Member Function Documentation

◆ AssignLayoutToSelectedSlides()

void sd::sidebar::LayoutMenu::AssignLayoutToSelectedSlides ( AutoLayout  aLayout)
private

Assign the given layout to all selected slides of a slide sorter.

The specified layout is assigned to the current page of the view shell in the center pane.

If no slide sorter is active then this call is ignored. The slide sorter in the center pane is preferred if the choice exists.

Definition at line 377 of file LayoutMenu.cxx.

References SfxRequest::AppendItem(), SfxShell::ExecuteSlot(), sd::ViewShell::GetActualPage(), sd::DrawViewShell::GetEditMode(), sd::ViewShellBase::GetMainViewShell(), sd::ViewShell::GetShellType(), SfxViewShell::GetViewFrame(), MasterPage, mrBase, sd::ViewShell::ST_IMPRESS, sd::ViewShell::ST_NOTES, and sd::ViewShell::ST_SLIDE_SORTER.

Referenced by OnMenuItemSelected().

◆ Clear()

void sd::sidebar::LayoutMenu::Clear ( )
private

Remove all items from the value set.

Definition at line 559 of file LayoutMenu.cxx.

References mxLayoutValueSet, and nId.

Referenced by Dispose(), and Fill().

◆ CreateRequest()

SfxRequest sd::sidebar::LayoutMenu::CreateRequest ( sal_uInt16  nSlotId,
AutoLayout  aLayout 
)
private

Create a request structure that can be used with the SID_INSERTPAGE and SID_MODIFYPAGE slots.

The parameters are set so that the given layout is assigned to the current page of the main view shell.

Parameters
nSlotIdSupported slots are SID_INSERTPAGE and SID_MODIFYPAGE.
aLayoutLayout of the page to insert or to assign.

Definition at line 461 of file LayoutMenu.cxx.

References SfxRequest::AppendItem(), sd::ViewShell::GetActualPage(), sd::ViewShellBase::GetDocument(), SdrModel::GetLayerAdmin(), SdrLayerAdmin::GetLayerID(), sd::ViewShellBase::GetMainViewShell(), SfxViewShell::GetViewFrame(), SdrLayerIDSet::IsSet(), mrBase, sUNO_LayerName_background, sUNO_LayerName_background_objects, and SdrPage::TRG_GetMasterPageVisibleLayers().

Referenced by InsertPageWithLayout().

◆ DataChanged()

void sd::sidebar::LayoutMenu::DataChanged ( const DataChangedEvent rEvent)
overridevirtual

Call Fill() when switching to or from high contrast mode so that the correct set of icons is displayed.

Reimplemented from PanelLayout.

Definition at line 717 of file LayoutMenu.cxx.

References sfx2::sidebar::Theme::Color_PanelBackground, PanelLayout::DataChanged(), Fill(), sfx2::sidebar::Theme::GetColor(), and mxLayoutValueSet.

◆ DECL_LINK() [1/3]

sd::sidebar::LayoutMenu::DECL_LINK ( ClickHandler  ,
ValueSet ,
void   
)
private

When clicked then set the current page of the view in the center pane.

◆ DECL_LINK() [2/3]

sd::sidebar::LayoutMenu::DECL_LINK ( EventMultiplexerListener  ,
::sd::tools::EventMultiplexerEvent ,
void   
)
private

◆ DECL_LINK() [3/3]

sd::sidebar::LayoutMenu::DECL_LINK ( StateChangeHandler  ,
const OUString &  ,
void   
)
private

◆ Dispose()

void sd::sidebar::LayoutMenu::Dispose ( )

◆ Fill()

void sd::sidebar::LayoutMenu::Fill ( )
private

◆ GetHeightForWidth()

ui::LayoutSize sd::sidebar::LayoutMenu::GetHeightForWidth ( const sal_Int32  nWidth)
overridevirtual

◆ GetSelectedAutoLayout()

AutoLayout sd::sidebar::LayoutMenu::GetSelectedAutoLayout ( ) const

Return a numerical value representing the currently selected layout.

Definition at line 234 of file LayoutMenu.cxx.

References AUTOLAYOUT_NONE, and mxLayoutValueSet.

Referenced by OnMenuItemSelected().

◆ implConstruct()

void sd::sidebar::LayoutMenu::implConstruct ( DrawDocShell rDocumentShell)
private

◆ InsertPageWithLayout()

void sd::sidebar::LayoutMenu::InsertPageWithLayout ( AutoLayout  aLayout)
private

Insert a new page with the given layout.

The page is inserted via the main view shell, i.e. its SID_INSERTPAGE slot is called. If it does not support this slot then inserting a new page does not take place. The new page is inserted after the currently active one (the one returned by ViewShell::GetActualPage().)

Definition at line 318 of file LayoutMenu.cxx.

References CreateRequest(), SfxDispatcher::Execute(), SfxRequest::GetArgs(), SfxViewFrame::GetDispatcher(), sd::ViewShellBase::GetMainViewShell(), SfxViewShell::GetViewFrame(), mrBase, and UpdateSelection().

Referenced by OnMenuItemSelected().

◆ InvalidateContent()

void sd::sidebar::LayoutMenu::InvalidateContent ( )

Call this method when the set of displayed layouts is not up-to-date anymore.

It will re-assemble this set according to the current settings.

Definition at line 342 of file LayoutMenu.cxx.

References Fill(), mxSidebar, and UpdateSelection().

Referenced by implConstruct().

◆ OnMenuItemSelected()

void sd::sidebar::LayoutMenu::OnMenuItemSelected ( std::u16string_view  ident)
private

◆ ShowContextMenu()

void sd::sidebar::LayoutMenu::ShowContextMenu ( const Point pPos)

◆ UpdateSelection()

void sd::sidebar::LayoutMenu::UpdateSelection ( )
private

Select the layout that is used by the current page.

Definition at line 634 of file LayoutMenu.cxx.

References AUTOLAYOUT_END, SdPage::GetAutoLayout(), sd::ViewShell::getCurrentPage(), sd::ViewShellBase::GetMainViewShell(), mrBase, mxLayoutValueSet, and nId.

Referenced by InsertPageWithLayout(), and InvalidateContent().

Member Data Documentation

◆ mbIsDisposed

bool sd::sidebar::LayoutMenu::mbIsDisposed
private

Definition at line 105 of file LayoutMenu.hxx.

Referenced by Dispose().

◆ mbIsMainViewChangePending

bool sd::sidebar::LayoutMenu::mbIsMainViewChangePending
private

Definition at line 103 of file LayoutMenu.hxx.

◆ mrBase

ViewShellBase& sd::sidebar::LayoutMenu::mrBase
private

◆ mxLayoutValueSet

std::unique_ptr<LayoutValueSet> sd::sidebar::LayoutMenu::mxLayoutValueSet
private

◆ mxLayoutValueSetWin

std::unique_ptr<weld::CustomWeld> sd::sidebar::LayoutMenu::mxLayoutValueSetWin
private

Definition at line 97 of file LayoutMenu.hxx.

Referenced by ~LayoutMenu().

◆ mxListener

css::uno::Reference<css::frame::XStatusListener> sd::sidebar::LayoutMenu::mxListener
private

If we are asked for the preferred window size, then use this many columns for the calculation.

Definition at line 102 of file LayoutMenu.hxx.

Referenced by Dispose(), and implConstruct().

◆ mxSidebar

css::uno::Reference<css::ui::XSidebar> sd::sidebar::LayoutMenu::mxSidebar
private

Definition at line 104 of file LayoutMenu.hxx.

Referenced by InvalidateContent().


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