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 
57 using namespace basegfx;
58 using namespace basegfx::utils;
59 using namespace drawinglayer::attribute;
60 
61 namespace
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, aFillAttrs)));
156  }
157 
158  // Create the border lines primitive
160  new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aPolygon, aLineColor)));
161 }
162 
163 SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwFrame *pFrame, bool bHeader ) :
164  SwFrameMenuButtonBase(pEditWin, pFrame, "modules/swriter/ui/hfmenubutton.ui", "HFMenuButton"),
165  m_xMenuButton(m_xBuilder->weld_menu_button("menubutton")),
166  m_xPushButton(m_xBuilder->weld_button("button")),
167  m_bIsHeader( bHeader ),
168  m_pLine( nullptr ),
169  m_bIsAppearing( false ),
170  m_nFadeRate( 100 ),
171  m_aFadeTimer( )
172 {
173  m_xVirDev = m_xMenuButton->create_virtual_device();
174  SetVirDevFont();
175 
176  m_xPushButton->connect_clicked(LINK(this, SwHeaderFooterWin, ClickHdl));
177  m_xMenuButton->connect_selected(LINK(this, SwHeaderFooterWin, SelectHdl));
178 
179  // Create the line control
181  m_pLine->SetZOrder(this, ZOrderFlags::Before);
182 
183  // set the PopupMenu
184  // Rewrite the menu entries' text
185  if (m_bIsHeader)
186  {
187  m_xMenuButton->set_item_label("edit", SwResId(STR_FORMAT_HEADER));
188  m_xMenuButton->set_item_label("delete", SwResId(STR_DELETE_HEADER));
189  }
190  else
191  {
192  m_xMenuButton->set_item_label("edit", SwResId(STR_FORMAT_FOOTER));
193  m_xMenuButton->set_item_label("delete", SwResId(STR_DELETE_FOOTER));
194  }
195 
198 }
199 
201 {
202  disposeOnce();
203 }
204 
206 {
208  m_xPushButton.reset();
209  m_xMenuButton.reset();
211 }
212 
213 void SwHeaderFooterWin::SetOffset(Point aOffset, tools::Long nXLineStart, tools::Long nXLineEnd)
214 {
215  // Compute the text to show
217  bool bIsFirst = !pDesc->IsFirstShared() && GetPageFrame()->OnFirstPage();
218  bool bIsLeft = !pDesc->IsHeaderShared() && !GetPageFrame()->OnRightPage();
219  bool bIsRight = !pDesc->IsHeaderShared() && GetPageFrame()->OnRightPage();
220  m_sLabel = SwResId(STR_HEADER_TITLE);
221  if (!m_bIsHeader)
222  m_sLabel = bIsFirst ? SwResId(STR_FIRST_FOOTER_TITLE)
223  : bIsLeft ? SwResId(STR_LEFT_FOOTER_TITLE)
224  : bIsRight ? SwResId(STR_RIGHT_FOOTER_TITLE)
225  : SwResId(STR_FOOTER_TITLE );
226  else
227  m_sLabel = bIsFirst ? SwResId(STR_FIRST_HEADER_TITLE)
228  : bIsLeft ? SwResId(STR_LEFT_HEADER_TITLE)
229  : bIsRight ? SwResId(STR_RIGHT_HEADER_TITLE)
230  : SwResId(STR_HEADER_TITLE);
231 
232  sal_Int32 nPos = m_sLabel.lastIndexOf("%1");
233  m_sLabel = m_sLabel.replaceAt(nPos, 2, pDesc->GetName());
234  m_xMenuButton->set_accessible_name(m_sLabel);
235 
236  // Compute the text size and get the box position & size from it
237  ::tools::Rectangle aTextRect;
238  m_xVirDev->GetTextBoundRect(aTextRect, m_sLabel);
239  ::tools::Rectangle aTextPxRect = m_xVirDev->LogicToPixel(aTextRect);
241  Size aBoxSize (aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2,
242  aFontMetric.GetLineHeight() + TEXT_PADDING * 2 );
243 
244  tools::Long nYFooterOff = 0;
245  if (!m_bIsHeader)
246  nYFooterOff = aBoxSize.Height();
247 
248  Point aBoxPos(aOffset.X() - aBoxSize.Width() - BOX_DISTANCE,
249  aOffset.Y() - nYFooterOff);
250 
252  {
253  aBoxPos.setX( aOffset.X() + BOX_DISTANCE );
254  }
255 
256  // Set the position & Size of the window
257  SetPosSizePixel(aBoxPos, aBoxSize);
258 
259  m_xVirDev->SetOutputSizePixel(aBoxSize);
260  PaintButton();
261 
262  double nYLinePos = aBoxPos.Y();
263  if (!m_bIsHeader)
264  nYLinePos += aBoxSize.Height();
265  Point aLinePos(nXLineStart, nYLinePos);
266  Size aLineSize(nXLineEnd - nXLineStart, 1);
267  m_pLine->SetPosSizePixel(aLinePos, aLineSize);
268 }
269 
271 {
272  bool bIsEmptyHeaderFooter = IsEmptyHeaderFooter();
273  m_xMenuButton->set_visible(!bIsEmptyHeaderFooter);
274  m_xPushButton->set_visible(bIsEmptyHeaderFooter);
275 
276  m_bIsAppearing = bShow;
277 
278  if (m_aFadeTimer.IsActive())
279  m_aFadeTimer.Stop();
281 }
282 
283 bool SwHeaderFooterWin::Contains( const Point &rDocPt ) const
284 {
286  if (aRect.IsInside(rDocPt))
287  return true;
288 
290  return aLineRect.IsInside(rDocPt);
291 }
292 
294 {
295  if (!m_xVirDev)
296  return;
297 
298  // Use pixels for the rest of the drawing
299  SetMapMode(MapMode(MapUnit::MapPixel));
301  const ::tools::Rectangle aRect(::tools::Rectangle(Point(0, 0), m_xVirDev->PixelToLogic(GetSizePixel())));
302 
304 
305  // Create the text primitive
307  B2DVector aFontSize;
309 
311  double nTextOffsetY = aFontMetric.GetAscent() + TEXT_PADDING;
312  Point aTextPos(TEXT_PADDING, nTextOffsetY);
313 
315  aFontSize.getX(), aFontSize.getY(),
316  double(aTextPos.X()), double(aTextPos.Y())));
317 
320  aTextMatrix, m_sLabel, 0, m_sLabel.getLength(),
321  std::vector<double>(), aFontAttr, css::lang::Locale(), aLineColor)));
322 
323  // Create the 'plus' or 'arrow' primitive
324  B2DRectangle aSignArea(B2DPoint(aRect.Right() - BUTTON_WIDTH, 0.0),
325  B2DSize(aRect.Right(), aRect.getHeight()));
326 
327  B2DPolygon aSign;
328  bool bIsEmptyHeaderFooter = IsEmptyHeaderFooter();
329  if (bIsEmptyHeaderFooter)
330  {
331  // Create the + polygon
332  double nLeft = aSignArea.getMinX() + TEXT_PADDING;
333  double nRight = aSignArea.getMaxX() - TEXT_PADDING;
334  double nHalfW = ( nRight - nLeft ) / 2.0;
335 
336  double nTop = aSignArea.getCenterY() - nHalfW;
337  double nBottom = aSignArea.getCenterY() + nHalfW;
338 
339  aSign.append(B2DPoint(nLeft, aSignArea.getCenterY() - 1.0));
340  aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() - 1.0));
341  aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, nTop));
342  aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, nTop));
343  aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() - 1.0));
344  aSign.append(B2DPoint(nRight, aSignArea.getCenterY() - 1.0));
345  aSign.append(B2DPoint(nRight, aSignArea.getCenterY() + 1.0));
346  aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, aSignArea.getCenterY() + 1.0));
347  aSign.append(B2DPoint(aSignArea.getCenterX() + 1.0, nBottom));
348  aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, nBottom));
349  aSign.append(B2DPoint(aSignArea.getCenterX() - 1.0, aSignArea.getCenterY() + 1.0));
350  aSign.append(B2DPoint(nLeft, aSignArea.getCenterY() + 1.0));
351  aSign.setClosed(true);
352  }
353  else
354  {
355  // Create the v polygon
356  B2DPoint aLeft(aSignArea.getMinX() + TEXT_PADDING, aSignArea.getCenterY());
357  B2DPoint aRight(aSignArea.getMaxX() - TEXT_PADDING, aSignArea.getCenterY());
358  B2DPoint aBottom((aLeft.getX() + aRight.getX()) / 2.0, aLeft.getY() + 4.0);
359  aSign.append(aLeft);
360  aSign.append(aRight);
361  aSign.append(aBottom);
362  aSign.setClosed(true);
363  }
364 
365  BColor aSignColor = COL_BLACK.getBColor();
366  if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
367  aSignColor = COL_WHITE.getBColor();
368 
371  B2DPolyPolygon(aSign), aSignColor)) );
372 
373  // Create the processor and process the primitives
374  const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
375  std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
377 
378  // TODO Ghost it all if needed
380  double nFadeRate = double(m_nFadeRate) / 100.0;
381 
382  const basegfx::BColorModifierSharedPtr aBColorModifier =
383  std::make_shared<basegfx::BColorModifier_interpolate>(COL_WHITE.getBColor(),
384  1.0 - nFadeRate);
385 
387  new drawinglayer::primitive2d::ModifiedColorPrimitive2D(aSeq, aBColorModifier));
388 
389  pProcessor->process(aGhostedSeq);
390 
391  if (bIsEmptyHeaderFooter)
392  m_xPushButton->set_custom_button(m_xVirDev.get());
393  else
394  m_xMenuButton->set_custom_button(m_xVirDev.get());
395 }
396 
398 {
399  bool bResult = true;
400 
401  // Actually check it
403 
404  bool const bFirst(GetPageFrame()->OnFirstPage());
405  const SwFrameFormat *const pFormat = (GetPageFrame()->OnRightPage())
406  ? pDesc->GetRightFormat(bFirst)
407  : pDesc->GetLeftFormat(bFirst);
408 
409  if ( pFormat )
410  {
411  if ( m_bIsHeader )
412  bResult = !pFormat->GetHeader().IsActive();
413  else
414  bResult = !pFormat->GetFooter().IsActive();
415  }
416 
417  return bResult;
418 }
419 
420 void SwHeaderFooterWin::ExecuteCommand(std::string_view rIdent)
421 {
422  SwView& rView = GetEditWin()->GetView();
423  SwWrtShell& rSh = rView.GetWrtShell();
424 
425  const OUString& rStyleName = GetPageFrame()->GetPageDesc()->GetName();
426  if (rIdent == "edit")
427  {
428  OString sPageId = m_bIsHeader ? OString("header") : OString("footer");
429  rView.GetDocShell()->FormatPage(rStyleName, sPageId, rSh);
430  }
431  else if (rIdent == "borderback")
432  {
434  const SwFrameFormat& rMaster = pDesc->GetMaster();
435  SwFrameFormat* pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetFooter().GetFooterFormat() );
436  if ( m_bIsHeader )
437  pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetHeader().GetHeaderFormat() );
438  SfxItemSet aSet( pHFFormat->GetAttrSet() );
439 
440  // Items to hand over XPropertyList things like XColorList,
441  // XHatchList, XGradientList, and XBitmapList to the Area TabPage:
442  aSet.MergeRange( SID_COLOR_TABLE, SID_PATTERN_LIST );
443  // create needed items for XPropertyList entries from the DrawModel so that
444  // the Area TabPage can access them
446 
447  aSet.MergeRange(SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER);
448  // Create a box info item... needed by the dialog
449  std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
450  const SfxPoolItem *pBoxInfo;
451  if (SfxItemState::SET == pHFFormat->GetAttrSet().GetItemState(SID_ATTR_BORDER_INNER, true, &pBoxInfo))
452  aBoxInfo.reset(static_cast<SvxBoxInfoItem*>(pBoxInfo->Clone()));
453 
454  aBoxInfo->SetTable(false);
455  aBoxInfo->SetDist(true);
456  aBoxInfo->SetMinDist(false);
457  aBoxInfo->SetDefDist(MIN_BORDER_DIST);
458  aBoxInfo->SetValid(SvxBoxInfoItemValidFlags::DISABLE);
459  aSet.Put(*aBoxInfo);
460 
462  {
463  pHFFormat->SetFormatAttr( aSet );
464  rView.GetDocShell()->SetModified();
465  }
466  }
467  else if (rIdent == "delete")
468  {
469  rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, false, true );
470  // warning: "this" may be disposed now
471  rSh.GetWin()->GrabFocusToDocument();
472  }
473  else if (rIdent == "insert_pagenumber")
474  {
475  SfxViewFrame* pVFrame = rSh.GetView().GetViewFrame();
477  }
478  else if (rIdent == "insert_pagecount")
479  {
480  SfxViewFrame* pVFrame = rSh.GetView().GetViewFrame();
482  }
483 }
484 
485 void SwHeaderFooterWin::SetReadonly( bool bReadonly )
486 {
487  ShowAll( !bReadonly );
488 }
489 
491 {
492  SwView& rView = GetEditWin()->GetView();
493  SwWrtShell& rSh = rView.GetWrtShell();
494 
495  const OUString& rStyleName = GetPageFrame()->GetPageDesc()->GetName();
496  rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, true, false );
497 
498  m_xPushButton->hide();
499  m_xMenuButton->show();
500  PaintButton();
501 }
502 
503 IMPL_LINK(SwHeaderFooterWin, SelectHdl, const OString&, rIdent, void)
504 {
505  ExecuteCommand(rIdent);
506 }
507 
509 {
510  if (m_bIsAppearing && m_nFadeRate > 0)
511  m_nFadeRate -= 25;
512  else if (!m_bIsAppearing && m_nFadeRate < 100)
513  m_nFadeRate += 25;
514 
515  if (m_nFadeRate != 100 && !IsVisible())
516  {
517  Show();
518  m_pLine->Show();
519  }
520  else if (m_nFadeRate == 100 && IsVisible())
521  {
522  Show(false);
523  m_pLine->Show(false);
524  }
525  else
526  PaintButton();
527 
528  if (IsVisible() && m_nFadeRate > 0 && m_nFadeRate < 100)
529  m_aFadeTimer.Start();
530 }
531 
532 /* 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:477
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:197
SwWrtShell & GetWrtShell() const
Definition: view.hxx:413
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:91
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:429
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:320
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:382
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:126
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:128
SwDocShell * GetDocShell()
Definition: view.cxx:1126
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:450
void ChangeHeaderOrFooter(std::u16string_view rStyleName, bool bHeader, bool bOn, bool bShowWarning)
Definition: wrtsh1.cxx:1809
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:239
void setClosed(bool bNew)
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
void Stop()
const SwPageFrame * GetPageFrame() const
constexpr tools::Long Height() 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:389
static VclPtr< reference_type > Create(Arg &&...arg)
VclPtr< vcl::Window > m_pLine
IMPL_LINK(SwHeaderFooterWin, SelectHdl, const OString &, rIdent, void)
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:1768
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:396
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:120
void FormatPage(const OUString &rPage, const OString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
Definition: docst.cxx:1602
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