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/menu.hxx>
48 #include <vcl/metric.hxx>
49 #include <vcl/svapp.hxx>
50 #include <vcl/settings.hxx>
51 #include <vcl/virdev.hxx>
52 #include <memory>
53 
54 #define TEXT_PADDING 5
55 #define BOX_DISTANCE 10
56 #define BUTTON_WIDTH 18
57 
58 using namespace basegfx;
59 using namespace basegfx::utils;
60 using namespace drawinglayer::attribute;
61 
62 namespace
63 {
65  {
66  basegfx::BColor aHslLine = basegfx::utils::rgb2hsl(rLineColor);
67  double nLuminance = aHslLine.getZ() * 2.5;
68  if ( nLuminance == 0 )
69  nLuminance = 0.5;
70  else if ( nLuminance >= 1.0 )
71  nLuminance = aHslLine.getZ() * 0.4;
72  aHslLine.setZ( nLuminance );
73  return basegfx::utils::hsl2rgb( aHslLine );
74  }
75 
76  basegfx::BColor lcl_GetLighterGradientColor(const basegfx::BColor& rDarkColor)
77  {
78  basegfx::BColor aHslDark = basegfx::utils::rgb2hsl(rDarkColor);
79  double nLuminance = aHslDark.getZ() * 255 + 20;
80  aHslDark.setZ( nLuminance / 255.0 );
81  return basegfx::utils::hsl2rgb( aHslDark );
82  }
83 
84  B2DPolygon lcl_GetPolygon( const ::tools::Rectangle& rRect, bool bOnTop )
85  {
86  const double nRadius = 3;
87  const double nKappa((M_SQRT2 - 1.0) * 4.0 / 3.0);
88 
89  B2DPolygon aPolygon;
90  aPolygon.append( B2DPoint( rRect.Left(), rRect.Top() ) );
91 
92  {
93  B2DPoint aCorner( rRect.Left(), rRect.Bottom() );
94  B2DPoint aStart( rRect.Left(), rRect.Bottom() - nRadius );
95  B2DPoint aEnd( rRect.Left() + nRadius, rRect.Bottom() );
96  aPolygon.append( aStart );
97  aPolygon.appendBezierSegment(
98  interpolate( aStart, aCorner, nKappa ),
99  interpolate( aEnd, aCorner, nKappa ),
100  aEnd );
101  }
102 
103  {
104  B2DPoint aCorner( rRect.Right(), rRect.Bottom() );
105  B2DPoint aStart( rRect.Right() - nRadius, rRect.Bottom() );
106  B2DPoint aEnd( rRect.Right(), rRect.Bottom() - nRadius );
107  aPolygon.append( aStart );
108  aPolygon.appendBezierSegment(
109  interpolate( aStart, aCorner, nKappa ),
110  interpolate( aEnd, aCorner, nKappa ),
111  aEnd );
112  }
113 
114  aPolygon.append( B2DPoint( rRect.Right(), rRect.Top() ) );
115 
116  if ( !bOnTop )
117  {
120  aBRect.getCenterX(), aBRect.getCenterY(), M_PI );
121  aPolygon.transform( aRotation );
122  }
123 
124  return aPolygon;
125  }
126 }
127 
129  const tools::Rectangle& rRect, bool bOnTop)
130 {
131  rSeq.clear();
132  B2DPolygon aPolygon = lcl_GetPolygon(rRect, bOnTop);
133 
134  // Colors
136  basegfx::BColor aFillColor = lcl_GetFillColor(aLineColor);
137  basegfx::BColor aLighterColor = lcl_GetLighterGradientColor(aFillColor);
138 
140  if (rSettings.GetHighContrastMode())
141  {
142  aFillColor = rSettings.GetDialogColor().getBColor();
143  aLineColor = rSettings.GetDialogTextColor().getBColor();
144 
147  }
148  else
149  {
151  double nAngle = M_PI;
152  if (bOnTop)
153  nAngle = 0;
154  FillGradientAttribute aFillAttrs(drawinglayer::attribute::GradientStyle::Linear, 0.0, 0.0, 0.0, nAngle, aLighterColor, aFillColor);
156  new drawinglayer::primitive2d::FillGradientPrimitive2D(aGradientRect, aFillAttrs)));
157  }
158 
159  // Create the border lines primitive
161  new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aPolygon, aLineColor)));
162 }
163 
164 SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwFrame *pFrame, bool bHeader ) :
165  SwFrameMenuButtonBase(pEditWin, pFrame, "modules/swriter/ui/hfmenubutton.ui", "HFMenuButton"),
166  m_xMenuButton(m_xBuilder->weld_menu_button("menubutton")),
167  m_xPushButton(m_xBuilder->weld_button("button")),
168  m_bIsHeader( bHeader ),
169  m_pLine( nullptr ),
170  m_bIsAppearing( false ),
171  m_nFadeRate( 100 ),
172  m_aFadeTimer( )
173 {
174  m_xVirDev = m_xMenuButton->create_virtual_device();
175  SetVirDevFont();
176 
177  m_xPushButton->connect_clicked(LINK(this, SwHeaderFooterWin, ClickHdl));
178  m_xMenuButton->connect_selected(LINK(this, SwHeaderFooterWin, SelectHdl));
179 
180  // Create the line control
182  m_pLine->SetZOrder(this, ZOrderFlags::Before);
183 
184  // set the PopupMenu
185  // Rewrite the menu entries' text
186  if (m_bIsHeader)
187  {
188  m_xMenuButton->set_item_label("edit", SwResId(STR_FORMAT_HEADER));
189  m_xMenuButton->set_item_label("delete", SwResId(STR_DELETE_HEADER));
190  }
191  else
192  {
193  m_xMenuButton->set_item_label("edit", SwResId(STR_FORMAT_FOOTER));
194  m_xMenuButton->set_item_label("delete", SwResId(STR_DELETE_FOOTER));
195  }
196 
199 }
200 
202 {
203  disposeOnce();
204 }
205 
207 {
209  m_xPushButton.reset();
210  m_xMenuButton.reset();
212 }
213 
214 void SwHeaderFooterWin::SetOffset(Point aOffset, tools::Long nXLineStart, tools::Long nXLineEnd)
215 {
216  // Compute the text to show
218  bool bIsFirst = !pDesc->IsFirstShared() && GetPageFrame()->OnFirstPage();
219  bool bIsLeft = !pDesc->IsHeaderShared() && !GetPageFrame()->OnRightPage();
220  bool bIsRight = !pDesc->IsHeaderShared() && GetPageFrame()->OnRightPage();
221  m_sLabel = SwResId(STR_HEADER_TITLE);
222  if (!m_bIsHeader)
223  m_sLabel = bIsFirst ? SwResId(STR_FIRST_FOOTER_TITLE)
224  : bIsLeft ? SwResId(STR_LEFT_FOOTER_TITLE)
225  : bIsRight ? SwResId(STR_RIGHT_FOOTER_TITLE)
226  : SwResId(STR_FOOTER_TITLE );
227  else
228  m_sLabel = bIsFirst ? SwResId(STR_FIRST_HEADER_TITLE)
229  : bIsLeft ? SwResId(STR_LEFT_HEADER_TITLE)
230  : bIsRight ? SwResId(STR_RIGHT_HEADER_TITLE)
231  : SwResId(STR_HEADER_TITLE);
232 
233  sal_Int32 nPos = m_sLabel.lastIndexOf("%1");
234  m_sLabel = m_sLabel.replaceAt(nPos, 2, pDesc->GetName());
235  m_xMenuButton->set_accessible_name(m_sLabel);
236 
237  // Compute the text size and get the box position & size from it
238  ::tools::Rectangle aTextRect;
239  m_xVirDev->GetTextBoundRect(aTextRect, m_sLabel);
240  ::tools::Rectangle aTextPxRect = m_xVirDev->LogicToPixel(aTextRect);
242  Size aBoxSize (aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2,
243  aFontMetric.GetLineHeight() + TEXT_PADDING * 2 );
244 
245  tools::Long nYFooterOff = 0;
246  if (!m_bIsHeader)
247  nYFooterOff = aBoxSize.Height();
248 
249  Point aBoxPos(aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
250  aOffset.Y() - nYFooterOff);
251 
253  {
254  aBoxPos.setX( aOffset.X() + BOX_DISTANCE );
255  }
256 
257  // Set the position & Size of the window
258  SetPosSizePixel(aBoxPos, aBoxSize);
259 
260  m_xVirDev->SetOutputSizePixel(aBoxSize);
261  PaintButton();
262 
263  double nYLinePos = aBoxPos.Y();
264  if (!m_bIsHeader)
265  nYLinePos += aBoxSize.Height();
266  Point aLinePos(nXLineStart, nYLinePos);
267  Size aLineSize(nXLineEnd - nXLineStart, 1);
268  m_pLine->SetPosSizePixel(aLinePos, aLineSize);
269 }
270 
272 {
273  bool bIsEmptyHeaderFooter = IsEmptyHeaderFooter();
274  m_xMenuButton->set_visible(!bIsEmptyHeaderFooter);
275  m_xPushButton->set_visible(bIsEmptyHeaderFooter);
276 
277  if (!PopupMenu::IsInExecute())
278  {
279  m_bIsAppearing = bShow;
280 
281  if (m_aFadeTimer.IsActive())
282  m_aFadeTimer.Stop();
284  }
285 }
286 
287 bool SwHeaderFooterWin::Contains( const Point &rDocPt ) const
288 {
290  if (aRect.IsInside(rDocPt))
291  return true;
292 
294  return aLineRect.IsInside(rDocPt);
295 }
296 
298 {
299  if (!m_xVirDev)
300  return;
301 
302  // Use pixels for the rest of the drawing
303  SetMapMode(MapMode(MapUnit::MapPixel));
305  const ::tools::Rectangle aRect(::tools::Rectangle(Point(0, 0), m_xVirDev->PixelToLogic(GetSizePixel())));
306 
308 
309  // Create the text primitive
311  B2DVector aFontSize;
313 
315  double nTextOffsetY = aFontMetric.GetAscent() + TEXT_PADDING;
316  Point aTextPos(TEXT_PADDING, nTextOffsetY);
317 
319  aFontSize.getX(), aFontSize.getY(),
320  double(aTextPos.X()), double(aTextPos.Y())));
321 
324  aTextMatrix, m_sLabel, 0, m_sLabel.getLength(),
325  std::vector<double>(), aFontAttr, css::lang::Locale(), aLineColor)));
326 
327  // Create the 'plus' or 'arrow' primitive
328  B2DRectangle aSignArea(B2DPoint(aRect.Right() - BUTTON_WIDTH, 0.0),
329  B2DSize(aRect.Right(), aRect.getHeight()));
330 
331  B2DPolygon aSign;
332  bool bIsEmptyHeaderFooter = IsEmptyHeaderFooter();
333  if (bIsEmptyHeaderFooter)
334  {
335  // Create the + polygon
336  double nLeft = aSignArea.getMinX() + TEXT_PADDING;
337  double nRight = aSignArea.getMaxX() - TEXT_PADDING;
338  double nHalfW = ( nRight - nLeft ) / 2.0;
339 
340  double nTop = aSignArea.getCenterY() - nHalfW;
341  double nBottom = aSignArea.getCenterY() + nHalfW;
342 
343  aSign.append(B2DPoint(nLeft, aSignArea.getCenterY() - 1.0));
344  aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() - 1.0));
345  aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, nTop));
346  aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, nTop));
347  aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() - 1.0));
348  aSign.append(B2DPoint(nRight, aSignArea.getCenterY() - 1.0));
349  aSign.append(B2DPoint(nRight, aSignArea.getCenterY() + 1.0));
350  aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() + 1.0));
351  aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, nBottom));
352  aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, nBottom));
353  aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() + 1.0));
354  aSign.append(B2DPoint(nLeft, aSignArea.getCenterY() + 1.0));
355  aSign.setClosed(true);
356  }
357  else
358  {
359  // Create the v polygon
360  B2DPoint aLeft(aSignArea.getMinX() + TEXT_PADDING, aSignArea.getCenterY());
361  B2DPoint aRight(aSignArea.getMaxX() - TEXT_PADDING, aSignArea.getCenterY());
362  B2DPoint aBottom((aLeft.getX() + aRight.getX()) / 2.0, aLeft.getY() + 4.0);
363  aSign.append(aLeft);
364  aSign.append(aRight);
365  aSign.append(aBottom);
366  aSign.setClosed(true);
367  }
368 
369  BColor aSignColor = COL_BLACK.getBColor();
370  if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
371  aSignColor = COL_WHITE.getBColor();
372 
375  B2DPolyPolygon(aSign), aSignColor)) );
376 
377  // Create the processor and process the primitives
378  const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
379  std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
381 
382  // TODO Ghost it all if needed
384  double nFadeRate = double(m_nFadeRate) / 100.0;
385 
386  const basegfx::BColorModifierSharedPtr aBColorModifier =
387  std::make_shared<basegfx::BColorModifier_interpolate>(COL_WHITE.getBColor(),
388  1.0 - nFadeRate);
389 
391  new drawinglayer::primitive2d::ModifiedColorPrimitive2D(aSeq, aBColorModifier));
392 
393  pProcessor->process(aGhostedSeq);
394 
395  if (bIsEmptyHeaderFooter)
396  m_xPushButton->set_custom_button(m_xVirDev.get());
397  else
398  m_xMenuButton->set_custom_button(m_xVirDev.get());
399 }
400 
402 {
403  bool bResult = true;
404 
405  // Actually check it
407 
408  bool const bFirst(GetPageFrame()->OnFirstPage());
409  const SwFrameFormat *const pFormat = (GetPageFrame()->OnRightPage())
410  ? pDesc->GetRightFormat(bFirst)
411  : pDesc->GetLeftFormat(bFirst);
412 
413  if ( pFormat )
414  {
415  if ( m_bIsHeader )
416  bResult = !pFormat->GetHeader().IsActive();
417  else
418  bResult = !pFormat->GetFooter().IsActive();
419  }
420 
421  return bResult;
422 }
423 
424 void SwHeaderFooterWin::ExecuteCommand(std::string_view rIdent)
425 {
426  SwView& rView = GetEditWin()->GetView();
427  SwWrtShell& rSh = rView.GetWrtShell();
428 
429  const OUString& rStyleName = GetPageFrame()->GetPageDesc()->GetName();
430  if (rIdent == "edit")
431  {
432  OString sPageId = m_bIsHeader ? OString("header") : OString("footer");
433  rView.GetDocShell()->FormatPage(rStyleName, sPageId, rSh);
434  }
435  else if (rIdent == "borderback")
436  {
438  const SwFrameFormat& rMaster = pDesc->GetMaster();
439  SwFrameFormat* pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetFooter().GetFooterFormat() );
440  if ( m_bIsHeader )
441  pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetHeader().GetHeaderFormat() );
442  SfxItemSet aSet( pHFFormat->GetAttrSet() );
443 
444  // Items to hand over XPropertyList things like XColorList,
445  // XHatchList, XGradientList, and XBitmapList to the Area TabPage:
446  aSet.MergeRange( SID_COLOR_TABLE, SID_PATTERN_LIST );
447  // create needed items for XPropertyList entries from the DrawModel so that
448  // the Area TabPage can access them
450 
451  aSet.MergeRange(SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER);
452  // Create a box info item... needed by the dialog
453  std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
454  const SfxPoolItem *pBoxInfo;
455  if (SfxItemState::SET == pHFFormat->GetAttrSet().GetItemState(SID_ATTR_BORDER_INNER, true, &pBoxInfo))
456  aBoxInfo.reset(static_cast<SvxBoxInfoItem*>(pBoxInfo->Clone()));
457 
458  aBoxInfo->SetTable(false);
459  aBoxInfo->SetDist(true);
460  aBoxInfo->SetMinDist(false);
461  aBoxInfo->SetDefDist(MIN_BORDER_DIST);
462  aBoxInfo->SetValid(SvxBoxInfoItemValidFlags::DISABLE);
463  aSet.Put(*aBoxInfo);
464 
466  {
467  pHFFormat->SetFormatAttr( aSet );
468  rView.GetDocShell()->SetModified();
469  }
470  }
471  else if (rIdent == "delete")
472  {
473  rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, false, true );
474  // warning: "this" may be disposed now
475  rSh.GetWin()->GrabFocusToDocument();
476  }
477  else if (rIdent == "insert_pagenumber")
478  {
479  SfxViewFrame* pVFrame = rSh.GetView().GetViewFrame();
481  }
482  else if (rIdent == "insert_pagecount")
483  {
484  SfxViewFrame* pVFrame = rSh.GetView().GetViewFrame();
486  }
487 }
488 
489 void SwHeaderFooterWin::SetReadonly( bool bReadonly )
490 {
491  ShowAll( !bReadonly );
492 }
493 
495 {
496  SwView& rView = GetEditWin()->GetView();
497  SwWrtShell& rSh = rView.GetWrtShell();
498 
499  const OUString& rStyleName = GetPageFrame()->GetPageDesc()->GetName();
500  rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
501 
502  m_xPushButton->hide();
503  m_xMenuButton->show();
504  PaintButton();
505 }
506 
507 IMPL_LINK(SwHeaderFooterWin, SelectHdl, const OString&, rIdent, void)
508 {
509  ExecuteCommand(rIdent);
510 }
511 
513 {
514  if (m_bIsAppearing && m_nFadeRate > 0)
515  m_nFadeRate -= 25;
516  else if (!m_bIsAppearing && m_nFadeRate < 100)
517  m_nFadeRate += 25;
518 
519  if (m_nFadeRate != 100 && !IsVisible())
520  {
521  Show();
522  m_pLine->Show();
523  }
524  else if (m_nFadeRate == 100 && IsVisible())
525  {
526  Show(false);
527  m_pLine->Show(false);
528  }
529  else
530  PaintButton();
531 
532  if (IsVisible() && m_nFadeRate > 0 && m_nFadeRate < 100)
533  m_aFadeTimer.Start();
534 }
535 
536 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual Point GetPosPixel() const
SfxViewFrame * GetViewFrame() const
double getCenterY() const
#define FN_INSERT_FLD_PGCOUNT
Definition: cmdid.h:260
Base class of the Writer layout elements.
Definition: frame.hxx:298
SwHeaderFooterWin(SwEditWin *pEditWin, const SwFrame *pFrame, bool bHeader)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
virtual void SetModified(bool=true) override
Definition: docsh2.cxx:1378
BColor rgb2hsl(const BColor &rRGBColor)
const Color & GetDialogColor() const
virtual void dispose() override
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
static Color & GetHeaderFooterMarkColor()
Definition: viewopt.cxx:481
bool IsEmptyHeaderFooter() const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
sal_uInt16 char char * pDesc
const SwView & GetView() const
Definition: edtwin.hxx:244
long Long
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
double getX() const
#define FN_INSERT_FLD_PGNUMBER
Definition: cmdid.h:259
virtual Size GetSizePixel() const
IMPL_LINK_NOARG(SwHeaderFooterWin, ClickHdl, weld::Button &, void)
void appendBezierSegment(const basegfx::B2DPoint &rNextControlPoint, const basegfx::B2DPoint &rPrevControlPoint, const basegfx::B2DPoint &rPoint)
double getY() const
tools::Long GetWidth() const
void SetReadonly(bool bReadonly) override
virtual void ShowAll(bool bShow) override
virtual ~SwHeaderFooterWin() override
std::unique_ptr< weld::MenuButton > m_xMenuButton
#define MIN_BORDER_DIST
Definition: swtypes.hxx:74
#define BUTTON_WIDTH
void SetMapMode()
double getMaxX() const
static basegfx::BColor lcl_GetFillColor(const basegfx::BColor &rLineColor, double aLuminance)
attribute::FontAttribute getFontAttributeFromVclFont(basegfx::B2DVector &o_rSize, const vcl::Font &rFont, bool bRTL, bool bBiDiStrong)
const OUString & GetName() const
Definition: pagedesc.hxx:186
SwWrtShell & GetWrtShell() const
Definition: view.hxx:399
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
bool IsActive() const
Definition: fmthdft.hxx:89
bool IsActive() const
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
bool ShowBorderBackgroundDlg(weld::Window *pParent, SfxItemSet *pBBSet)
weld::Window * GetFrameWeld() const
#define TEXT_PADDING
virtual void dispose() override
const SwView & GetView() const
Definition: wrtsh.hxx:428
tools::Long GetAscent() const
const vcl::Font & GetFont() const
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
bool GetHighContrastMode() const
bool OnRightPage() const
Definition: frame.hxx:716
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
FontMetric GetFontMetric() const
SwDoc * GetDoc() const
Definition: viewsh.hxx:281
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
BColor hsl2rgb(const BColor &rHSLColor)
void ExecuteCommand(std::string_view rIdent)
bool IsHeaderShared() const
Definition: pagedesc.hxx:297
Style of a layout element.
Definition: frmfmt.hxx:58
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
static void PaintButton(drawinglayer::primitive2d::Primitive2DContainer &rSeq, const tools::Rectangle &rRect, bool bOnTop)
SwFrameFormat * GetLeftFormat(bool const bFirst=false)
Definition: pagedesc.cxx:361
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true)
SfxBindings & GetBindings()
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:127
const SwPageDesc & GetPageDesc(size_t i) const
Definition: fedesc.cxx:125
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
void SetOffset(Point aOffset, tools::Long nXLineStart, tools::Long nXLineEnd)
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
static bool GetLayoutRTL()
virtual void Start() override
void GrabFocusToDocument()
bool IsInside(const Point &rPOINT) const
virtual bool Contains(const Point &rDocPt) const override
Returns true if the point is inside the control.
Class sharing some MenuButton code.
B2DPolygon interpolate(const B2DPolygon &rOld1, const B2DPolygon &rOld2, double t)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:166
#define BOX_DISTANCE
void SetTimeout(sal_uInt64 nTimeoutMs)
void PutAreaListItems(SfxItemSet &rSet) const
Put needed items for XPropertyList entries from the DrawModel.
Definition: drawdoc.cxx:127
SwDocShell * GetDocShell()
Definition: view.cxx:1109
static bool IsInExecute()
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
void transform(const basegfx::B2DHomMatrix &rMatrix)
double getCenterX() const
basegfx::B2DRange b2DRectangleFromRectangle(const ::tools::Rectangle &rRect)
Class for the header and footer separator control window.
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
std::unique_ptr< drawinglayer::processor2d::BaseProcessor2D > createBaseProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:464
void ChangeHeaderOrFooter(std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning)
Definition: wrtsh1.cxx:1806
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:216
void setClosed(bool bNew)
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
void Stop()
const SwPageFrame * GetPageFrame() const
vcl::Window * GetWin() const
Definition: viewsh.hxx:337
std::unique_ptr< weld::Button > m_xPushButton
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
B2DHomMatrix createRotateAroundPoint(double fPointX, double fPointY, double fRadiant)
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:368
static VclPtr< reference_type > Create(Arg &&...arg)
VclPtr< vcl::Window > m_pLine
IMPL_LINK(SwHeaderFooterWin, SelectHdl, const OString &, rIdent, void)
tools::Long Height() const
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
Sequence< sal_Int8 > aSeq
void SetInvokeHandler(const Link< Timer *, void > &rLink)
void SetZOrder(vcl::Window *pRefWindow, ZOrderFlags nFlags)
basegfx::BColor getBColor() const
bool OnFirstPage() const
Definition: trvlfrm.cxx:1767
bool GetTextBoundRect(tools::Rectangle &rRect, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, const tools::Long *pDXArray=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) const
VclPtr< VirtualDevice > m_xVirDev
VirtualDevice * get() const
double getMinX() const
bool IsFirstShared() const
Definition: pagedesc.cxx:375
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:137
void FormatPage(const OUString &rPage, const OString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
Definition: docst.cxx:1553
bool IsActive() const
Definition: fmthdft.hxx:58
const Color & GetDialogTextColor() const
virtual SwEditWin * GetEditWin() override
tools::Long GetLineHeight() const
Definition: view.hxx:144
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
sal_uInt16 nPos