include/vcl/weld.hxx | 3 +++ include/vcl/window.hxx | 3 +++ vcl/inc/qt5/QtInstanceWidget.hxx | 4 ++++ vcl/inc/salvtables.hxx | 4 ++++ vcl/inc/window.h | 1 + vcl/qt5/QtInstanceWidget.cxx | 4 ++++ vcl/source/app/salvtables.cxx | 4 ++++ vcl/source/window/window2.cxx | 15 +++++++++++++++ vcl/unx/gtk3/gtkinst.cxx | 9 +++++++++ 9 files changed, 47 insertions(+)
New commits: commit ff44d68f575e00c59776006c46f8eaba783e59b7 Author: Henry Castro <[email protected]> AuthorDate: Wed Feb 4 08:11:05 2026 -0400 Commit: Caolán McNamara <[email protected]> CommitDate: Wed Feb 11 08:53:25 2026 +0100 vcl: add Cargo text generic data It's useful to send generic custom JSON properties to the client side. Signed-off-by: Henry Castro <[email protected]> Change-Id: Ic58dc0ade0e1c247a68eac4164b5c2afe6ecc631 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198684 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 277686c5061f..7c3359818918 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -301,6 +301,9 @@ public: virtual bool get_direction() const = 0; virtual void set_direction(bool bRTL) = 0; + virtual const OUString& get_cargo_text() = 0; + virtual void set_cargo_text(const OUString& rCargo) = 0; + /* Increases the freeze count on widget. If the freeze count is non-zero, emission of the widget's notifications diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index d74424b98b5e..b50234a16505 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1060,6 +1060,9 @@ public: void SetHelpId( const OUString& ); const OUString& GetHelpId() const; + void SetCargoText( const OUString& rCargoText ); + const OUString& GetCargoText() const; + sal_uInt16 GetChildCount() const; vcl::Window* GetChild( sal_uInt16 nChild ) const; vcl::Window* GetWindow( GetWindowType nType ) const; diff --git a/vcl/inc/qt5/QtInstanceWidget.hxx b/vcl/inc/qt5/QtInstanceWidget.hxx index b63376208200..8ae1ecad2023 100644 --- a/vcl/inc/qt5/QtInstanceWidget.hxx +++ b/vcl/inc/qt5/QtInstanceWidget.hxx @@ -136,6 +136,10 @@ public: virtual void set_direction(bool) override; + const OUString& get_cargo_text() override; + + void set_cargo_text(const OUString& rCargo) override; + virtual void freeze() override; virtual void thaw() override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 62dc0e8ea8db..850c3f85fdcb 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -358,6 +358,10 @@ public: virtual void set_direction(bool bRTL) override; + virtual const OUString& get_cargo_text() override; + + virtual void set_cargo_text(const OUString& rCargo) override; + virtual void freeze() override; virtual void thaw() override; diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 26aecbf6b7ee..fa7955d909ef 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -282,6 +282,7 @@ public: OUString maHelpText; OUString maQuickHelpText; OUString maID; + OUString maCargoText; InputContext maInputContext; css::uno::Reference< css::awt::XVclWindowPeer > mxWindowPeer; css::uno::Reference< css::accessibility::XAccessible > mxAccessible; diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx index 6636e3f1c956..47eb148a51ab 100644 --- a/vcl/qt5/QtInstanceWidget.cxx +++ b/vcl/qt5/QtInstanceWidget.cxx @@ -471,6 +471,10 @@ bool QtInstanceWidget::get_direction() const return false; } +const OUString& QtInstanceWidget::get_cargo_text() {} + +void QtInstanceWidget::set_cargo_text(const OUString& /*rCargo*/) { return EMPTY_OUSTRING; } + void QtInstanceWidget::set_direction(bool) { assert(false && "Not implemented yet"); } void QtInstanceWidget::freeze(){}; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 6c2429e19265..78adf725cc76 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -616,6 +616,10 @@ bool SalInstanceWidget::get_direction() const { return m_xWidget->IsRTLEnabled() void SalInstanceWidget::set_direction(bool bRTL) { m_xWidget->EnableRTL(bRTL); } +const OUString& SalInstanceWidget::get_cargo_text() { return m_xWidget->GetCargoText(); }; + +void SalInstanceWidget::set_cargo_text(const OUString& rCargo) { m_xWidget->SetCargoText(rCargo); } + void SalInstanceWidget::freeze() { if (m_nFreezeCount == 0) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index f4e9830eade1..c19330746908 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -36,6 +36,7 @@ #include <vcl/settings.hxx> #include <vcl/builder.hxx> #include <o3tl/string_view.hxx> +#include <tools/json_writer.hxx> #include <window.h> #include <svdata.hxx> @@ -1323,6 +1324,20 @@ const OUString& Window::GetQuickHelpText() const return mpWindowImpl->maQuickHelpText; } +void Window::SetCargoText( const OUString& rCargoText ) +{ + if (mpWindowImpl) + mpWindowImpl->maCargoText = rCargoText; +} + +const OUString& Window::GetCargoText() const +{ + if (mpWindowImpl) + return mpWindowImpl->maCargoText; + + return EMPTY_OUSTRING; +} + bool Window::IsCreatedWithToolkit() const { return mpWindowImpl->mbCreatedWithToolkit; diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 775bd43167be..da42a85659d6 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -4198,6 +4198,15 @@ public: gtk_widget_set_direction(m_pWidget, bRTL ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); } + const OUString& get_cargo_text() override + { + return EMPTY_OUSTRING; + } + + void set_cargo_text(const OUString& /*rCargo*/) override + { + } + virtual void freeze() override { ++m_nFreezeCount;
