36const int separatorHeight = 10;
37const int nSpacing = 5;
59 int nHeight = nSpacing * 2;
62 bool bHasIcon =
false;
63 for (
size_t nCur = 0; nCur <
nCount; ++nCur)
71 if (bHasIcon &&
nCount > 1)
78 pImpl->SetEntryHeight();
86 if (!aBoxSize.
Width())
102 pImpl->UpdateContextBmpWidthMax(&rEntry);
105 short nTempEntryHeight = entrySize.
Height();
106 short nTempEntryWidth = entrySize.
Width();
108 Point aEntryPos(nX, nY);
117 if (aOutputSize.
getHeight() < nTempEntryHeight)
118 nTempEntryHeight = aOutputSize.
getHeight();
122 bool bCurFontIsSel =
false;
127 aHighlightFont.
SetColor(aHighlightTextColor);
131 rRenderContext.
SetFont(aHighlightFont);
132 bCurFontIsSel =
true;
135 bool bFillColorSet =
false;
161 bFillColorSet =
true;
163 if (nTempEntryWidth > 1)
164 rRenderContext.
DrawRect({ aEntryPos,
Size(nTempEntryWidth, nTempEntryHeight) });
168 const size_t nItemCount = rEntry.
ItemCount();
169 size_t nIconItem = nItemCount;
171 int nLabelHeight = 0;
172 std::vector<size_t> aTextItems;
174 for (
size_t nCurItem = 0; nCurItem < nItemCount; ++nCurItem)
181 nIconItem = nCurItem;
185 aTextItems.push_back(nCurItem);
187 nLabelHeight += nItemHeight;
190 int nLabelYPos = nY + nTempEntryHeight - nLabelHeight - nSpacing;
191 for (
auto nCurItem : aTextItems)
193 aEntryPos.
setY(nLabelYPos);
196 nLabelYPos += nItemHeight;
198 rEntry.
GetItem(nCurItem).
Paint(aEntryPos, *
this, rRenderContext, pViewDataEntry, rEntry);
205 if (nIconItem < nItemCount)
208 auto nItemWidth = rItem.
GetWidth(
this, pViewDataEntry, nIconItem);
214 aEntryPos.
AdjustX((nTempEntryWidth - nItemWidth) / 2);
216 int nImageAreaHeight = nTempEntryHeight - nSpacing * 2;
217 if (nLabelHeight > 0)
219 nImageAreaHeight -= nLabelHeight + nSpacing;
221 aEntryPos.
AdjustY((nImageAreaHeight - nItemHeight) / 2 + nSpacing);
223 rItem.
Paint(aEntryPos, *
this, rRenderContext, pViewDataEntry, rEntry);
229 rRenderContext.
SetFont(aBackupFont);
237 if (
auto xAccParent = pParent->GetAccessible())
241 return pImpl->m_aFactoryAccess.getFactory().createAccessibleIconView(*
this, xAccParent);
264 css::uno::Sequence<css::beans::PropertyValue> aFilterData{
269 if (aPNGWriter.
write(aImage))
273 OStringBuffer
aBuffer(
"data:image/png;base64,");
275 return aBuffer.makeStringAndClear();
306 if (
const OUString tooltip =
GetEntryTooltip(pEntry); !tooltip.isEmpty())
307 rJsonWriter.
put(
"tooltip", tooltip);
310 rJsonWriter.
put(
"selected",
true);
313 rJsonWriter.
put(
"separator",
true);
324 rJsonWriter.
put(
"type",
"iconview");
326 auto aNode = rJsonWriter.
startArray(
"entries");
const StyleSettings & GetStyleSettings() const
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
std::tuple< tools::JsonWriter &, SvTreeListEntry *, std::string_view > json_prop_query
virtual FactoryFunction GetUITestFactory() const override
void DumpEntryAndSiblings(tools::JsonWriter &rJsonWriter, SvTreeListEntry *pEntry)
IconView(vcl::Window *pParent, WinBits nBits)
Link< const json_prop_query &, bool > maDumpElemToPropertyTreeHdl
void PaintEntry(SvTreeListEntry &, tools::Long nX, tools::Long nY, vcl::RenderContext &rRenderContext)
virtual OUString GetEntryAccessibleDescription(SvTreeListEntry *pEntry) const override
virtual void Resize() override
Size GetEntrySize(const SvTreeListEntry &) const
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
Link< SvTreeListEntry *, OUString > maEntryAccessibleDescriptionHdl
virtual tools::Rectangle GetFocusRect(const SvTreeListEntry *, tools::Long) override
virtual void CalcEntryHeight(SvTreeListEntry const *pEntry) override
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
Creates and returns the accessible object of the Box.
BitmapEx GetBitmapEx() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
const Wallpaper & GetBackground() const
void SetTextColor(const Color &rColor)
const Color & GetTextColor() const
const AllSettings & GetSettings() const
const Color & GetFillColor() const
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetDeactiveColor() const
const Color & GetHighlightColor() const
const Color & GetFaceColor() const
const Color & GetHighlightTextColor() const
const Image & GetBitmap1() const
int GetHeight(const SvTreeListBox *pView, const SvTreeListEntry *pEntry) const
virtual SvLBoxItemType GetType() const =0
virtual void Paint(const Point &rPos, SvTreeListBox &rOutDev, vcl::RenderContext &rRenderContext, const SvViewDataEntry *pView, const SvTreeListEntry &rEntry)=0
int GetWidth(const SvTreeListBox *pView, const SvTreeListEntry *pEntry) const
bool IsSelected(const SvTreeListEntry *pEntry) const
void SetEntryWidth(short nWidth)
friend class IconViewImpl
virtual void Resize() override
bool GetActivateOnSingleClick() const
OUString GetEntryTooltip(SvTreeListEntry *pEntry) const
Point GetEntryPosition(const SvTreeListEntry *) const
Size GetOutputSizePixel() const
short GetEntryHeight() const
virtual OUString GetEntryAccessibleDescription(SvTreeListEntry *pEntry) const
SvViewDataEntry * GetViewDataEntry(SvTreeListEntry const *pEntry) const
SvTreeListEntry * First() const
short GetColumnsCount() const
std::unique_ptr< SvImpLBox > pImpl
short GetEntryWidth() const
SvTreeList * GetModel() const
SvTreeListEntry * NextSibling() const
const SvLBoxItem * GetFirstItem(SvLBoxItemType eType) const
SvTLEntryFlags GetFlags() const
const SvLBoxItem & GetItem(size_t nPos) const
sal_uInt32 GetAbsPos(const SvTreeListEntry *pEntry) const
View-dependent data for a tree list entry created in the virtual function SvTreeListBox::CreateViewDa...
bool IsHighlighted() const
const Color & GetColor() const
void SetColor(const Color &rColor)
static void encode(OUStringBuffer &aStrBuffer, const css::uno::Sequence< sal_Int8 > &aPass)
void SetColor(const Color &)
void setParameters(css::uno::Sequence< css::beans::PropertyValue > const &rParameters)
bool write(const BitmapEx &rBitmap)
void SetFont(const vcl::Font &rNewFont)
vcl::Window * GetAccessibleParentWindow() const
const vcl::Font & GetFont() const
virtual css::uno::Reference< css::awt::XVclWindowPeer > GetComponentInterface(bool bCreate=true)
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
Size GetOutputSizePixel() const
virtual OUString GetText() const
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
static OString extractPngString(const SvLBoxContextBmp *pBmpItem)
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
Sequence< sal_Int8 > aSeq
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
WinBits const WB_HIDESELECTION
std::unique_ptr< char[]> aBuffer