30#include <com/sun/star/beans/PropertyValue.hpp>
43 CustomWidgetController::SetDrawingArea(pDrawingArea);
72 return CustomWidgetController::MouseButtonDown(rMEvt);
92 if (rCommandEvent.
GetCommand() == CommandEventId::ContextMenu)
118 std::unique_ptr<weld::Builder> xBuilder(
120 std::unique_ptr<weld::Menu> xItemMenu(xBuilder->weld_menu(
"charviewmenu"));
128 if (rMenuId ==
u"clearchar")
130 else if (rMenuId ==
u"clearallchar")
146 const OUString aText =
GetText();
152 bool bGotBoundary =
true;
153 bool bShrankFont =
false;
158 for (
tools::Long nFontHeight = aFontSize.
Height(); nFontHeight > 0; nFontHeight -= 1)
162 bGotBoundary =
false;
168 if (nAvailWidth > nTextWidth)
185 aBoundRect += aPoint;
188 int nYLDelta = aBoundRect.
Top();
191 aPoint.
AdjustY(-(nYLDelta - 1));
192 else if (nYHDelta <= 0)
206 rRenderContext.
DrawText(aPoint, aText);
215 rRenderContext.
DrawText(aPoint, aText);
221 rRenderContext.
SetFont(aOrigFont);
250 mnY = (nWinHeight -
mxVirDev->GetTextHeight()) / 2;
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetClicks() const
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
bool GetTextBoundRect(tools::Rectangle &rRect, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, KernArraySpan aDXArray=KernArraySpan(), o3tl::span< const sal_Bool > pKashidaArray={}, const SalLayoutGlyphs *pGlyphs=nullptr) const
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
void SetTextColor(const Color &rColor)
tools::Long GetTextHeight() const
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)
void setX(tools::Long nX)
tools::Long AdjustY(tools::Long nVertMove)
constexpr tools::Long Height() const
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetWindowColor() const
const Color & GetFieldTextColor() const
const Color & GetShadowColor() const
const vcl::Font & GetLabelFont() const
const Color & GetWindowTextColor() const
const Color & GetHighlightColor() const
const Color & GetHighlightTextColor() const
vcl::Font const & GetFont() const
SvxCharView(const VclPtr< VirtualDevice > &rVirDev)
virtual void GetFocus() override
void setMouseClickHdl(const Link< SvxCharView *, void > &rLink)
void SetFont(const vcl::Font &rFont)
void SetHasInsert(bool bInsert)
void ContextMenuSelect(std::u16string_view rIdent)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual bool Command(const CommandEvent &) override
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Link< SvxCharView *, void > maClearClickHdl
void SetText(const OUString &rText)
Link< SvxCharView *, void > maMouseClickHdl
void createContextMenu(const Point &rPosition)
virtual void LoseFocus() override
VclPtr< VirtualDevice > mxVirDev
virtual bool KeyInput(const KeyEvent &) override
Link< SvxCharView *, void > maClearAllClickHdl
void setClearClickHdl(const Link< SvxCharView *, void > &rLink)
void setClearAllClickHdl(const Link< SvxCharView *, void > &rLink)
virtual bool MouseButtonDown(const MouseEvent &) override
OUString const & GetText() const
virtual void Resize() override
void SetFontSize(const Size &)
void SetTransparent(bool bTransparent)
void SetWeight(FontWeight)
const OUString & GetFamilyName() const
const Size & GetFontSize() const
void SetAlignment(TextAlign)
sal_uInt16 GetCode() const
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_SPACE
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
void SetPointFont(OutputDevice &rDevice, const vcl::Font &rFont)