27#include <com/sun/star/text/HoriOrientation.hpp>
28#include <com/sun/star/text/VertOrientation.hpp>
29#include <com/sun/star/text/RelOrientation.hpp>
33#define FLYINFLY_BORDER 3
39 const Color &rFillColor,
const Color &rLineColor)
49 : nHAlign(HoriOrientation::
CENTER)
50 , nHRel(RelOrientation::
FRAME)
51 , nVAlign(VertOrientation::
TOP)
52 , nVRel(RelOrientation::PRINT_AREA)
53 , nWrap(WrapTextMode_NONE)
63 CustomWidgetController::SetDrawingArea(pDrawingArea);
91 CustomWidgetController::StyleUpdated();
107 sal_uInt32 nLTxtBorder;
108 sal_uInt32 nRTxtBorder;
109 sal_uInt32 nTTxtBorder;
110 sal_uInt32 nBTxtBorder;
147 sal_uInt16 nLines =
static_cast<sal_uInt16
>((
aPagePrtArea.
GetHeight() / 2 - nTTxtBorder - nBTxtBorder)
164 GetDefaultFontFlags::OnlyOne, &rRenderContext );
200 case RelOrientation::PAGE_LEFT:
201 case RelOrientation::FRAME_LEFT:
205 case RelOrientation::PAGE_RIGHT:
206 case RelOrientation::FRAME_RIGHT:
236 case RelOrientation::FRAME:
237 case RelOrientation::PAGE_FRAME:
242 case RelOrientation::PRINT_AREA:
243 case RelOrientation::PAGE_PRINT_AREA:
248 case RelOrientation::PAGE_LEFT:
253 case RelOrientation::PAGE_RIGHT:
261 case RelOrientation::PRINT_AREA:
262 case RelOrientation::PAGE_PRINT_AREA:
267 case RelOrientation::FRAME:
268 case RelOrientation::PAGE_FRAME:
280 case RelOrientation::FRAME:
281 case RelOrientation::PAGE_FRAME:
286 case RelOrientation::PRINT_AREA:
287 case RelOrientation::PAGE_PRINT_AREA:
292 case RelOrientation::PAGE_LEFT:
297 case RelOrientation::PAGE_RIGHT:
305 case RelOrientation::FRAME:
306 case RelOrientation::PAGE_FRAME:
311 case RelOrientation::PRINT_AREA:
312 case RelOrientation::PAGE_PRINT_AREA:
324 case RelOrientation::FRAME:
329 case RelOrientation::PRINT_AREA:
334 case RelOrientation::PAGE_LEFT:
339 case RelOrientation::PAGE_RIGHT:
344 case RelOrientation::PAGE_FRAME:
349 case RelOrientation::PAGE_PRINT_AREA:
354 case RelOrientation::FRAME_LEFT:
359 case RelOrientation::FRAME_RIGHT:
364 case RelOrientation::CHAR:
372 case RelOrientation::FRAME:
377 case RelOrientation::PRINT_AREA:
382 case RelOrientation::CHAR:
383 if (
nVAlign != VertOrientation::NONE &&
384 nVAlign != VertOrientation::CHAR_BOTTOM)
391 case RelOrientation::TEXT_LINE:
405 case VertOrientation::NONE:
406 case VertOrientation::TOP:
407 case VertOrientation::CENTER:
408 case VertOrientation::BOTTOM:
419 case VertOrientation::LINE_TOP:
420 case VertOrientation::LINE_CENTER:
421 case VertOrientation::LINE_BOTTOM:
426 case VertOrientation::CHAR_TOP:
427 case VertOrientation::CHAR_CENTER:
428 case VertOrientation::CHAR_BOTTOM:
441 const Color &rFillColor,
const Color &rBorderColor)
443 DrawRect_Impl(rRenderContext, rRect, rFillColor, rBorderColor);
456 for (sal_uInt16
i = 0;
i < nLines;
i++)
491 case HoriOrientation::RIGHT:
496 case HoriOrientation::CENTER:
501 case HoriOrientation::NONE:
508 lXPos = aRect.
Left();
514 lXPos = aRect.
Right() + 2;
522 case VertOrientation::BOTTOM:
523 case VertOrientation::LINE_BOTTOM:
526 if (
nVRel != RelOrientation::TEXT_LINE )
536 case VertOrientation::CENTER:
537 case VertOrientation::LINE_CENTER:
542 case VertOrientation::NONE:
545 if (
nVRel != RelOrientation::CHAR &&
nVRel != RelOrientation::TEXT_LINE )
553 if (
nVRel != RelOrientation::TEXT_LINE )
568 case VertOrientation::CENTER:
569 case VertOrientation::CHAR_CENTER:
570 case VertOrientation::LINE_CENTER:
574 case VertOrientation::TOP:
575 case VertOrientation::CHAR_BOTTOM:
576 case VertOrientation::LINE_BOTTOM:
593 if (aFrmRect.
Left() < pOuterFrame->
Left())
594 aFrmRect.
Move(pOuterFrame->
Left() - aFrmRect.
Left(), 0);
598 if (aFrmRect.
Top() < pOuterFrame->
Top())
599 aFrmRect.
Move(0, pOuterFrame->
Top() - aFrmRect.
Top());
634 (
nHRel == RelOrientation::CHAR ||
nVRel == RelOrientation::CHAR ||
635 nVRel == RelOrientation::TEXT_LINE );
637 for (sal_uInt16
i = 0;
i < nLines; ++
i)
639 if (
i == (nLines - 1))
646 case WrapTextMode_NONE:
651 case WrapTextMode_LEFT:
655 case WrapTextMode_RIGHT:
668 aTxt.
Move(0, -nStep);
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
tools::Long GetDescent() const
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
FontMetric GetFontMetric() const
tools::Long GetTextHeight() const
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetWindowColor() const
bool GetHighContrastMode() const
tools::Rectangle aDrawObj
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Color m_aBorderCol
frame of doc
Color m_aFrameColor
graphic frame
tools::Rectangle aParaPrtArea
Color m_aTransColor
transparency
void InitAllRects_Impl(vcl::RenderContext &rRenderContext)
void SetRelPos(const Point &rP)
Color m_aAlignColor
align anchor
void CalcBoundRect_Impl(const vcl::RenderContext &rRenderContext, tools::Rectangle &rRect)
tools::Rectangle DrawInnerFrame_Impl(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect, const Color &rFillColor, const Color &rBorderColor)
tools::Rectangle aFrameAtFrame
tools::Rectangle aAutoCharFrame
tools::Rectangle aPagePrtArea
Color m_aTxtCol
symbolised text
Color m_aPrintAreaCol
frame of printable area of doc
virtual void StyleUpdated() override
Color m_aBlankFrameCol
frame of symbol for blank
Color m_aBlankCol
area of symbol for blank
tools::Rectangle aTextLine
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
css::text::WrapTextMode nWrap
void SetFontSize(const Size &)
void SetFillColor(const Color &)
void SetColor(const Color &)
void SetWeight(FontWeight)
constexpr ::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_LIGHTGREEN(0x00, 0xFF, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr OUStringLiteral DEMOTEXT