34const int separatorHeight = 10;
35const int nSpacing = 5;
57 int nHeight = nSpacing * 2;
60 bool bHasIcon =
false;
61 for (
size_t nCur = 0; nCur <
nCount; ++nCur)
69 if (bHasIcon &&
nCount > 1)
76 pImpl->SetEntryHeight();
84 if (!aBoxSize.
Width())
100 pImpl->UpdateContextBmpWidthMax(&rEntry);
103 short nTempEntryHeight = entrySize.
Height();
104 short nTempEntryWidth = entrySize.
Width();
106 Point aEntryPos(nX, nY);
115 if (aOutputSize.
getHeight() < nTempEntryHeight)
116 nTempEntryHeight = aOutputSize.
getHeight();
120 bool bCurFontIsSel =
false;
125 aHighlightFont.
SetColor(aHighlightTextColor);
129 rRenderContext.
SetFont(aHighlightFont);
130 bCurFontIsSel =
true;
133 bool bFillColorSet =
false;
159 bFillColorSet =
true;
161 if (nTempEntryWidth > 1)
162 rRenderContext.
DrawRect({ aEntryPos,
Size(nTempEntryWidth, nTempEntryHeight) });
166 const size_t nItemCount = rEntry.
ItemCount();
167 size_t nIconItem = nItemCount;
169 int nLabelHeight = 0;
170 std::vector<size_t> aTextItems;
172 for (
size_t nCurItem = 0; nCurItem < nItemCount; ++nCurItem)
179 nIconItem = nCurItem;
183 aTextItems.push_back(nCurItem);
185 nLabelHeight += nItemHeight;
188 int nLabelYPos = nY + nTempEntryHeight - nLabelHeight - nSpacing;
189 for (
auto nCurItem : aTextItems)
191 aEntryPos.setY(nLabelYPos);
194 nLabelYPos += nItemHeight;
196 rEntry.
GetItem(nCurItem).
Paint(aEntryPos, *
this, rRenderContext, pViewDataEntry, rEntry);
203 if (nIconItem < nItemCount)
206 auto nItemWidth = rItem.
GetWidth(
this, pViewDataEntry, nIconItem);
212 aEntryPos.AdjustX((nTempEntryWidth - nItemWidth) / 2);
214 int nImageAreaHeight = nTempEntryHeight - nSpacing * 2;
215 if (nLabelHeight > 0)
217 nImageAreaHeight -= nLabelHeight + nSpacing;
219 aEntryPos.AdjustY((nImageAreaHeight - nItemHeight) / 2 + nSpacing);
221 rItem.
Paint(aEntryPos, *
this, rRenderContext, pViewDataEntry, rEntry);
227 rRenderContext.
SetFont(aBackupFont);
235 if (
auto xAccParent = pParent->GetAccessible())
239 return pImpl->m_aFactoryAccess.getFactory().createAccessibleIconView(*
this, xAccParent);
265 OStringBuffer
aBuffer(
"data:image/png;base64,");
267 return aBuffer.makeStringAndClear();
283 rJsonWriter.
put(
"text",
static_cast<const SvLBoxString*
>(pIt)->GetText());
293 if (
const OUString tooltip = pTabListBox->
GetEntryTooltip(pEntry); !tooltip.isEmpty())
294 rJsonWriter.
put(
"tooltip", tooltip);
297 rJsonWriter.
put(
"selected",
true);
300 rJsonWriter.
put(
"separator",
true);
311 rJsonWriter.
put(
"type",
"iconview");
313 auto aNode = rJsonWriter.
startArray(
"entries");
const StyleSettings & GetStyleSettings() const
static ErrCode Export(SvStream &rOStm, const Graphic &rGraphic, ConvertDataFormat nFormat)
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual FactoryFunction GetUITestFactory() const override
IconView(vcl::Window *pParent, WinBits nBits)
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
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 SetFont(const vcl::Font &rNewFont)
vcl::Window * GetAccessibleParentWindow() const
const vcl::Font & GetFont() const
virtual css::uno::Reference< css::awt::XWindowPeer > 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
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
static void lcl_DumpEntryAndSiblings(tools::JsonWriter &rJsonWriter, SvTreeListEntry *pEntry, const SvTreeListBox *pTabListBox)
static OString extractPngString(const SvLBoxContextBmp *pBmpItem)
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
Sequence< sal_Int8 > aSeq
WinBits const WB_HIDESELECTION
std::unique_ptr< char[]> aBuffer