23#include <svx/strings.hrc>
33#include <com/sun/star/style/NumberingType.hpp>
34#include <com/sun/star/container/XIndexAccess.hpp>
35#include <com/sun/star/text/XNumberingFormatter.hpp>
36#include <com/sun/star/beans/PropertyValue.hpp>
40#include <uiobject.hxx>
75 return aDefBulletFont;
79 const OUString& rBulletChar,
const OUString& rText,
const OUString& rFontName,
83 if(NumberingType::CHAR_SPECIAL == nNumberingType )
100 RID_SVXSTR_BULLET_DESCRIPTION_0,
101 RID_SVXSTR_BULLET_DESCRIPTION_1,
102 RID_SVXSTR_BULLET_DESCRIPTION_2,
103 RID_SVXSTR_BULLET_DESCRIPTION_3,
104 RID_SVXSTR_BULLET_DESCRIPTION_4,
105 RID_SVXSTR_BULLET_DESCRIPTION_5,
106 RID_SVXSTR_BULLET_DESCRIPTION_6,
107 RID_SVXSTR_BULLET_DESCRIPTION_7
112 RID_SVXSTR_SINGLENUM_DESCRIPTION_0,
113 RID_SVXSTR_SINGLENUM_DESCRIPTION_1,
114 RID_SVXSTR_SINGLENUM_DESCRIPTION_2,
115 RID_SVXSTR_SINGLENUM_DESCRIPTION_3,
116 RID_SVXSTR_SINGLENUM_DESCRIPTION_4,
117 RID_SVXSTR_SINGLENUM_DESCRIPTION_5,
118 RID_SVXSTR_SINGLENUM_DESCRIPTION_6,
119 RID_SVXSTR_SINGLENUM_DESCRIPTION_7
124 RID_SVXSTR_OUTLINENUM_DESCRIPTION_0,
125 RID_SVXSTR_OUTLINENUM_DESCRIPTION_1,
126 RID_SVXSTR_OUTLINENUM_DESCRIPTION_2,
127 RID_SVXSTR_OUTLINENUM_DESCRIPTION_3,
128 RID_SVXSTR_OUTLINENUM_DESCRIPTION_4,
129 RID_SVXSTR_OUTLINENUM_DESCRIPTION_5,
130 RID_SVXSTR_OUTLINENUM_DESCRIPTION_6,
131 RID_SVXSTR_OUTLINENUM_DESCRIPTION_7
136 static const sal_uInt16 aLinesArr[] =
191 pVDev->EnableRTL( IsRTLEnabled() );
192 pVDev->SetOutputSize( aRectSize );
194 pVDev->SetFillColor( aBackColor );
199 Point aStart(aBLPos.
X() + nRectWidth *25 / 100,0);
200 Point aEnd(aBLPos.
X() + nRectWidth * 9 / 10,0);
201 for( sal_uInt16
i = 11;
i < 100;
i += 33)
203 aStart.
setY( aBLPos.
Y() + nRectHeight *
i / 100 );
204 aEnd.
setY( aStart.
Y() );
205 pVDev->DrawLine(aStart, aEnd);
206 aStart.
setY( aBLPos.
Y() + nRectHeight * (
i + 11) / 100 );
207 aEnd.
setY( aStart.
Y() );
208 pVDev->DrawLine(aStart, aEnd);
216 static constexpr OUStringLiteral sValue(
u"Value");
220 Point aStart(aBLPos.
X() + nRectWidth / 9,0);
221 for( sal_uInt16
i = 0;
i < 3;
i++ )
223 sal_uInt16 nY = 11 +
i * 33;
224 aStart.
setY( aBLPos.
Y() + nRectHeight * nY / 100 );
230 aStart.
setX( aBLPos.
X() + 5 );
239 aLevel.realloc(aLevel.getLength() + 1);
240 PropertyValue& rValue = aLevel.getArray()[aLevel.getLength() - 1];
241 rValue.Name = sValue;
242 rValue.Value <<=
static_cast<sal_Int32
>(
i + 1);
251 aStart.
setX( aBLPos.
X() + 2 );
262 pVDev->SetLineColor(aBackColor);
272 OUString sLevelTexts[5];
273 OUString sFontNames[5];
274 OUString sBulletChars[5];
275 sal_Int16 aNumberingTypes[5];
276 OUString sPrefixes[5];
277 OUString sSuffixes[5];
278 sal_Int16 aParentNumberings[5];
280 sal_Int32 nLevelCount = xLevel->getCount();
283 for( sal_Int32
i = 0;
i < nLevelCount;
i++)
285 tools::Long nTop = nStartY + nRectHeight * (aLinesArr[2 *
i + 11])/100 ;
286 Point aLeft(nStartX + nRectWidth * (aLinesArr[2 *
i + 10])/ 100, nTop );
288 Any aLevelAny = xLevel->getByIndex(
i);
290 aLevelAny >>= aLevel;
291 aNumberingTypes[
i] = 0;
292 aParentNumberings[
i] = 0;
293 for(
const PropertyValue& rProp : std::as_const(aLevel))
295 if ( rProp.Name ==
"NumberingType" )
296 rProp.Value >>= aNumberingTypes[
i];
297 else if ( rProp.Name ==
"BulletFontName" )
298 rProp.Value >>= sFontNames[
i];
299 else if ( rProp.Name ==
"BulletChar" )
300 rProp.Value >>= sBulletChars[
i];
301 else if ( rProp.Name ==
"Prefix" )
302 rProp.Value >>= sPrefixes[
i];
303 else if ( rProp.Name ==
"Suffix" )
304 rProp.Value >>= sSuffixes[
i];
305 else if ( rProp.Name ==
"ParentNumbering" )
306 rProp.Value >>= aParentNumberings[
i];
309 PropertyValue* pProperties =
aProperties.getArray();
310 pProperties[0].Name =
"NumberingType";
311 pProperties[0].Value <<= aNumberingTypes[
i];
312 pProperties[1].Name =
"Value";
313 pProperties[1].Value <<= sal_Int32(1);
324 if(!sPrefixes[
i].isEmpty() &&
327 pVDev->SetFont(aFont);
328 pVDev->DrawText(aLeft, sPrefixes[
i]);
331 if(aParentNumberings[
i])
334 sal_Int32 nStartLevel = std::min(
static_cast<sal_Int32
>(aParentNumberings[
i]),
i);
335 for(sal_Int32 nParentLevel =
i - nStartLevel; nParentLevel <
i; nParentLevel++)
337 OUString sTmp = sLevelTexts[nParentLevel] +
".";
339 aNumberingTypes[nParentLevel],
340 sBulletChars[nParentLevel],
342 sFontNames[nParentLevel],
356 if(!sSuffixes[
i].isEmpty() &&
357 !sSuffixes[
i].startsWith(
" "))
359 pVDev->SetFont(aFont);
360 pVDev->DrawText(aLeft, sSuffixes[
i]);
364 tools::Long nLineTop = nStartY + nRectHeight * aLinesArr[2 *
i + 1]/100 ;
365 Point aLineLeft(aLeft.X(), nLineTop );
366 Point aLineRight(nStartX + nRectWidth * 90 /100, nLineTop );
368 pVDev->DrawLine(aLineLeft, aLineRight);
375 static bool bAssert =
false;
419 for ( sal_uInt16
i = 0;
i < 8;
i++ )
434 const Locale& rLocale )
439 if(aNum.getLength() > 8)
441 for ( sal_Int32
i = 0;
i < aNum.getLength();
i++ )
452 const Locale& rLocale)
469 , aFormatIdle(
"SvxBmpNumValueSet FormatIdle")
470 , bGrfNotFound(false)
502 Size aSize(nRectHeight/8, nRectHeight/8);
512 Point aPos(aBLPos.
X() + 5, 0);
513 for( sal_uInt16
i = 0;
i < 3;
i++ )
515 sal_uInt16 nY = 11 +
i * 33;
516 aPos.
setY( aBLPos.
Y() + nRectHeight * nY / 100 );
517 aGraphic.
Draw(*pDev, aPos, aSize);
528 bGrfNotFound =
false;
PropertiesInfo aProperties
static bool EndLocking(std::u16string_view rThemeName)
static bool GetGraphicObj(std::u16string_view rThemeName, sal_uInt32 nPos, Graphic *pGraphic)
static bool BeginLocking(std::u16string_view rThemeName)
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
static LanguageType getConfiguredSystemLanguage()
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
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
const Color & GetLineColor() const
SAL_DLLPRIVATE void DrawOutDev(const Point &, const Size &, const Point &, const Size &, const Printer &)=delete
const MapMode & GetMapMode() 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)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
void setHeight(tools::Long nHeight)
virtual ~SvxBmpNumValueSet() override
SvxBmpNumValueSet(std::unique_ptr< weld::ScrolledWindow > pScrolledWindow)
virtual void UserDraw(const UserDrawEvent &rUDEvt) override
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
NumberingPageType ePageType
virtual ~SvxNumValueSet() override
css::uno::Reference< css::text::XNumberingFormatter > xFormatter
css::lang::Locale aLocale
VclPtr< VirtualDevice > pVDev
void SetNumberingSettings(const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &aNum, css::uno::Reference< css::text::XNumberingFormatter > const &xFormatter, const css::lang::Locale &rLocale)
virtual FactoryFunction GetUITestFactory() const override
void init(NumberingPageType eType)
tools::Rectangle aOrgRect
void SetOutlineNumberingSettings(css::uno::Sequence< css::uno::Reference< css::container::XIndexAccess > > const &rOutline, css::uno::Reference< css::text::XNumberingFormatter > const &xFormatter, const css::lang::Locale &rLocale)
SvxNumValueSet(std::unique_ptr< weld::ScrolledWindow > pScrolledWindow)
css::uno::Sequence< css::uno::Reference< css::container::XIndexAccess > > aOutlineSettings
virtual void UserDraw(const UserDrawEvent &rUDEvt) override
css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aNumSettings
void SetPriority(TaskPriority ePriority)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
vcl::RenderContext * GetRenderContext() const
const tools::Rectangle & GetRect() const
sal_uInt16 GetItemId() const
void InsertItem(sal_uInt16 nItemId, const Image &rImage)
void SetItemText(sal_uInt16 nItemId, const OUString &rStr)
void SetStyle(WinBits nStyle)
void SetLineCount(sal_uInt16 nNewLines=0)
void SetColCount(sal_uInt16 nNewCols=1)
static VclPtr< reference_type > Create(Arg &&... arg)
void SetFontSize(const Size &)
void SetStyleName(const OUString &rStyleName)
void SetPitch(FontPitch ePitch)
void SetTransparent(bool bTransparent)
void SetFillColor(const Color &)
void SetColor(const Color &)
void SetWeight(FontWeight)
void SetFamily(FontFamily)
void SetCharSet(rtl_TextEncoding)
const Size & GetFontSize() const
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define TOOLS_WARN_EXCEPTION(area, stream)
OUString SvxResId(TranslateId aId)
#define GALLERY_THEME_BULLETS
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
#define LINK(Instance, Class, Member)
const TranslateId RID_SVXSTR_OUTLINENUM_DESCRIPTIONS[]
const sal_Unicode aBulletTypes[]
static vcl::Font & lcl_GetDefaultBulletFont()
static void lcl_PaintLevel(OutputDevice *pVDev, sal_Int16 nNumberingType, const OUString &rBulletChar, const OUString &rText, const OUString &rFontName, Point &rLeft, vcl::Font &rRuleFont, const vcl::Font &rTextFont)
IMPL_LINK_NOARG(SvxBmpNumValueSet, FormatHdl_Impl, Timer *, void)
const TranslateId RID_SVXSTR_BULLET_DESCRIPTIONS[]
const TranslateId RID_SVXSTR_SINGLENUM_DESCRIPTIONS[]