33#include <bitmaps.hlst>
57#include <com/sun/star/drawing/framework/XControllerManager.hpp>
58#include <com/sun/star/drawing/framework/XView.hpp>
59#include <com/sun/star/drawing/framework/ResourceId.hpp>
68using ::sd::framework::FrameworkHelper;
74struct snew_slide_value_info
84constexpr OUStringLiteral
EMPTY =
u"";
86const snew_slide_value_info
notes[] =
88 {BMP_SLIDEN_01, STR_AUTOLAYOUT_NOTES, WritingMode_LR_TB,
95 {BMP_SLIDEH_01, STR_AUTOLAYOUT_HANDOUT1, WritingMode_LR_TB,
97 {BMP_SLIDEH_02, STR_AUTOLAYOUT_HANDOUT2, WritingMode_LR_TB,
99 {BMP_SLIDEH_03, STR_AUTOLAYOUT_HANDOUT3, WritingMode_LR_TB,
101 {BMP_SLIDEH_04, STR_AUTOLAYOUT_HANDOUT4, WritingMode_LR_TB,
103 {BMP_SLIDEH_06, STR_AUTOLAYOUT_HANDOUT6, WritingMode_LR_TB,
105 {BMP_SLIDEH_09, STR_AUTOLAYOUT_HANDOUT9, WritingMode_LR_TB,
112 {BMP_LAYOUT_EMPTY, STR_AUTOLAYOUT_NONE, WritingMode_LR_TB,
AUTOLAYOUT_NONE},
113 {BMP_LAYOUT_HEAD03, STR_AUTOLAYOUT_TITLE, WritingMode_LR_TB,
AUTOLAYOUT_TITLE},
153 virtual void Resize()
override;
161 css::uno::Reference<css::ui::XSidebar> xSidebar)
162 :
PanelLayout( pParent,
"LayoutPanel",
"modules/simpress/ui/layoutpanel.ui" ),
163 mrBase(rViewShellBase),
165 mxLayoutValueSetWin(new
weld::CustomWeld(*m_xBuilder,
"layoutvalueset", *mxLayoutValueSet)),
166 mbIsMainViewChangePending(false),
167 mxSidebar(
std::move(xSidebar)),
171 SAL_INFO(
"sd.ui",
"created LayoutMenu at " <<
this);
181 "LayoutMenu::implConstruct: hmm?" );
183 (void) rDocumentShell;
202 mxListener = new ::sd::tools::SlotStateListener(
205 ".uno:VerticalTextState");
210 SAL_INFO(
"sd.ui",
"destroying LayoutMenu at " <<
this);
221 SAL_INFO(
"sd.ui",
"disposing LayoutMenu at " <<
this);
225 Reference<lang::XComponent> xComponent (
mxListener, UNO_QUERY);
227 xComponent->dispose();
241 if (pLayout !=
nullptr)
250 sal_Int32 nPreferredHeight = 200;
255 if (nWidth>0 && aItemSize.
Width()>0)
259 int nColumnCount = nWidth / aItemSize.
Width();
260 if (nColumnCount <= 0)
262 else if (nColumnCount > 4)
264 int nRowCount = (
mxLayoutValueSet->GetItemCount() + nColumnCount-1) / nColumnCount;
265 nPreferredHeight = nRowCount * aItemSize.
Height();
268 return ui::LayoutSize(nPreferredHeight,nPreferredHeight,nPreferredHeight);
273 Size aWindowSize = GetOutputSizePixel();
274 if (IsVisible() && aWindowSize.
Width() > 0)
284 int nColumnCount = aWindowSize.
Width() / aItemSize.
Width();
285 if (nColumnCount < 1)
287 else if (nColumnCount > 4)
302 if (rEvent.
GetCommand() != CommandEventId::ContextMenu)
321 if (pViewShell ==
nullptr)
326 if (pDispatcher ==
nullptr)
332 if (aRequest.
GetArgs() !=
nullptr)
336 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
361 nRowCount = (
GetItemCount() + nColumnCount - 1) / nColumnCount;
371 AssignLayoutToSelectedSlides( GetSelectedAutoLayout() );
386 if (pMainViewShell ==
nullptr)
392 bool bMasterPageMode (
false);
400 bMasterPageMode =
true;
418 SlideSorterViewShell* pSlideSorter =
nullptr;
424 pSlideSorter = SlideSorterViewShell::GetSlideSorter(
mrBase);
429 if (pSlideSorter !=
nullptr)
432 pPageSelection = pSlideSorter->GetPageSelection();
435 if( (pSlideSorter ==
nullptr) || !pPageSelection || pPageSelection->empty() )
439 pPageSelection = std::make_shared<::sd::slidesorter::SlideSorterViewShell::PageSelection>();
443 if (pPageSelection->empty())
446 for (
const auto& rpPage : *pPageSelection)
448 if (rpPage ==
nullptr)
473 if (pViewShell ==
nullptr)
476 if (pPage ==
nullptr)
489 aVisibleLayers.
IsSet(aBackgroundObject)));
500 bool bRightToLeft = (pDocument!=
nullptr
504 OUString sCenterPaneViewName;
509 Reference<XResourceId> xPaneId (ResourceId::create(
510 ::comphelper::getProcessComponentContext(),
511 FrameworkHelper::msCenterPaneURL));
512 Reference<XView> xView (FrameworkHelper::Instance(
mrBase)->GetView(xPaneId));
514 sCenterPaneViewName = xView->getResourceId()->getResourceURL();
520 const snew_slide_value_info* pInfo =
nullptr;
540 for (sal_uInt16
i=1; pInfo!=
nullptr && pInfo->mpStrResId;
i++, pInfo++)
542 if ((WritingMode_TB_RL != pInfo->meWritingMode) || bVertical)
544 Image aImg(
"private:graphicrepository/" +
static_cast<const OUString &
>(pInfo->msBmpResId));
546 if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode))
549 aRTL.
Mirror(BmpMirrorFlags::Horizontal);
568 if (
SD_MOD()->GetWaterCan())
579 aMenuPosition = *pPos;
586 aMenuPosition = aBBox.
Center();
593 std::unique_ptr<weld::Menu> xMenu(xBuilder->weld_menu(
"menu"));
600 if (aState == SfxItemState::DISABLED)
601 xMenu->set_sensitive(
"insert",
false);
617 if (ident ==
u"apply")
621 else if (ident ==
u"insert")
636 bool bItemSelected =
false;
642 if (pViewShell ==
nullptr)
646 if (pCurrentPage ==
nullptr)
656 for (sal_uInt16
nId=1;
nId<=nItemCount;
nId++)
667 bItemSelected =
true;
680 switch (rEvent.meEventId)
697 mbIsMainViewChangePending =
true;
701 mxLayoutValueSet->Invalidate();
705 if (mbIsMainViewChangePending)
707 mbIsMainViewChangePending =
false;
@ ShapeRemoved
A shape has been removed from a page.
@ SlideSortedSelection
The selection in the slide sorter has changed, regardless of whether the slide sorter is displayed in...
@ MainViewRemoved
The current MainViewShell (the ViewShell displayed in the center pane) has been removed.
@ ShapeChanged
The state of a shape has changed.
@ MainViewAdded
A new ViewShell has been made the MainViewShell.
@ ConfigurationUpdated
A configuration update has been completed.
@ CurrentPageChanged
The current page has changed.
@ ShapeInserted
A shape has been inserted to a page.
AUTOLAYOUT_TITLE_2CONTENT_OVER_CONTENT
AUTOLAYOUT_TITLE_CONTENT_OVER_CONTENT
AUTOLAYOUT_VTITLE_VCONTENT_OVER_VCONTENT
AUTOLAYOUT_VTITLE_VCONTENT
AUTOLAYOUT_TITLE_2CONTENT
AUTOLAYOUT_TITLE_6CONTENT
AUTOLAYOUT_TITLE_2CONTENT_CONTENT
AUTOLAYOUT_TITLE_CONTENT_2CONTENT
AUTOLAYOUT_TITLE_VCONTENT
AUTOLAYOUT_TITLE_4CONTENT
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
bool Mirror(BmpMirrorFlags nMirrorFlags)
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
bool IsMouseEvent() const
BitmapEx GetBitmapEx() const
Size GetSizePixel() const
virtual void DataChanged(const DataChangedEvent &rEvent)
css::text::WritingMode GetDefaultWritingMode() const
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
AutoLayout GetAutoLayout() const
SdrLayerID GetLayerID(const OUString &rName) const
bool IsSet(SdrLayerID a) const
const SdrLayerAdmin & GetLayerAdmin() const
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
const SfxItemSet * GetArgs() const
void AppendItem(const SfxPoolItem &)
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
SfxDispatcher * GetDispatcher()
css::uno::Reference< css::frame::XController > GetController() const
SfxViewFrame & GetViewFrame() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
size_t GetItemCount() const
void SelectItem(sal_uInt16 nItemId)
Size CalcItemSizePixel(const Size &rSize) const
void SetLineCount(sal_uInt16 nNewLines=0)
void SetColCount(sal_uInt16 nNewCols=1)
virtual void Resize() override
sal_uInt16 GetItemId(size_t nPos) const
Image GetItemImage(sal_uInt16 nItemId) const
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
EditMode GetEditMode() const
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
DrawController * GetDrawController() const
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
std::shared_ptr< tools::EventMultiplexer > const & GetEventMultiplexer() const
Return an event multiplexer.
SdDrawDocument * GetDocument() const
Base class of the stacked shell hierarchy.
virtual SdPage * getCurrentPage() const =0
virtual SdPage * GetActualPage()=0
SD_DLLPUBLIC ShellType GetShellType() const
Return the type of the shell.
static const OUString msHandoutViewURL
static const OUString msNotesViewURL
static const OUString msSlideSorterURL
static const OUString msImpressViewURL
constexpr OUStringLiteral HID_SD_TASK_PANE_PREVIEW_LAYOUTS
#define LINK(Instance, Class, Member)
#define SAL_INFO(area, stream)
bool IsVerticalTextEnabled()
std::shared_ptr< SlideSorterViewShell::PageSelection > SharedPageSelection
OUString SdResId(TranslateId aId)
constexpr OUStringLiteral sUNO_LayerName_background_objects
constexpr OUStringLiteral sUNO_LayerName_background
#define WB_MENUSTYLEVALUESET
#define WB_NO_DIRECTSELECT