summaryrefslogtreecommitdiff
path: root/vcl/inc/jsdialog/jsdialogbuilder.hxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2024-06-27 11:11:13 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2024-07-09 07:50:31 +0200
commitfcad7309358bc66dd37f37b64d30be841bd61832 (patch)
treef2862c58c1d2771db7ddb0ca67759e1c4a406b5b /vcl/inc/jsdialog/jsdialogbuilder.hxx
parent2e25618fe7370e9f378da0b03bca8fac471f01f3 (diff)
jsdialog: support on demand rendering for icon view
- rename action: rendered_combobox_entry -> rendered_entry - change generic get json property callback to more specialized image getter as it wasn't used anywhere apart of that and we need image enceded as base64 only not JSON - add to the full update of icon view "ondemand" property to the entries with images so LOK client will know it has to download the render - it will be possible to support HiDPI renders in the future: added TODO Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I83a6e91133f8f9cb03e0bc794b51e1947435fa90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170160 Tested-by: Jenkins
Diffstat (limited to 'vcl/inc/jsdialog/jsdialogbuilder.hxx')
-rw-r--r--vcl/inc/jsdialog/jsdialogbuilder.hxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 7491582e1550..ee4105e5d7b4 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -355,6 +355,12 @@ public:
virtual void sendClosePopup(vcl::LOKWindowId nWindowId) = 0;
};
+class SAL_LOPLUGIN_ANNOTATE("crosscast") OnDemandRenderingHandler
+{
+public:
+ virtual void render_entry(int pos, int dpix, int dpiy) = 0;
+};
+
template <class BaseInstanceClass, class VclClass>
class JSWidget : public BaseInstanceClass, public BaseJSWidget
{
@@ -619,7 +625,8 @@ public:
virtual void set_active(int pos) override;
};
-class JSComboBox final : public JSWidget<SalInstanceComboBoxWithEdit, ::ComboBox>
+class JSComboBox final : public JSWidget<SalInstanceComboBoxWithEdit, ::ComboBox>,
+ public OnDemandRenderingHandler
{
public:
JSComboBox(JSDialogSender* pSender, ::ComboBox* pComboBox, SalInstanceBuilder* pBuilder,
@@ -633,7 +640,8 @@ public:
virtual void set_active_id(const OUString& rText) override;
virtual bool changed_by_direct_pick() const override;
- void render_entry(int pos, int dpix, int dpiy);
+ // OnDemandRenderingHandler
+ virtual void render_entry(int pos, int dpix, int dpiy) override;
};
class JSNotebook final : public JSWidget<SalInstanceNotebook, ::TabControl>
@@ -807,7 +815,8 @@ public:
virtual void set_expanded(bool bExpand) override;
};
-class JSIconView final : public JSWidget<SalInstanceIconView, ::IconView>
+class JSIconView final : public JSWidget<SalInstanceIconView, ::IconView>,
+ public OnDemandRenderingHandler
{
public:
JSIconView(JSDialogSender* pSender, ::IconView* pIconView, SalInstanceBuilder* pBuilder,
@@ -824,6 +833,9 @@ public:
virtual void clear() override;
virtual void select(int pos) override;
virtual void unselect(int pos) override;
+
+ // OnDemandRenderingHandler
+ virtual void render_entry(int pos, int dpix, int dpiy) override;
};
class JSRadioButton final : public JSWidget<SalInstanceRadioButton, ::RadioButton>