summaryrefslogtreecommitdiff
path: root/include/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'include/vcl')
-rw-r--r--include/vcl/svlbitm.hxx3
-rw-r--r--include/vcl/treelistbox.hxx11
-rw-r--r--include/vcl/weld.hxx26
-rw-r--r--include/vcl/weldutils.hxx4
4 files changed, 44 insertions, 0 deletions
diff --git a/include/vcl/svlbitm.hxx b/include/vcl/svlbitm.hxx
index dc8cde9bcb02..abe2446ade11 100644
--- a/include/vcl/svlbitm.hxx
+++ b/include/vcl/svlbitm.hxx
@@ -105,6 +105,7 @@ class VCL_DLLPUBLIC SvLBoxString : public SvLBoxItem
{
private:
bool mbEmphasized;
+ bool mbCustom;
double mfAlign;
protected:
OUString maText;
@@ -126,6 +127,8 @@ public:
void Emphasize(bool bEmphasize) { mbEmphasized = bEmphasize; }
bool IsEmphasized() const { return mbEmphasized; }
+ void SetCustomRender() { mbCustom = true; }
+
const OUString& GetText() const
{
return maText;
diff --git a/include/vcl/treelistbox.hxx b/include/vcl/treelistbox.hxx
index 179f27fe4cb6..e56fd1081fb2 100644
--- a/include/vcl/treelistbox.hxx
+++ b/include/vcl/treelistbox.hxx
@@ -177,6 +177,9 @@ namespace o3tl
struct SvTreeListBoxImpl;
+typedef std::pair<vcl::RenderContext&, const SvTreeListEntry&> svtree_measure_args;
+typedef std::tuple<vcl::RenderContext&, const tools::Rectangle&, const SvTreeListEntry&> svtree_render_args;
+
class VCL_DLLPUBLIC SvTreeListBox
:public Control
,public SvListView
@@ -186,6 +189,7 @@ class VCL_DLLPUBLIC SvTreeListBox
,public vcl::ISearchableStringList
{
friend class SvImpLBox;
+ friend class SvLBoxString;
friend class IconViewImpl;
friend class TreeControlPeer;
friend class SalInstanceIconView;
@@ -201,6 +205,8 @@ class VCL_DLLPUBLIC SvTreeListBox
Link<SvTreeListBox*,void> aDeselectHdl;
Link<const CommandEvent&, bool> aPopupMenuHdl;
Link<const HelpEvent&, bool> aTooltipHdl;
+ Link<svtree_render_args, void> aCustomRenderHdl;
+ Link<svtree_measure_args, Size> aCustomMeasureHdl;
Image aPrevInsertedExpBmp;
Image aPrevInsertedColBmp;
@@ -269,6 +275,9 @@ private:
// autowidth for the 1st checkbox column
VCL_DLLPRIVATE void CheckBoxInserted(SvTreeListEntry* pEntry);
+ VCL_DLLPRIVATE void DrawCustomEntry(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect, const SvTreeListEntry& rEntry);
+ VCL_DLLPRIVATE Size MeasureCustomEntry(vcl::RenderContext& rRenderContext, const SvTreeListEntry& rEntry);
+
protected:
bool CheckDragAndDropMode( SvTreeListBox const * pSource, sal_Int8 );
@@ -434,6 +443,8 @@ public:
void SetExpandedHdl(const Link<SvTreeListBox*,void>& rNewHdl){aExpandedHdl=rNewHdl;}
void SetPopupMenuHdl(const Link<const CommandEvent&, bool>& rLink) { aPopupMenuHdl = rLink; }
void SetTooltipHdl(const Link<const HelpEvent&, bool>& rLink) { aTooltipHdl = rLink; }
+ void SetCustomRenderHdl(const Link<svtree_render_args, void>& rLink) { aCustomRenderHdl = rLink; }
+ void SetCustomMeasureHdl(const Link<svtree_measure_args, Size>& rLink) { aCustomMeasureHdl = rLink; }
virtual void ExpandedHdl();
virtual bool ExpandingHdl();
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 15dd5ad91de8..eda59f01783f 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -729,6 +729,12 @@ protected:
Link<bool&, bool> m_aDragBeginHdl;
std::function<int(const weld::TreeIter&, const weld::TreeIter&)> m_aCustomSort;
+public:
+ typedef std::pair<vcl::RenderContext&, const OUString&> get_size_args;
+ typedef std::tuple<vcl::RenderContext&, const tools::Rectangle&, bool, const OUString&>
+ render_args;
+
+protected:
std::vector<int> m_aRadioIndexes;
void signal_changed() { m_aChangeHdl.Call(*this); }
@@ -758,6 +764,21 @@ protected:
Link<const TreeIter&, OUString> m_aQueryTooltipHdl;
OUString signal_query_tooltip(const TreeIter& rIter) { return m_aQueryTooltipHdl.Call(rIter); }
+ Link<render_args, void> m_aRenderHdl;
+ void signal_custom_render(vcl::RenderContext& rDevice, const tools::Rectangle& rRect,
+ bool bSelected, const OUString& rId)
+ {
+ m_aRenderHdl.Call(
+ std::tuple<vcl::RenderContext&, const tools::Rectangle, bool, const OUString&>(
+ rDevice, rRect, bSelected, rId));
+ }
+
+ Link<get_size_args, Size> m_aGetSizeHdl;
+ Size signal_custom_get_size(vcl::RenderContext& rDevice, const OUString& rId)
+ {
+ return m_aGetSizeHdl.Call(std::pair<vcl::RenderContext&, const OUString&>(rDevice, rId));
+ }
+
public:
virtual void connect_query_tooltip(const Link<const TreeIter&, OUString>& rLink)
{
@@ -1068,6 +1089,11 @@ public:
OUString const& get_saved_value() const { return m_sSavedValue; }
bool get_value_changed_from_saved() const { return m_sSavedValue != get_selected_text(); }
+ // for custom rendering a cell
+ virtual void set_column_custom_renderer(int nColumn) = 0;
+ void connect_custom_get_size(const Link<get_size_args, Size>& rLink) { m_aGetSizeHdl = rLink; }
+ void connect_custom_render(const Link<render_args, void>& rLink) { m_aRenderHdl = rLink; }
+
// for dnd
virtual bool get_dest_row_at_pos(const Point& rPos, weld::TreeIter* pResult) = 0;
virtual tools::Rectangle get_row_area(const weld::TreeIter& rIter) const = 0;
diff --git a/include/vcl/weldutils.hxx b/include/vcl/weldutils.hxx
index 077dab0fa414..cb04f2d74915 100644
--- a/include/vcl/weldutils.hxx
+++ b/include/vcl/weldutils.hxx
@@ -153,7 +153,11 @@ public:
}
};
+// get the row the iterator is on
VCL_DLLPUBLIC size_t GetAbsPos(const weld::TreeView& rTreeView, const weld::TreeIter& rIter);
+
+// an entry is visible if all parents are expanded
+VCL_DLLPUBLIC bool IsEntryVisible(const weld::TreeView& rTreeView, const weld::TreeIter& rIter);
}
#endif