46 if (!aBoxSize.
Width())
85 const int nSpacing = 5;
87 pImpl->UpdateContextBmpWidthMax(&rEntry);
92 Point aEntryPos(nX, nY);
101 if (aOutputSize.
getHeight() < nTempEntryHeight)
102 nTempEntryHeight = aOutputSize.
getHeight();
106 bool bCurFontIsSel =
false;
111 aHighlightFont.SetColor(aHighlightTextColor);
115 rRenderContext.
SetFont(aHighlightFont);
116 bCurFontIsSel =
true;
119 bool bFillColorSet =
false;
149 bFillColorSet =
true;
151 if (nTempEntryWidth > 1)
152 rRenderContext.
DrawRect({ aEntryPos,
Size(nTempEntryWidth, nTempEntryHeight) });
156 const size_t nItemCount = rEntry.
ItemCount();
157 size_t nIconItem = nItemCount;
159 int nLabelHeight = 0;
160 std::vector<size_t> aTextItems;
162 for (
size_t nCurItem = 0; nCurItem < nItemCount; ++nCurItem)
169 nIconItem = nCurItem;
173 aTextItems.push_back(nCurItem);
175 nLabelHeight += nItemHeight;
178 int nLabelYPos = nY + nTempEntryHeight - nLabelHeight - nSpacing;
179 for (
auto nCurItem : aTextItems)
181 aEntryPos.setY(nLabelYPos);
184 nLabelYPos += nItemHeight;
186 rEntry.
GetItem(nCurItem).
Paint(aEntryPos, *
this, rRenderContext, pViewDataEntry, rEntry);
193 if (nIconItem < nItemCount)
196 auto nItemWidth = rItem.
GetWidth(
this, pViewDataEntry, nIconItem);
202 aEntryPos.AdjustX((nTempEntryWidth - nItemWidth) / 2);
204 int nImageAreaHeight = nTempEntryHeight - nSpacing * 2;
205 if (nLabelHeight > 0)
207 nImageAreaHeight -= nLabelHeight + nSpacing;
209 aEntryPos.AdjustY((nImageAreaHeight - nItemHeight) / 2 + nSpacing);
211 rItem.
Paint(aEntryPos, *
this, rRenderContext, pViewDataEntry, rEntry);
217 rRenderContext.
SetFont(aBackupFont);
229 css::uno::Sequence<sal_Int8>
aSeq(static_cast<sal_Int8 const*>(aOStm.
GetData()),
231 OUStringBuffer
aBuffer(
"data:image/png;base64,");
233 return aBuffer.makeStringAndClear();
249 rJsonWriter.
put(
"text", static_cast<const SvLBoxString*>(pIt)->GetText());
260 rJsonWriter.
put(
"selected",
"true");
262 rJsonWriter.
put(
"row",
272 rJsonWriter.
put(
"type",
"iconview");
273 auto aNode = rJsonWriter.
startArray(
"entries");
IconView(vcl::Window *pParent, WinBits nBits)
const Color & GetTextColor() const
const Wallpaper & GetBackground() const
const Color & GetDeactiveColor() const
const Color & GetBackColor() const
void setWidth(tools::Long nWidth)
const Color & GetHighlightTextColor() const
bool IsHighlighted() const
SvTreeList * GetModel() const
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
const StyleSettings & GetStyleSettings() const
const Color & GetFaceColor() const
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual void SetSizePixel(const Size &rNewSize)
void SetColor(const Color &rColor)
sal_uInt32 GetAbsPos(const SvTreeListEntry *pEntry) const
short GetColumnsCount() const
View-dependent data for a tree list entry created in the virtual function SvTreeListBox::CreateViewDa...
const Color & GetHighlightColor() const
constexpr tools::Long Width() const
int GetHeight(const SvTreeListBox *pView, const SvTreeListEntry *pEntry) const
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
const vcl::Font & GetFont() const
virtual FactoryFunction GetUITestFactory() const override
SvTreeListEntry * NextSibling() const
constexpr tools::Long getHeight() const
static void encode(OUStringBuffer &aStrBuffer, const css::uno::Sequence< sal_Int8 > &aPass)
short GetEntryHeight() const
void DrawRect(const tools::Rectangle &rRect)
virtual void Paint(const Point &rPos, SvTreeListBox &rOutDev, vcl::RenderContext &rRenderContext, const SvViewDataEntry *pView, const SvTreeListEntry &rEntry)=0
short GetEntryWidth() const
void SetEntryWidth(short nWidth)
virtual void Resize() override
static void lcl_DumpEntryAndSiblings(tools::JsonWriter &rJsonWriter, SvTreeListEntry *pEntry, const SvTreeListBox *pTabListBox)
const Color & GetColor() const
bool IsSelected(const SvTreeListEntry *pEntry) const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
std::unique_ptr< SvImpLBox > pImpl
void SetTextColor(const Color &rColor)
SvViewDataEntry * GetViewDataEntry(SvTreeListEntry const *pEntry) const
virtual tools::Rectangle GetFocusRect(const SvTreeListEntry *, tools::Long nEntryPos) override
const Image & GetBitmap1() const
const AllSettings & GetSettings() const
const SvLBoxItem & GetItem(size_t nPos) const
vcl::Window * GetParent() const
virtual void Resize() override
virtual SvLBoxItemType GetType() const =0
int GetWidth(const SvTreeListBox *pView, const SvTreeListEntry *pEntry) const
SvTreeListEntry * First() const
static ErrCode Export(SvStream &rOStm, const Graphic &rGraphic, ConvertDataFormat nFormat)
WinBits const WB_HIDESELECTION
static OUString extractPngString(const SvLBoxContextBmp *pBmpItem)
std::unique_ptr< char[]> aBuffer
Size GetOutputSizePixel() const
void SetFont(const vcl::Font &rNewFont)
VCL_DLLPRIVATE void SetEntryHeight(SvTreeListEntry const *pEntry)
const SvLBoxItem * GetFirstItem(SvLBoxItemType eType) const
Sequence< sal_Int8 > aSeq
BitmapEx GetBitmapEx() const
Size GetOutputSizePixel() const
void setHeight(tools::Long nHeight)
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
void PaintEntry(SvTreeListEntry &, tools::Long nX, tools::Long nY, vcl::RenderContext &rRenderContext)
friend class IconViewImpl
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
const Color & GetFillColor() const