32#define FIXEDLINE_TEXT_BORDER 4
50 const Size& rObjSize,
const Size& rWinSize )
69 Point aPos( nX+rPos.
X(), nY+rPos.
Y() );
99 , m_nMaxWidthChars(-1)
100 , m_nMinWidthChars(-1)
101 , m_pMnemonicWindow(nullptr)
135 bool bFillLayout)
const
162 bFillLayout ? &
mxLayoutData->m_aUnicodeBoundRects :
nullptr,
171 bool bEnableTransparent =
true;
184 bEnableTransparent =
false;
187 if (bEnableTransparent)
221 if ( bBorder || bBackground )
235 ImplDraw( pDev, nFlags, aPos, aSize );
316 if ( aSize.
Width() < 0 )
318 if ( aSize.
Height() <= 0 )
331 sal_Int32 nMaxAvailWidth = 0x7fffffff;
337 aBuf.makeStringAndClear(), 0x7fffffff).
Width();
345 aBuf.makeStringAndClear(), 0x7fffffff);
378 if (rKey ==
"max-width-chars")
380 else if (rKey ==
"width-chars")
382 else if (rKey ==
"ellipsize")
385 nBits &= ~WB_PATHELLIPSIS;
386 if (rValue !=
"none")
388 SAL_WARN_IF(rValue !=
"end",
"vcl.layout",
"Only endellipsis support for now");
434 :
Edit(pParent, nStyle)
460 rJsonWriter.
put(
"type",
"fixedtext");
461 rJsonWriter.
put(
"selectable",
true);
521 Point aTextPt(aStartPt);
523 rRenderContext.
DrawText(aTextPt, aText, 0, aText.getLength());
524 rRenderContext.
Pop();
668 rJsonWriter.
put(
"type",
"separator");
839 pDev->
DrawImage( rPos, rSize, *pImage, nStyle );
843 pDev->
DrawImage( aPos, *pImage, nStyle );
963 if (rKey ==
"icon-size")
966 nBits &= ~WB_SMALLSTYLE;
980 rJsonWriter.
put(
"type",
"image");
987 OStringBuffer
aBuffer(
"data:image/png;base64,");
const StyleSettings & GetStyleSettings() const
const Size & GetSizePixel() const
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
std::optional< vcl::ControlLayoutData > mxLayoutData
tools::Rectangle DrawControlText(OutputDevice &_rTargetDevice, const tools::Rectangle &_rRect, const OUString &_rStr, DrawTextFlags _nStyle, std::vector< tools::Rectangle > *_pVector, OUString *_pDisplayText, const Size *i_pDeviceSize=nullptr) const
draws the given text onto the given device
virtual void StateChanged(StateChangedType nStateChange) override
virtual void Resize() override
SAL_DLLPRIVATE void ImplDrawFrame(OutputDevice *pDev, tools::Rectangle &rRect)
draws a frame around the give rectangle, onto the given device
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
void DrawFrame(const tools::Rectangle &rRect, const Color &rLeftTopColor, const Color &rRightBottomColor)
void DrawSeparator(const Point &rStart, const Point &rStop, bool bVertical=true)
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
virtual void LoseFocus() override
virtual void SetReadOnly(bool bReadOnly=true)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual void ApplySettings(vcl::RenderContext &) override
virtual void StateChanged(StateChangedType nType) override
SAL_DLLPRIVATE void ImplDraw(OutputDevice *pDev, const Point &rPos, const Size &rSize)
void SetBitmap(const BitmapEx &rBitmap)
FixedBitmap(vcl::Window *pParent, WinBits nStyle=0)
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void Draw(OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags) override
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
virtual void Resize() override
static SAL_DLLPRIVATE WinBits ImplInitStyle(WinBits nStyle)
virtual bool set_property(const OUString &rKey, const OUString &rValue) override
void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
virtual Size GetOptimalSize() const override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void Resize() override
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
virtual void ApplySettings(vcl::RenderContext &) override
FixedImage(vcl::Window *pParent, WinBits nStyle=0)
virtual void StateChanged(StateChangedType nType) override
static SAL_DLLPRIVATE WinBits ImplInitStyle(WinBits nStyle)
SAL_DLLPRIVATE void ImplDraw(OutputDevice *pDev, const Point &rPos, const Size &rSize)
virtual void Draw(OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags) override
static Image loadThemeImage(const OUString &rFileName)
void SetImage(const Image &rImage)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
static SAL_DLLPRIVATE WinBits ImplInitStyle(WinBits nStyle)
SAL_DLLPRIVATE void ImplDraw(vcl::RenderContext &rRenderContext)
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
virtual void Resize() override
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
virtual void Draw(OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags) override
virtual void FillLayoutData() const override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void StateChanged(StateChangedType nType) override
virtual const vcl::Font & GetCanonicalFont(const StyleSettings &_rStyle) const override
virtual const Color & GetCanonicalTextColor(const StyleSettings &_rStyle) const override
virtual Size GetOptimalSize() const override
virtual void ApplySettings(vcl::RenderContext &) override
FixedLine(vcl::Window *pParent, WinBits nStyle=WB_HORZ)
static Size getTextDimensions(Control const *pControl, const OUString &rTxt, tools::Long nMaxWidth)
virtual bool set_property(const OUString &rKey, const OUString &rValue) override
VclPtr< vcl::Window > m_pMnemonicWindow
virtual void StateChanged(StateChangedType nType) override
virtual Size GetOptimalSize() const override
virtual ~FixedText() override
virtual vcl::Window * getAccessibleRelationLabelFor() const override
void setMaxWidthChars(sal_Int32 nWidth)
virtual void Resize() override
static Size CalcMinimumTextSize(Control const *pControl, tools::Long nMaxWidth=0x7fffffff)
virtual const vcl::Font & GetCanonicalFont(const StyleSettings &_rStyle) const override
sal_Int32 m_nMinWidthChars
void set_mnemonic_widget(vcl::Window *pWindow)
FixedText(vcl::Window *pParent, WinBits nStyle=0)
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
sal_Int32 m_nMaxWidthChars
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
void setMinWidthChars(sal_Int32 nWidth)
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
virtual void FillLayoutData() const override
SAL_DLLPRIVATE void ImplDraw(OutputDevice *pDev, SystemTextColorFlags nSystemTextColorFlags, const Point &rPos, const Size &rSize, bool bFillLayout=false) const
static SAL_DLLPRIVATE WinBits ImplInitStyle(WinBits nStyle)
vcl::Window * get_mnemonic_widget() const
Size CalcMinimumSize(tools::Long nMaxWidth=0x7fffffff) const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
static SAL_DLLPRIVATE DrawTextFlags ImplGetTextStyle(WinBits nWinBits)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual const Color & GetCanonicalTextColor(const StyleSettings &_rStyle) const override
virtual void Draw(OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags) override
static ErrCode Export(SvStream &rOStm, const Graphic &rGraphic, ConvertDataFormat nFormat)
BitmapEx GetBitmapEx() const
Size GetSizePixel() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
const vcl::Font & GetFont() const
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
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
Width of the text.
void SetTextColor(const Color &rColor)
void DrawImage(const Point &rPos, const Image &rImage, DrawImageFlags nStyle=DrawImageFlags::NONE)
This is an overloaded member function, provided for convenience. It differs from the above function o...
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
bool IsBackground() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
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)
const AllSettings & GetSettings() const
void IntersectClipRegion(const tools::Rectangle &rRect)
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
virtual void ApplySettings(vcl::RenderContext &) override
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
SelectableFixedText(vcl::Window *pParent, WinBits nStyle)
virtual void LoseFocus() override
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetGroupTextColor() const
StyleSettingsOptions GetOptions() const
const Color & GetLabelTextColor() const
const vcl::Font & GetLabelFont() const
const vcl::Font & GetGroupFont() const
static void encode(OUStringBuffer &aStrBuffer, const css::uno::Sequence< sal_Int8 > &aPass)
void SetOrientation(Degree10 nLineOrientation)
virtual vcl::Window * getAccessibleRelationLabelFor() const
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
const Wallpaper & GetBackground() const
void SetStyle(WinBits nStyle)
void SetFont(const vcl::Font &rNewFont)
bool IsReallyVisible() const
vcl::Window * GetParent() const
WinBits GetPrevStyle() const
const OUString & get_id() const
Get the ID of the window.
virtual void SetSizePixel(const Size &rNewSize)
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
void SetControlBackground()
bool IsUpdateMode() const
bool IsChildTransparentModeEnabled() const
void remove_mnemonic_label(FixedText *pLabel)
vcl::Font GetDrawPixelFont(::OutputDevice const *pDev) const
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Size CalcWindowSize(const Size &rOutSz) const
::OutputDevice const * GetOutDev() const
const Color & GetTextColor() const
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
bool IsControlBackground() const
virtual void DataChanged(const DataChangedEvent &rDCEvt)
const Color & GetControlBackground() const
void SetPaintTransparent(bool bTransparent)
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual OUString GetText() const
void SetBorderStyle(WindowBorderStyle nBorderStyle)
void add_mnemonic_label(FixedText *pLabel)
virtual bool set_property(const OUString &rKey, const OUString &rValue)
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
void EnableChildTransparentMode(bool bEnable=true)
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr auto FIXEDLINE_VIEW_STYLE
constexpr auto FIXEDTEXT_VIEW_STYLE
constexpr auto FIXEDBITMAP_VIEW_STYLE
static Point ImplCalcPos(WinBits nStyle, const Point &rPos, const Size &rObjSize, const Size &rWinSize)
constexpr auto FIXEDIMAGE_VIEW_STYLE
#define FIXEDLINE_TEXT_BORDER
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill='\0')
const sal_Int16 FIXEDLINE
WinBits const WB_EXTRAOFFSET
WinBits const WB_PATHELLIPSIS
WinBits const WB_WORDBREAK
WinBits const WB_SMALLSTYLE
WinBits const WB_NOMULTILINE
std::unique_ptr< char[]> aBuffer