LibreOffice Module sw (master) 1
colex.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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <cmdid.h>
21#include <hintids.hxx>
22#include <svl/eitem.hxx>
23#include <tools/fract.hxx>
24#include <editeng/lrspitem.hxx>
25#include <editeng/ulspitem.hxx>
26#include <editeng/sizeitem.hxx>
27#include <svx/pageitem.hxx>
28#include <editeng/brushitem.hxx>
30#include <vcl/outdev.hxx>
31#include <vcl/settings.hxx>
32#include <tgrditem.hxx>
33#include <viewopt.hxx>
34#include <colex.hxx>
35#include <colmgr.hxx>
37
39{
40 if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_FRAMEDIR))
41 {
43 m_bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB||
44 rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB;
45 }
46
47 SfxItemPool* pPool = rSet.GetPool();
48 sal_uInt16 nWhich = pPool->GetWhich( SID_ATTR_PAGE );
49 if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
50 {
51 // alignment
52 const SvxPageItem& rPage = static_cast<const SvxPageItem&>(rSet.Get(nWhich));
53 SetUsage(rPage.GetPageUsage());
54 }
55
56 nWhich = pPool->GetWhich( SID_ATTR_PAGE_SIZE );
57
58 if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
59 {
60 // orientation and size from PageItem
61 const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(rSet.Get( nWhich ));
62 SetSize( rSize.GetSize() );
63 }
64 nWhich = RES_LR_SPACE;
65 if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
66 {
67 // set left and right border
68 const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(rSet.Get( nWhich ));
69
70 SetLeft( rLRSpace.GetLeft() );
71 SetRight( rLRSpace.GetRight() );
72 }
73 else
74 {
75 SetLeft( 0 );
76 SetRight( 0 );
77 }
78
79 nWhich = RES_UL_SPACE;
80
81 if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
82 {
83 // set upper and lower border
84 const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(rSet.Get( nWhich ));
85
86 SetTop( rULSpace.GetUpper() );
87 SetBottom( rULSpace.GetLower() );
88 }
89 else
90 {
91 SetTop( 0 );
92 SetBottom( 0 );
93 }
94
95 // evaluate header-attributes
96 const SfxPoolItem* pItem;
97 if( SfxItemState::SET == rSet.GetItemState( pPool->GetWhich( SID_ATTR_PAGE_HEADERSET),
98 false, &pItem ) )
99 {
100 const SfxItemSet& rHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
101 const SfxBoolItem& rHeaderOn =
102 rHeaderSet.Get( pPool->GetWhich( SID_ATTR_PAGE_ON ) );
103
104 if ( rHeaderOn.GetValue() )
105 {
106 const SvxSizeItem& rSize =
107 rHeaderSet.Get(pPool->GetWhich(SID_ATTR_PAGE_SIZE));
108
109 const SvxULSpaceItem& rUL = rHeaderSet.Get(pPool->GetWhich(SID_ATTR_ULSPACE));
110 const SvxLRSpaceItem& rLR = rHeaderSet.Get(pPool->GetWhich(SID_ATTR_LRSPACE));
111
112 SetHdHeight( rSize.GetSize().Height() - rUL.GetLower());
113 SetHdDist( rUL.GetLower() );
114 SetHdLeft( rLR.GetLeft() );
115 SetHdRight( rLR.GetRight() );
116 SetHeader( true );
117
118 if(SfxItemState::SET == rHeaderSet.GetItemState(RES_BACKGROUND))
119 {
120 // create FillAttributes from SvxBrushItem //SetHdColor(rItem.GetColor());
121 const SvxBrushItem& rItem = rHeaderSet.Get(RES_BACKGROUND);
123
126 std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(
127 aTempSet));
128 }
129 }
130 else
131 SetHeader( false );
132 }
133
134 if( SfxItemState::SET == rSet.GetItemState( pPool->GetWhich( SID_ATTR_PAGE_FOOTERSET),
135 false, &pItem ) )
136 {
137 const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
138 const SfxBoolItem& rFooterOn = rFooterSet.Get( SID_ATTR_PAGE_ON );
139
140 if ( rFooterOn.GetValue() )
141 {
142 const SvxSizeItem& rSize =
143 rFooterSet.Get( pPool->GetWhich( SID_ATTR_PAGE_SIZE ) );
144
145 const SvxULSpaceItem& rUL = rFooterSet.Get(pPool->GetWhich( SID_ATTR_ULSPACE ) );
146 const SvxLRSpaceItem& rLR = rFooterSet.Get(pPool->GetWhich( SID_ATTR_LRSPACE ) );
147
148 SetFtHeight( rSize.GetSize().Height() - rUL.GetUpper());
149 SetFtDist( rUL.GetUpper() );
150 SetFtLeft( rLR.GetLeft() );
151 SetFtRight( rLR.GetRight() );
152 SetFooter( true );
153
154 if( rFooterSet.GetItemState( RES_BACKGROUND ) == SfxItemState::SET )
155 {
156 // create FillAttributes from SvxBrushItem //SetFtColor(rItem.GetColor());
157 const SvxBrushItem& rItem = rFooterSet.Get(RES_BACKGROUND);
159
162 std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(
163 aTempSet));
164 }
165 }
166 else
167 SetFooter( false );
168 }
169
170 if(const SvxBrushItem* pBrushItem = rSet.GetItemIfSet(RES_BACKGROUND, false))
171 {
172 // create FillAttributes from SvxBrushItem
174
175 setSvxBrushItemAsFillAttributesToTargetSet(*pBrushItem, aTempSet);
177 std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(
178 aTempSet));
179 }
180
181 Invalidate();
182}
183
184void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOrg,
185 const bool bSecond, const bool bEnabled)
186{
187 SwPageExample::DrawPage(rRenderContext, rOrg, bSecond, bEnabled);
188 if (!m_pColMgr)
189 return;
190 sal_uInt16 nColumnCount = m_pColMgr->GetCount();
191 if (!nColumnCount)
192 return;
193
194 tools::Long nL = GetLeft();
195 tools::Long nR = GetRight();
196
197 if (GetUsage() == SvxPageUsage::Mirror && !bSecond)
198 {
199 // swap for mirrored
200 nL = GetRight();
201 nR = GetLeft();
202 }
203
204 rRenderContext.SetFillColor(COL_LIGHTGRAY);
205 tools::Rectangle aRect;
206 aRect.SetRight( rOrg.X() + GetSize().Width() - nR );
207 aRect.SetLeft( rOrg.X() + nL );
208 aRect.SetTop( rOrg.Y() + GetTop() + GetHdHeight() + GetHdDist() );
209 aRect.SetBottom( rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist() );
210 rRenderContext.DrawRect(aRect);
211
212 const tools::Rectangle aDefineRect(aRect);
214
215 if (!rFillAttributes || !rFillAttributes->isUsed())
216 {
217 // If there is no fill, use fallback color
218 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
219 const Color& rFieldColor = rStyleSettings.GetFieldColor();
220
222 std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(
223 rFieldColor));
224 }
225
226 // #97495# make sure that the automatic column width's are always equal
227 bool bAutoWidth = m_pColMgr->IsAutoWidth();
228 sal_Int32 nAutoColWidth = 0;
229 if (bAutoWidth)
230 {
231 sal_Int32 nColumnWidthSum = 0;
232 for (sal_uInt16 i = 0; i < nColumnCount; ++i)
233 nColumnWidthSum += m_pColMgr->GetColWidth( i );
234 nAutoColWidth = nColumnWidthSum / nColumnCount;
235 }
236
237 for (sal_uInt16 i = 0; i < nColumnCount; ++i)
238 {
239 if (!bAutoWidth)
240 nAutoColWidth = m_pColMgr->GetColWidth(i);
241
242 if (!m_bVertical)
243 aRect.SetRight( aRect.Left() + nAutoColWidth );
244 else
245 aRect.SetBottom( aRect.Top() + nAutoColWidth );
246
247 // use primitive draw command
248 drawFillAttributes(rRenderContext, getPageFillAttributes(), aRect, aDefineRect);
249
250 if (i < nColumnCount - 1)
251 {
252 if (!m_bVertical)
253 aRect.SetLeft( aRect.Right() + m_pColMgr->GetGutterWidth(i) );
254 else
255 aRect.SetTop( aRect.Bottom() + m_pColMgr->GetGutterWidth(i) );
256 }
257 }
258 if (!m_pColMgr->HasLine())
259 return;
260
261 Point aUp(rOrg.X() + nL, rOrg.Y() + GetTop());
262 Point aDown(rOrg.X() + nL,
263 rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist());
264
265 if (m_pColMgr->GetLineHeightPercent() != 100)
266 {
267 tools::Long nLength = !m_bVertical ? aDown.Y() - aUp.Y() : aDown.X() - aUp.X();
269 switch (m_pColMgr->GetAdjust())
270 {
271 case COLADJ_BOTTOM:
272 if (!m_bVertical)
273 aUp.AdjustY(nLength );
274 else
275 aUp.AdjustX(nLength );
276 break;
277 case COLADJ_TOP:
278 if (!m_bVertical)
279 aDown.AdjustY( -nLength );
280 else
281 aDown.AdjustX( -nLength );
282 break;
283 case COLADJ_CENTER:
284 if (!m_bVertical)
285 {
286 aUp.AdjustY(nLength / 2 );
287 aDown.AdjustY( -(nLength / 2) );
288 }
289 else
290 {
291 aUp.AdjustX(nLength / 2 );
292 aDown.AdjustX( -(nLength / 2) );
293 }
294 break;
295 default:
296 break; // prevent warning
297 }
298 }
299
300 for (sal_uInt16 i = 0; i < nColumnCount - 1; ++i)
301 {
302 int nGutter = m_pColMgr->GetGutterWidth(i);
303 int nDist = m_pColMgr->GetColWidth( i ) + nGutter;
304 nDist -= (i == 0) ? nGutter / 2 : 0;
305 if (!m_bVertical)
306 {
307 aUp.AdjustX(nDist );
308 aDown.AdjustX(nDist );
309 }
310 else
311 {
312 aUp.AdjustY(nDist );
313 aDown.AdjustY(nDist );
314 }
315
316 rRenderContext.DrawLine(aUp, aDown);
317 }
318}
319
321 : m_aFrameSize(SvxPaperInfo::GetPaperSize(PAPER_A4)) // DIN A4
322{
323 ::FitToActualSize(m_aCols, o3tl::narrowing<sal_uInt16>(m_aFrameSize.Width()));
324}
325
327{
328 rRenderContext.Push(vcl::PushFlags::MAPMODE);
329
331 MapMode aMapMode(MapUnit::MapTwip);
332 aMapMode.SetScaleX(aScale);
333 aMapMode.SetScaleY(aScale);
334 rRenderContext.SetMapMode(aMapMode);
335
336 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
337 const Color& rFieldColor = rStyleSettings.GetFieldColor();
338 const Color& rDlgColor = rStyleSettings.GetDialogColor();
339 const Color& rFieldTextColor = SwViewOption::GetCurrentViewOptions().GetFontColor();
340 Color aGrayColor(COL_LIGHTGRAY);
341 if (rFieldColor == aGrayColor)
342 aGrayColor.Invert();
343
344 Size aLogSize(rRenderContext.PixelToLogic(GetOutputSizePixel()));
345 tools::Rectangle aCompleteRect(Point(0,0), aLogSize);
346 rRenderContext.SetLineColor(rDlgColor);
347 rRenderContext.SetFillColor(rDlgColor);
348 rRenderContext.DrawRect(aCompleteRect);
349
350 rRenderContext.SetLineColor(rFieldTextColor);
351 Point aTL((aLogSize.Width() - m_aFrameSize.Width()) / 2,
352 (aLogSize.Height() - m_aFrameSize.Height()) / 2);
353 tools::Rectangle aRect(aTL, m_aFrameSize);
354
355 //draw a shadow rectangle
356 rRenderContext.SetFillColor(COL_GRAY);
357 tools::Rectangle aShadowRect(aRect);
358 aShadowRect.Move(aTL.Y(), aTL.Y());
359 rRenderContext.DrawRect(aShadowRect);
360
361 rRenderContext.SetFillColor(rFieldColor);
362 rRenderContext.DrawRect(aRect);
363
364 rRenderContext.SetFillColor(aGrayColor);
365
366 //column separator?
367 tools::Long nLength = aLogSize.Height() - 2 * aTL.Y();
368 Point aUp(aTL);
369 Point aDown(aTL.X(), nLength);
370 bool bLines = false;
372 {
373 bLines = true;
374
375 sal_uInt16 nPercent = m_aCols.GetLineHeight();
376 if (nPercent != 100)
377 {
378 nLength -= nLength * nPercent / 100;
379 switch(m_aCols.GetLineAdj())
380 {
381 case COLADJ_BOTTOM: aUp.AdjustY(nLength ); break;
382 case COLADJ_TOP: aDown.AdjustY( -nLength ); break;
383 case COLADJ_CENTER:
384 aUp.AdjustY(nLength / 2 );
385 aDown.AdjustY( -(nLength / 2) );
386 break;
387 default:
388 break; //prevent warning
389 }
390 }
391
392 }
393 const SwColumns& rCols = m_aCols.GetColumns();
394 sal_uInt16 nColCount = rCols.size();
395 if (nColCount)
396 {
397 rRenderContext.DrawRect(aRect);
398 rRenderContext.SetFillColor(rFieldColor);
399 tools::Rectangle aFrameRect(aTL, m_aFrameSize);
400 tools::Long nSum = aTL.X();
401 for (sal_uInt16 i = 0; i < nColCount; i++)
402 {
403 const SwColumn* pCol = &rCols[i];
404 aFrameRect.SetLeft( nSum + pCol->GetLeft() ); //nSum + pCol->GetLeft() + aTL.X();
405 nSum += pCol->GetWishWidth();
406 aFrameRect.SetRight( nSum - pCol->GetRight() );
407 rRenderContext.DrawRect(aFrameRect);
408 }
409 if (bLines)
410 {
411 nSum = aTL.X();
412 for (sal_uInt16 i = 0; i < nColCount - 1; i++)
413 {
414 nSum += rCols[i].GetWishWidth();
415 aUp.setX( nSum );
416 aDown.setX( nSum );
417 rRenderContext.DrawLine(aUp, aDown);
418 }
419 }
420 }
421 rRenderContext.Pop();
422}
423
425{
426 m_aCols = rCol;
427 sal_uInt16 nWishSum = m_aCols.GetWishWidth();
428 tools::Long nFrameWidth = m_aFrameSize.Width();
429 SwColumns& rCols = m_aCols.GetColumns();
430 sal_uInt16 nColCount = rCols.size();
431
432 for(sal_uInt16 i = 0; i < nColCount; i++)
433 {
434 SwColumn* pCol = &rCols[i];
435 tools::Long nWish = pCol->GetWishWidth();
436 nWish *= nFrameWidth;
437 nWish /= nWishSum;
438 pCol->SetWishWidth(o3tl::narrowing<sal_uInt16>(nWish));
439 tools::Long nLeft = pCol->GetLeft();
440 nLeft *= nFrameWidth;
441 nLeft /= nWishSum;
442 pCol->SetLeft(o3tl::narrowing<sal_uInt16>(nLeft));
443 tools::Long nRight = pCol->GetRight();
444 nRight *= nFrameWidth;
445 nRight /= nWishSum;
446 pCol->SetRight(o3tl::narrowing<sal_uInt16>(nRight));
447 }
448 // #97495# make sure that the automatic column width's are always equal
449 if(!(nColCount && m_aCols.IsOrtho()))
450 return;
451
452 sal_Int32 nColumnWidthSum = 0;
453 sal_uInt16 i;
454 for(i = 0; i < nColCount; ++i)
455 {
456 SwColumn* pCol = &rCols[i];
457 nColumnWidthSum += pCol->GetWishWidth();
458 nColumnWidthSum -= (pCol->GetRight() + pCol->GetLeft());
459 }
460 nColumnWidthSum /= nColCount;
461 for(i = 0; i < nColCount; ++i)
462 {
463 SwColumn* pCol = &rCols[i];
464 pCol->SetWishWidth( static_cast< sal_uInt16 >(nColumnWidthSum + pCol->GetRight() + pCol->GetLeft()));
465 }
466}
467
469{
471 OutputDevice& rRefDevice = pDrawingArea->get_ref_device();
472 Size aPrefSize(rRefDevice.LogicToPixel(Size(75, 46), MapMode(MapUnit::MapAppFont)));
473 pDrawingArea->set_size_request(aPrefSize.Width(), aPrefSize.Height());
474}
475
477{
478 OutputDevice& rRefDevice = GetDrawingArea()->get_ref_device();
479 rRefDevice.Push(vcl::PushFlags::MAPMODE);
480 rRefDevice.SetMapMode(MapMode(MapUnit::MapTwip));
484 m_aWinSize = rRefDevice.PixelToLogic(m_aWinSize);
485 rRefDevice.Pop();
486 Invalidate();
487}
488
490{
491}
492
493void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOrg,
494 const bool bSecond, const bool bEnabled)
495{
496 SwPageExample::DrawPage(rRenderContext, rOrg, bSecond, bEnabled);
497
498 if (!m_pGridItem || !m_pGridItem->GetGridType())
499 return;
500
501 //paint the grid now
502 Color aLineColor = m_pGridItem->GetColor();
503 if (aLineColor == COL_AUTO)
504 {
505 aLineColor = rRenderContext.GetFillColor();
506 aLineColor.Invert();
507 }
508 rRenderContext.SetLineColor(aLineColor);
509 tools::Long nL = GetLeft();
510 tools::Long nR = GetRight();
511
512 if (GetUsage() == SvxPageUsage::Mirror && !bSecond)
513 {
514 // rotate for mirrored
515 nL = GetRight();
516 nR = GetLeft();
517 }
518
519 tools::Rectangle aRect;
520 aRect.SetRight( rOrg.X() + GetSize().Width() - nR );
521 aRect.SetLeft( rOrg.X() + nL );
522 aRect.SetTop( rOrg.Y() + GetTop() + GetHdHeight() + GetHdDist() );
523 aRect.SetBottom( rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist() );
524
525 //increase the values to get a 'viewable' preview
526 sal_Int32 nBaseHeight = m_pGridItem->GetBaseHeight() * 3;
527 sal_Int32 nRubyHeight = m_pGridItem->GetRubyHeight() * 3;
528
529 //detect height of rectangles
530 tools::Rectangle aRubyRect(aRect.TopLeft(),
532 Size(nRubyHeight, aRect.GetHeight()) :
533 Size(aRect.GetWidth(), nRubyHeight));
534 tools::Rectangle aCharRect(aRect.TopLeft(),
536 Size(nBaseHeight, aRect.GetHeight()) :
537 Size(aRect.GetWidth(), nBaseHeight));
538
539 sal_Int32 nLineHeight = nBaseHeight + nRubyHeight;
540
541 //detect count of rectangles
542 sal_Int32 nLines = (m_bVertical ? aRect.GetWidth(): aRect.GetHeight()) / nLineHeight;
543 if (nLines > m_pGridItem->GetLines())
544 nLines = m_pGridItem->GetLines();
545
546 // determine start position
547 if (m_bVertical)
548 {
549 sal_Int16 nXStart = static_cast<sal_Int16>(aRect.GetWidth() / 2 - nLineHeight * nLines /2);
550 aRubyRect.Move(nXStart, 0);
551 aCharRect.Move(nXStart, 0);
552 }
553 else
554 {
555 sal_Int16 nYStart = static_cast<sal_Int16>(aRect.GetHeight() / 2 - nLineHeight * nLines /2);
556 aRubyRect.Move(0, nYStart);
557 aCharRect.Move(0, nYStart);
558 }
559
560 if (m_pGridItem->IsRubyTextBelow())
561 m_bVertical ? aRubyRect.Move(nBaseHeight, 0) : aRubyRect.Move(0, nBaseHeight);
562 else
563 m_bVertical ? aCharRect.Move(nRubyHeight, 0) : aCharRect.Move(0, nRubyHeight);
564
565 //vertical lines
566 bool bBothLines = m_pGridItem->GetGridType() == GRID_LINES_CHARS;
567 rRenderContext.SetFillColor(COL_TRANSPARENT);
568 sal_Int32 nXMove = m_bVertical ? nLineHeight : 0;
569 sal_Int32 nYMove = m_bVertical ? 0 : nLineHeight;
570 for (sal_Int32 nLine = 0; nLine < nLines; nLine++)
571 {
572 rRenderContext.DrawRect(aRubyRect);
573 rRenderContext.DrawRect(aCharRect);
574 if (bBothLines)
575 {
576 Point aStart = aCharRect.TopLeft();
577 Point aEnd = m_bVertical ? aCharRect.TopRight() : aCharRect.BottomLeft();
578 while (m_bVertical ? aStart.Y() < aRect.Bottom(): aStart.X() < aRect.Right())
579 {
580 rRenderContext.DrawLine(aStart, aEnd);
581 if (m_bVertical)
582 aStart.setY( aEnd.AdjustY(nBaseHeight ) );
583 else
584 aStart.setX( aEnd.AdjustX(nBaseHeight ) );
585 }
586 }
587 aRubyRect.Move(nXMove, nYMove);
588 aCharRect.Move(nXMove, nYMove);
589 }
590
591}
592
594{
595 m_pGridItem.reset();
596 //get the grid information
597 if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_TEXTGRID))
600}
601
602/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const StyleSettings & GetStyleSettings() const
void Invert()
void SetScaleY(const Fraction &rScaleY)
void SetScaleX(const Fraction &rScaleX)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void DrawRect(const tools::Rectangle &rRect)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void SetLineColor()
void SetMapMode()
void SetFillColor()
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
const AllSettings & GetSettings() const
const Color & GetFillColor() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
bool GetValue() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
const Color & GetFieldColor() const
const Color & GetDialogColor() const
tools::Long GetRight() const
tools::Long GetLeft() const
SvxPageUsage GetPageUsage() const
void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
void SetUsage(SvxPageUsage eU)
void SetBottom(tools::Long nNew)
tools::Long GetFtDist() const
void SetHdLeft(tools::Long nNew)
const Size & GetSize() const
tools::Long GetBottom() const
void SetHdHeight(tools::Long nNew)
tools::Long GetTop() const
SvxPageUsage GetUsage() const
void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
void SetFtDist(tools::Long nNew)
void SetSize(const Size &rSize)
void SetLeft(tools::Long nNew)
void SetHdDist(tools::Long nNew)
void SetFtLeft(tools::Long nNew)
void SetFtRight(tools::Long nNew)
static void drawFillAttributes(vcl::RenderContext &rRenderContext, const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes, const tools::Rectangle &rPaintRange, const tools::Rectangle &rDefineRange)
void SetHdRight(tools::Long nNew)
void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
tools::Long GetRight() const
void SetFooter(bool bNew)
tools::Long GetLeft() const
const drawinglayer::attribute::SdrAllFillAttributesHelperPtr & getPageFillAttributes() const
tools::Long GetHdHeight() const
void SetFtHeight(tools::Long nNew)
tools::Long GetHdDist() const
void SetHeader(bool bNew)
tools::Long GetFtHeight() const
void SetTop(tools::Long nNew)
virtual void DrawPage(vcl::RenderContext &rRenderContext, const Point &rPoint, const bool bSecond, const bool bEnabled)
void SetRight(tools::Long nNew)
const Size & GetSize() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
virtual void DrawPage(vcl::RenderContext &rRenderContext, const Point &rPoint, const bool bSecond, const bool bEnabled) override
Definition: colex.cxx:184
SwColMgr * m_pColMgr
Definition: colex.hxx:62
short GetLineHeightPercent() const
Definition: colmgr.cxx:106
sal_uInt16 GetCount() const
Definition: colmgr.hxx:73
sal_uInt16 GetColWidth(sal_uInt16 nIdx) const
Definition: colmgr.cxx:117
bool IsAutoWidth() const
Definition: colmgr.hxx:101
bool HasLine() const
Definition: colmgr.hxx:114
SwColLineAdj GetAdjust() const
Definition: colmgr.hxx:92
sal_uInt16 GetGutterWidth(sal_uInt16 nPos=USHRT_MAX) const
Definition: colmgr.cxx:77
virtual void Resize() override
Definition: colex.cxx:476
void SetColumns(const SwFormatCol &rCol)
Definition: colex.cxx:424
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: colex.cxx:468
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: colex.cxx:326
SwFormatCol m_aCols
Definition: colex.hxx:90
ColumnDescriptor.
Definition: fmtclds.hxx:34
sal_uInt16 GetLeft() const
Definition: fmtclds.hxx:51
void SetRight(sal_uInt16 nNew)
Definition: fmtclds.hxx:48
sal_uInt16 GetRight() const
Definition: fmtclds.hxx:52
void SetLeft(sal_uInt16 nNew)
Definition: fmtclds.hxx:47
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:50
void SetWishWidth(sal_uInt16 nNew)
Definition: fmtclds.hxx:46
sal_uInt16 GetWishWidth() const
Definition: fmtclds.hxx:122
bool IsOrtho() const
Definition: fmtclds.hxx:121
const SwColumns & GetColumns() const
Definition: fmtclds.hxx:112
sal_uInt8 GetLineHeight() const
Definition: fmtclds.hxx:123
SwColLineAdj GetLineAdj() const
Definition: fmtclds.hxx:120
bool m_bVertical
Definition: colex.hxx:34
void UpdateExample(const SfxItemSet &rSet)
Definition: colex.cxx:38
void UpdateExample(const SfxItemSet &rSet)
Definition: colex.cxx:593
virtual void DrawPage(vcl::RenderContext &rRenderContext, const Point &rPoint, const bool bSecond, const bool bEnabled) override
Definition: colex.cxx:493
std::unique_ptr< SwTextGridItem > m_pGridItem
Definition: colex.hxx:47
const Color & GetFontColor() const
Definition: viewopt.cxx:517
static const SwViewOption & GetCurrentViewOptions()
Definition: viewopt.cxx:605
constexpr tools::Long GetWidth() const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr void SetRight(tools::Long v)
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
constexpr tools::Long Right() const
constexpr void SetBottom(tools::Long v)
constexpr Point TopRight() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr Point BottomLeft() const
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea)
weld::DrawingArea * GetDrawingArea() const
Size const & GetOutputSizePixel() const
virtual OutputDevice & get_ref_device()=0
virtual void set_size_request(int nWidth, int nHeight)=0
void FitToActualSize(SwFormatCol &rCol, sal_uInt16 nWidth)
Definition: colmgr.cxx:35
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
std::vector< SwColumn > SwColumns
Definition: fmtclds.hxx:57
@ COLADJ_BOTTOM
Definition: fmtclds.hxx:64
@ COLADJ_CENTER
Definition: fmtclds.hxx:63
@ COLADJ_NONE
Definition: fmtclds.hxx:61
@ COLADJ_TOP
Definition: fmtclds.hxx:62
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(121)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
Returns the item set associated with a character/inet/auto style.
Definition: atrstck.cxx:133
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
Definition: format.hxx:41
int i
long Long
PAPER_A4
static SfxItemSet & rSet
@ GRID_LINES_CHARS
Definition: tgrditem.hxx:30
SVXCORE_DLLPUBLIC void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
sal_Int32 nLength