LibreOffice Module sw (master) 1
HeaderFooterWin.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#include <strings.hrc>
11
12#include <doc.hxx>
13#include <drawdoc.hxx>
14#include <cmdid.h>
15#include <DashedLine.hxx>
16#include <docsh.hxx>
17#include <edtwin.hxx>
18#include <fmthdft.hxx>
19#include <HeaderFooterWin.hxx>
20#include <pagedesc.hxx>
21#include <pagefrm.hxx>
22#include <view.hxx>
23#include <viewopt.hxx>
24#include <wrtsh.hxx>
26
40#include <editeng/boxitem.hxx>
41#include <svx/hdft.hxx>
42#include <sfx2/bindings.hxx>
43#include <sfx2/viewfrm.hxx>
46#include <vcl/canvastools.hxx>
47#include <vcl/metric.hxx>
48#include <vcl/svapp.hxx>
49#include <vcl/settings.hxx>
50#include <vcl/virdev.hxx>
51#include <memory>
52
53#define TEXT_PADDING 5
54#define BOX_DISTANCE 10
55#define BUTTON_WIDTH 18
56
57using namespace basegfx;
58using namespace basegfx::utils;
59using namespace drawinglayer::attribute;
60
61namespace
62{
64 {
65 basegfx::BColor aHslLine = basegfx::utils::rgb2hsl(rLineColor);
66 double nLuminance = aHslLine.getZ() * 2.5;
67 if ( nLuminance == 0 )
68 nLuminance = 0.5;
69 else if ( nLuminance >= 1.0 )
70 nLuminance = aHslLine.getZ() * 0.4;
71 aHslLine.setZ( nLuminance );
72 return basegfx::utils::hsl2rgb( aHslLine );
73 }
74
75 basegfx::BColor lcl_GetLighterGradientColor(const basegfx::BColor& rDarkColor)
76 {
77 basegfx::BColor aHslDark = basegfx::utils::rgb2hsl(rDarkColor);
78 double nLuminance = aHslDark.getZ() * 255 + 20;
79 aHslDark.setZ( nLuminance / 255.0 );
80 return basegfx::utils::hsl2rgb( aHslDark );
81 }
82
83 B2DPolygon lcl_GetPolygon( const ::tools::Rectangle& rRect, bool bOnTop )
84 {
85 const double nRadius = 3;
86 const double nKappa((M_SQRT2 - 1.0) * 4.0 / 3.0);
87
88 B2DPolygon aPolygon;
89 aPolygon.append( B2DPoint( rRect.Left(), rRect.Top() ) );
90
91 {
92 B2DPoint aCorner( rRect.Left(), rRect.Bottom() );
93 B2DPoint aStart( rRect.Left(), rRect.Bottom() - nRadius );
94 B2DPoint aEnd( rRect.Left() + nRadius, rRect.Bottom() );
95 aPolygon.append( aStart );
96 aPolygon.appendBezierSegment(
97 interpolate( aStart, aCorner, nKappa ),
98 interpolate( aEnd, aCorner, nKappa ),
99 aEnd );
100 }
101
102 {
103 B2DPoint aCorner( rRect.Right(), rRect.Bottom() );
104 B2DPoint aStart( rRect.Right() - nRadius, rRect.Bottom() );
105 B2DPoint aEnd( rRect.Right(), rRect.Bottom() - nRadius );
106 aPolygon.append( aStart );
107 aPolygon.appendBezierSegment(
108 interpolate( aStart, aCorner, nKappa ),
109 interpolate( aEnd, aCorner, nKappa ),
110 aEnd );
111 }
112
113 aPolygon.append( B2DPoint( rRect.Right(), rRect.Top() ) );
114
115 if ( !bOnTop )
116 {
119 aBRect.getCenterX(), aBRect.getCenterY(), M_PI );
120 aPolygon.transform( aRotation );
121 }
122
123 return aPolygon;
124 }
125}
126
128 const tools::Rectangle& rRect, bool bOnTop)
129{
130 rSeq.clear();
131 B2DPolygon aPolygon = lcl_GetPolygon(rRect, bOnTop);
132
133 // Colors
135 basegfx::BColor aFillColor = lcl_GetFillColor(aLineColor);
136 basegfx::BColor aLighterColor = lcl_GetLighterGradientColor(aFillColor);
137
139 if (rSettings.GetHighContrastMode())
140 {
141 aFillColor = rSettings.GetDialogColor().getBColor();
142 aLineColor = rSettings.GetDialogTextColor().getBColor();
143
146 }
147 else
148 {
150 double nAngle = M_PI;
151 if (bOnTop)
152 nAngle = 0;
153 FillGradientAttribute aFillAttrs(drawinglayer::attribute::GradientStyle::Linear, 0.0, 0.0, 0.0, nAngle, aLighterColor, aFillColor);
155 new drawinglayer::primitive2d::FillGradientPrimitive2D(aGradientRect, std::move(aFillAttrs))));
156 }
157
158 // Create the border lines primitive
160 new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(std::move(aPolygon), aLineColor)));
161}
162
164 : SwDashedLine(pEditWin, &SwViewOption::GetHeaderFooterMarkColor)
165 , m_pEditWin(pEditWin)
166 , m_pFrame(pFrame)
167 , m_bIsHeader(bHeader)
168{
169}
170
172{
174 tools::Rectangle aVisArea = GetEditWin()->LogicToPixel(GetEditWin()->GetView().GetVisArea());
175 return aBounds.Overlaps(aVisArea);
176}
177
179{
180 if (!m_pWin)
181 {
183 m_pWin->SetZOrder(this, ZOrderFlags::Before);
184 }
185}
186
188{
189 Show(bShow);
190 if (!m_pWin && IsOnScreen())
191 EnsureWin();
192 if (m_pWin)
193 m_pWin->ShowAll(bShow);
194}
195
197{
198 ShowAll(!bReadonly);
199}
200
201bool SwHeaderFooterDashedLine::Contains(const Point &rDocPt) const
202{
203 if (m_pWin && m_pWin->Contains(rDocPt))
204 return true;
205
207 return aLineRect.Contains(rDocPt);
208}
209
210void SwHeaderFooterDashedLine::SetOffset(Point aOffset, tools::Long nXLineStart, tools::Long nXLineEnd)
211{
212 Point aLinePos(nXLineStart, aOffset.Y());
213 Size aLineSize(nXLineEnd - nXLineStart, 1);
214 SetPosSizePixel(aLinePos, aLineSize);
215
216 bool bOnScreen = IsOnScreen();
217 if (!m_pWin && bOnScreen)
218 {
219 EnsureWin();
220 m_pWin->ShowAll(true);
221 }
222 else if (m_pWin && !bOnScreen)
224
225 if (m_pWin)
226 m_pWin->SetOffset(aOffset);
227}
228
229SwHeaderFooterWin::SwHeaderFooterWin(SwEditWin* pEditWin, const SwFrame *pFrame, bool bHeader ) :
230 InterimItemWindow(pEditWin, "modules/swriter/ui/hfmenubutton.ui", "HFMenuButton"),
231 m_xMenuButton(m_xBuilder->weld_menu_button("menubutton")),
232 m_xPushButton(m_xBuilder->weld_button("button")),
233 m_pEditWin(pEditWin),
234 m_pFrame(pFrame),
235 m_bIsHeader( bHeader ),
236 m_bIsAppearing( false ),
237 m_nFadeRate( 100 ),
238 m_aFadeTimer("SwHeaderFooterWin m_aFadeTimer")
239{
240 m_xVirDev = m_xMenuButton->create_virtual_device();
242
243 m_xPushButton->connect_clicked(LINK(this, SwHeaderFooterWin, ClickHdl));
244 m_xMenuButton->connect_selected(LINK(this, SwHeaderFooterWin, SelectHdl));
245
246 // set the PopupMenu
247 // Rewrite the menu entries' text
248 if (m_bIsHeader)
249 {
250 m_xMenuButton->set_item_label("edit", SwResId(STR_FORMAT_HEADER));
251 m_xMenuButton->set_item_label("delete", SwResId(STR_DELETE_HEADER));
252 }
253 else
254 {
255 m_xMenuButton->set_item_label("edit", SwResId(STR_FORMAT_FOOTER));
256 m_xMenuButton->set_item_label("delete", SwResId(STR_DELETE_FOOTER));
257 }
258
261}
262
264{
265 disposeOnce();
266}
267
269{
270 m_xPushButton.reset();
271 m_xMenuButton.reset();
275}
276
278{
279 // Compute the text to show
281 const SwPageDesc* pDesc = pPageFrame->GetPageDesc();
282 bool bIsFirst = !pDesc->IsFirstShared() && pPageFrame->OnFirstPage();
283 bool bIsLeft = !pDesc->IsHeaderShared() && !pPageFrame->OnRightPage();
284 bool bIsRight = !pDesc->IsHeaderShared() && pPageFrame->OnRightPage();
285 m_sLabel = SwResId(STR_HEADER_TITLE);
286 if (!m_bIsHeader)
287 m_sLabel = bIsFirst ? SwResId(STR_FIRST_FOOTER_TITLE)
288 : bIsLeft ? SwResId(STR_LEFT_FOOTER_TITLE)
289 : bIsRight ? SwResId(STR_RIGHT_FOOTER_TITLE)
290 : SwResId(STR_FOOTER_TITLE );
291 else
292 m_sLabel = bIsFirst ? SwResId(STR_FIRST_HEADER_TITLE)
293 : bIsLeft ? SwResId(STR_LEFT_HEADER_TITLE)
294 : bIsRight ? SwResId(STR_RIGHT_HEADER_TITLE)
295 : SwResId(STR_HEADER_TITLE);
296
297 sal_Int32 nPos = m_sLabel.lastIndexOf("%1");
298 m_sLabel = m_sLabel.replaceAt(nPos, 2, pDesc->GetName());
299 m_xMenuButton->set_accessible_name(m_sLabel);
300
301 // Compute the text size and get the box position & size from it
302 ::tools::Rectangle aTextRect;
303 m_xVirDev->GetTextBoundRect(aTextRect, m_sLabel);
304 ::tools::Rectangle aTextPxRect = m_xVirDev->LogicToPixel(aTextRect);
305 FontMetric aFontMetric = m_xVirDev->GetFontMetric(m_xVirDev->GetFont());
306 Size aBoxSize (aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2,
307 aFontMetric.GetLineHeight() + TEXT_PADDING * 2 );
308
309 tools::Long nYFooterOff = 0;
310 if (!m_bIsHeader)
311 nYFooterOff = aBoxSize.Height();
312
313 Point aBoxPos(aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
314 aOffset.Y() - nYFooterOff);
315
317 {
318 aBoxPos.setX( aOffset.X() + BOX_DISTANCE );
319 }
320
321 // Set the position & Size of the window
322 SetPosSizePixel(aBoxPos, aBoxSize);
323
324 m_xVirDev->SetOutputSizePixel(aBoxSize);
325 PaintButton();
326}
327
329{
330 bool bIsEmptyHeaderFooter = IsEmptyHeaderFooter();
331 m_xMenuButton->set_visible(!bIsEmptyHeaderFooter);
332 m_xPushButton->set_visible(bIsEmptyHeaderFooter);
333
334 m_bIsAppearing = bShow;
335
339}
340
341bool SwHeaderFooterWin::Contains( const Point &rDocPt ) const
342{
344 return aRect.Contains(rDocPt);
345}
346
348{
349 if (!m_xVirDev)
350 return;
351
352 // Use pixels for the rest of the drawing
353 SetMapMode(MapMode(MapUnit::MapPixel));
355 const ::tools::Rectangle aRect(::tools::Rectangle(Point(0, 0), m_xVirDev->PixelToLogic(GetSizePixel())));
356
358
359 // Create the text primitive
361 B2DVector aFontSize;
362 FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(aFontSize, m_xVirDev->GetFont(), false, false);
363
364 FontMetric aFontMetric = m_xVirDev->GetFontMetric(m_xVirDev->GetFont());
365 double nTextOffsetY = aFontMetric.GetAscent() + TEXT_PADDING;
366 Point aTextPos(TEXT_PADDING, nTextOffsetY);
367
369 aFontSize.getX(), aFontSize.getY(),
370 double(aTextPos.X()), double(aTextPos.Y())));
371
374 aTextMatrix, m_sLabel, 0, m_sLabel.getLength(),
375 std::vector<double>(), {}, std::move(aFontAttr), css::lang::Locale(), aLineColor)));
376
377 // Create the 'plus' or 'arrow' primitive
378 B2DRectangle aSignArea(B2DPoint(aRect.Right() - BUTTON_WIDTH, 0.0),
379 B2DVector(aRect.Right(), aRect.getOpenHeight()));
380
381 B2DPolygon aSign;
382 bool bIsEmptyHeaderFooter = IsEmptyHeaderFooter();
383 if (bIsEmptyHeaderFooter)
384 {
385 // Create the + polygon
386 double nLeft = aSignArea.getMinX() + TEXT_PADDING;
387 double nRight = aSignArea.getMaxX() - TEXT_PADDING;
388 double nHalfW = ( nRight - nLeft ) / 2.0;
389
390 double nTop = aSignArea.getCenterY() - nHalfW;
391 double nBottom = aSignArea.getCenterY() + nHalfW;
392
393 aSign.append(B2DPoint(nLeft, aSignArea.getCenterY() - 1.0));
394 aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() - 1.0));
395 aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, nTop));
396 aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, nTop));
397 aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() - 1.0));
398 aSign.append(B2DPoint(nRight, aSignArea.getCenterY() - 1.0));
399 aSign.append(B2DPoint(nRight, aSignArea.getCenterY() + 1.0));
400 aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() + 1.0));
401 aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, nBottom));
402 aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, nBottom));
403 aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() + 1.0));
404 aSign.append(B2DPoint(nLeft, aSignArea.getCenterY() + 1.0));
405 aSign.setClosed(true);
406 }
407 else
408 {
409 // Create the v polygon
410 B2DPoint aLeft(aSignArea.getMinX() + TEXT_PADDING, aSignArea.getCenterY());
411 B2DPoint aRight(aSignArea.getMaxX() - TEXT_PADDING, aSignArea.getCenterY());
412 B2DPoint aBottom((aLeft.getX() + aRight.getX()) / 2.0, aLeft.getY() + 4.0);
413 aSign.append(aLeft);
414 aSign.append(aRight);
415 aSign.append(aBottom);
416 aSign.setClosed(true);
417 }
418
419 BColor aSignColor = COL_BLACK.getBColor();
420 if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
421 aSignColor = COL_WHITE.getBColor();
422
425 B2DPolyPolygon(aSign), aSignColor)) );
426
427 // Create the processor and process the primitives
429 std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
431
432 // TODO Ghost it all if needed
434 double nFadeRate = double(m_nFadeRate) / 100.0;
435
436 const basegfx::BColorModifierSharedPtr aBColorModifier =
437 std::make_shared<basegfx::BColorModifier_interpolate>(COL_WHITE.getBColor(),
438 1.0 - nFadeRate);
439
441 new drawinglayer::primitive2d::ModifiedColorPrimitive2D(std::move(aSeq), aBColorModifier));
442
443 pProcessor->process(aGhostedSeq);
444
445 if (bIsEmptyHeaderFooter)
446 m_xPushButton->set_custom_button(m_xVirDev.get());
447 else
448 m_xMenuButton->set_custom_button(m_xVirDev.get());
449}
450
452{
453 bool bResult = true;
454
456 if (!pPageFrame)
457 {
458 return bResult;
459 }
460
461 // Actually check it
462 const SwPageDesc* pDesc = pPageFrame->GetPageDesc();
463
464 bool const bFirst(pPageFrame->OnFirstPage());
465 const SwFrameFormat *const pFormat = (pPageFrame->OnRightPage())
466 ? pDesc->GetRightFormat(bFirst)
467 : pDesc->GetLeftFormat(bFirst);
468
469 if ( pFormat )
470 {
471 if ( m_bIsHeader )
472 bResult = !pFormat->GetHeader().IsActive();
473 else
474 bResult = !pFormat->GetFooter().IsActive();
475 }
476
477 return bResult;
478}
479
480void SwHeaderFooterWin::ExecuteCommand(std::string_view rIdent)
481{
482 SwView& rView = m_pEditWin->GetView();
483 SwWrtShell& rSh = rView.GetWrtShell();
484
486 const OUString& rStyleName = pPageFrame->GetPageDesc()->GetName();
487 if (rIdent == "edit")
488 {
489 OString sPageId = m_bIsHeader ? OString("header") : OString("footer");
490 rView.GetDocShell()->FormatPage(rView.GetFrameWeld(), rStyleName, sPageId, rSh);
491 }
492 else if (rIdent == "borderback")
493 {
494 const SwPageDesc* pDesc = pPageFrame->GetPageDesc();
495 const SwFrameFormat& rMaster = pDesc->GetMaster();
496 SwFrameFormat* pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetFooter().GetFooterFormat() );
497 if ( m_bIsHeader )
498 pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetHeader().GetHeaderFormat() );
499 SfxItemSet aSet( pHFFormat->GetAttrSet() );
500
501 // Items to hand over XPropertyList things like XColorList,
502 // XHatchList, XGradientList, and XBitmapList to the Area TabPage:
503 aSet.MergeRange( SID_COLOR_TABLE, SID_PATTERN_LIST );
504 // create needed items for XPropertyList entries from the DrawModel so that
505 // the Area TabPage can access them
507
508 aSet.MergeRange(SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER);
509 // Create a box info item... needed by the dialog
510 std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
511 if (const SvxBoxInfoItem *pBoxInfo = pHFFormat->GetAttrSet().GetItemIfSet(SID_ATTR_BORDER_INNER))
512 aBoxInfo.reset(pBoxInfo->Clone());
513
514 aBoxInfo->SetTable(false);
515 aBoxInfo->SetDist(true);
516 aBoxInfo->SetMinDist(false);
517 aBoxInfo->SetDefDist(MIN_BORDER_DIST);
518 aBoxInfo->SetValid(SvxBoxInfoItemValidFlags::DISABLE);
519 aSet.Put(*aBoxInfo);
520
522 {
523 pHFFormat->SetFormatAttr( aSet );
524 rView.GetDocShell()->SetModified();
525 }
526 }
527 else if (rIdent == "delete")
528 {
529 rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, false, true );
530 // warning: "this" may be disposed now
532 }
533 else if (rIdent == "insert_pagenumber")
534 {
535 SfxViewFrame* pVFrame = rSh.GetView().GetViewFrame();
537 }
538 else if (rIdent == "insert_pagecount")
539 {
540 SfxViewFrame* pVFrame = rSh.GetView().GetViewFrame();
542 }
543}
544
546{
547 SwView& rView = m_pEditWin->GetView();
548 SwWrtShell& rSh = rView.GetWrtShell();
549
550 const SwPageFrame* pPageFrame = SwFrameMenuButtonBase::GetPageFrame(m_pFrame);
551 const OUString& rStyleName = pPageFrame->GetPageDesc()->GetName();
552 rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
553
554 m_xPushButton->hide();
555 m_xMenuButton->show();
556 PaintButton();
557}
558
559IMPL_LINK(SwHeaderFooterWin, SelectHdl, const OString&, rIdent, void)
560{
561 ExecuteCommand(rIdent);
562}
563
565{
566 if (m_bIsAppearing && m_nFadeRate > 0)
567 m_nFadeRate -= 25;
568 else if (!m_bIsAppearing && m_nFadeRate < 100)
569 m_nFadeRate += 25;
570
571 if (m_nFadeRate != 100 && !IsVisible())
572 {
573 Show();
574 }
575 else if (m_nFadeRate == 100 && IsVisible())
576 {
577 Show(false);
578 }
579 else
580 PaintButton();
581
582 if (IsVisible() && m_nFadeRate > 0 && m_nFadeRate < 100)
583 m_aFadeTimer.Start();
584}
585
586/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static basegfx::BColor lcl_GetFillColor(const basegfx::BColor &rLineColor, double aLuminance)
#define BOX_DISTANCE
IMPL_LINK(SwHeaderFooterWin, SelectHdl, const OString &, rIdent, void)
IMPL_LINK_NOARG(SwHeaderFooterWin, ClickHdl, weld::Button &, void)
#define TEXT_PADDING
#define BUTTON_WIDTH
const StyleSettings & GetStyleSettings() const
static bool GetLayoutRTL()
static const AllSettings & GetSettings()
basegfx::BColor getBColor() const
tools::Long GetLineHeight() const
tools::Long GetAscent() const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual void dispose() override
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void MergeRange(sal_uInt16 nFrom, sal_uInt16 nTo)
SfxBindings & GetBindings()
weld::Window * GetFrameWeld() const
SfxViewFrame * GetViewFrame() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetDialogTextColor() const
bool GetHighContrastMode() const
const Color & GetDialogColor() const
Class for displaying a dashed line in the Writer GUI.
Definition: DashedLine.hxx:17
virtual void SetModified(bool=true) override
Definition: docsh2.cxx:1429
void FormatPage(weld::Window *pDialogParent, const OUString &rPage, const OString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
Definition: docst.cxx:1633
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:161
void PutAreaListItems(SfxItemSet &rSet) const
Put needed items for XPropertyList entries from the DrawModel.
Definition: drawdoc.cxx:151
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:61
bool IsActive() const
Definition: fmthdft.hxx:89
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
bool IsActive() const
Definition: fmthdft.hxx:58
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
static void PaintButton(drawinglayer::primitive2d::Primitive2DContainer &rSeq, const tools::Rectangle &rRect, bool bOnTop)
Style of a layout element.
Definition: frmfmt.hxx:62
const SwPageFrame * GetPageFrame() const
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool OnRightPage() const
Definition: frame.hxx:733
bool OnFirstPage() const
Definition: trvlfrm.cxx:1779
virtual void ShowAll(bool bShow) override
SwHeaderFooterDashedLine(SwEditWin *pEditWin, const SwFrame *pFrame, bool bIsHeader)
virtual void SetReadonly(bool bReadonly) override
virtual SwEditWin * GetEditWin() override
void SetOffset(Point aOffset, tools::Long nXLineStart, tools::Long nXLineEnd)
VclPtr< SwEditWin > m_pEditWin
VclPtr< SwHeaderFooterWin > m_pWin
virtual bool Contains(const Point &rDocPt) const override
Returns true if the point is inside the control.
void ShowAll(bool bShow)
void SetOffset(Point aOffset)
virtual ~SwHeaderFooterWin() override
VclPtr< VirtualDevice > m_xVirDev
std::unique_ptr< weld::MenuButton > m_xMenuButton
bool IsEmptyHeaderFooter() const
const SwFrame * m_pFrame
virtual void dispose() override
SwHeaderFooterWin(SwEditWin *pEditWin, const SwFrame *pFrame, bool bHeader)
bool Contains(const Point &rDocPt) const
void ExecuteCommand(std::string_view rIdent)
std::unique_ptr< weld::Button > m_xPushButton
VclPtr< SwEditWin > m_pEditWin
const OUString & GetName() const
Definition: pagedesc.hxx:196
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
bool IsHeaderShared() const
Definition: pagedesc.hxx:319
bool IsFirstShared() const
Definition: pagedesc.cxx:396
SwFrameFormat * GetRightFormat(bool const bFirst=false)
Layout uses the following methods to obtain a format in order to be able to create a page.
Definition: pagedesc.cxx:389
SwFrameFormat * GetLeftFormat(bool const bFirst=false)
Definition: pagedesc.cxx:382
A page of the document layout.
Definition: pagefrm.hxx:58
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:143
static Color & GetHeaderFooterMarkColor()
Definition: viewopt.cxx:459
vcl::Window * GetWin() const
Definition: viewsh.hxx:346
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
Definition: view.hxx:146
SwWrtShell & GetWrtShell() const
Definition: view.hxx:416
SwDocShell * GetDocShell()
Definition: view.cxx:1160
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
void ChangeHeaderOrFooter(std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning)
Definition: wrtsh1.cxx:2124
const SwView & GetView() const
Definition: wrtsh.hxx:438
bool IsActive() const
void Stop()
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
void disposeAndClear()
void clear()
reference_type * get() const
static VclPtr< reference_type > Create(Arg &&... arg)
void transform(const basegfx::B2DHomMatrix &rMatrix)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
void appendBezierSegment(const basegfx::B2DPoint &rNextControlPoint, const basegfx::B2DPoint &rPrevControlPoint, const basegfx::B2DPoint &rPoint)
TYPE getMaxX() const
TYPE getMinX() const
double getCenterX() const
double getCenterY() const
TYPE getX() const
TYPE getY() const
TYPE getZ() const
void setZ(TYPE fZ)
constexpr tools::Long GetWidth() const
bool Contains(const Point &rPOINT) const
bool Overlaps(const tools::Rectangle &rRect) const
Point LogicToPixel(const Point &rLogicPt) const
virtual Point GetPosPixel() const
void SetMapMode()
void GrabFocusToDocument()
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual Size GetSizePixel() const
weld::Window * GetFrameWeld() const
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
#define FN_INSERT_FLD_PGNUMBER
Definition: cmdid.h:272
#define FN_INSERT_FLD_PGCOUNT
Definition: cmdid.h:273
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
B2DHomMatrix createRotateAroundPoint(double fPointX, double fPointY, double fRadiant)
BColor rgb2hsl(const BColor &rRGBColor)
BColor hsl2rgb(const BColor &rHSLColor)
class SAL_WARN_UNUSED UNLESS_MERGELIBS(BASEGFX_DLLPUBLIC) BColorModifier_black_and_white final class SAL_WARN_UNUSED UNLESS_MERGELIBS(BASEGFX_DLLPUBLIC) BColorModifier_gamma final class SAL_WARN_UNUSED UNLESS_MERGELIBS(BASEGFX_DLLPUBLIC) BColorModifier_RGBLuminanceContrast final typedef std::shared_ptr< BColorModifier > BColorModifierSharedPtr
rtl::Reference< BasePrimitive2D > Primitive2DReference
attribute::FontAttribute getFontAttributeFromVclFont(basegfx::B2DVector &o_rSize, const vcl::Font &rFont, bool bRTL, bool bBiDiStrong)
std::unique_ptr< BaseProcessor2D > createProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
HSLColor interpolate(const HSLColor &rFrom, const HSLColor &rTo, double t, bool bCCW)
bool ShowBorderBackgroundDlg(weld::Window *pParent, SfxItemSet *pBBSet)
long Long
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
constexpr SwTwips MIN_BORDER_DIST
Definition: swtypes.hxx:70