Commit Graph
489 Commits
Author SHA1 Message Date
Xisco Fauli 1cac4f1a69 lok: drop sendDialogEvent
Follow-up of
commit 8a91868e21
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Tue Jun 2 14:53:19 2026 +0200

    drop JSDialog machinery

Change-Id: I61946b9504e0ada95d08d2414195f4ca8eab9ae4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206244
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-09 14:49:09 +02:00
Xisco Fauli 80c1a38018 sfx2: drop IsCommandAllowedInLokReadOnlyViewMode
it allows to drop setAllowChangeComments and setAllowManageRedlines
as well

The logic was relevant for Collabora Online
but it's no longer using this repo

Change-Id: I47a7eeddab000d748ba08896592e9403fdf010fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206240
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-09 14:48:59 +02:00
Xisco Fauli b0e4238a46 svx: remove svx::theme::notifyLOK
The logic was relevant for Collabora Online
but it no longer uses this repo

Change-Id: I11755f26a3ed345eafcf7fe5aeaee850729227eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206162
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-05 21:52:31 +02:00
Xisco Fauli 8a91868e21 drop JSDialog machinery
It's no longer needed and not used internally

Change-Id: Iecb0d1055fd6c61d0c34ffb8afc670ab9d5fe899
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205908
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-06-02 20:15:18 +02:00
Tor Lillqvist 5bc9425900 Avoid illegal names also for the LibreOfficeKitGtk structs
Change-Id: If8b5987e0779ece9518384f88a0363a3c596d7ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197937
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
2026-01-25 22:33:22 +01:00
Tor Lillqvist 3404d99464 Don't use illegal identifiers in LibreOfficeKit
Identifiers with an initial underscore followed by an uppercase letter
are reserved for the C++ implementation.

Change-Id: I3eabc8aa3570b17e05259c0d56d3b16246335ffc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196572
Tested-by: Tor Lillqvist <tml@iki.fi>
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197868
2026-01-23 07:28:03 +01:00
Tor Lillqvist 901b41845c Handle a non-ASCII installation path in LibreOfficeKit on Windows
The new Collabora Office passes the installation path as UTF-8. On
Windows, turn that it into UTF-16 and use the wide character APIs, as
one should.

Add some comments to LibreOffiecKit mentioning this.

Also make lok_dlerror() use wide character APIs on Windows, and return
the message as UTF-8.

The wrappers used for this UTF-8/UTF-16 dance are copies of those in
<tools/UnixWrappers.h> (but with different names), because sadly
including that file in LibreOfficeKitInit.h caused other complicated
problems because LibreOfficeKit is apparently seen as part of the UNO
API when the ODK is constructed.

(It would be *wrong* and unhelpful to try to use system codepage for
pathnames instead of UTF-8. Codepages are obsolete. A proper Windows
program should use the wide character APIs. The Windows file system
has names in UTF-16. Using system codepage will not work for pathnames
that can't be expressed in the system codepage. Such user profile
directories might very well exist on some machines.)

The "normal" parts of core of course already use UTF-16 all over the
place on all platforms with OUString, so core on Windows hopefully
already accesses the file system only using wide character APIs.

Also remove extendUnoPath(). There is no URE/bin folder in a core
instdir any more. (Otherwise, the code in it would have had to be
changed to use wide character system APIs, too.)

Note that this commit by itself is not enough to fix problems when the
new Collabora Office is installed in a location with a non-ASCII
pathname. There are more problems in fontconfig, freetype, and cairo,
most likely. But for other LibreOfficeKit use cases on Windows, where
core is built in a normal manner without the "headless" backend, this
might be enough.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I2458ed98b89abcd18bf6ad658e285fcc55fd28b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196401
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197542
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Jenkins
2026-01-20 08:35:46 +01:00
Andras Timar f90f0c129b typo: LUB -> LIB
Change-Id: I6a433aa37dad11b1e5a2b4124d3af51836598e29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197439
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2026-01-17 07:26:41 +01:00
Andrea Gelmini e7758e6061 Fix typo
Change-Id: Idcb553978e160a61b040bf7523f27010900fbfe3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197206
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
2026-01-14 03:08:10 +01:00
Tor Lillqvist aad13413e5 Clarify that freeError() despite its name is a generic LOKit deallocation API
Especially on Windows it is important to not call free() in your own
code on a pointer returned from some random other dynamic library
(like the one the desktop/source/lib/init.cxx code goes into). It
might have been allocated by calling malloc() (etc) in a C runtime
library that is different from the one used by your code. That will
lead to a crash.

One should alays call the free() in the same C runtime where the
malloc() that allocated the pointer is.

Add a wrapper called freeMemory() to the C++ API.

Change-Id: Ibf9cf6fad2c30c4416d2a1f6badbd161c7ba18a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194594
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197107
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@iki.fi>
2026-01-13 15:31:47 +01:00
Tor Lillqvist d219a50fd5 Use more obvious macro names
Instead of TARGET_LIB, just call it SOFFICEAPP_LIB, as it is the
"sofficeapp" dynamic library that it always refers to. And instead of
TARGET_MERGED_LIB, just call it MERGED_LIB, as that always refers to
the "mergedlo" dynamic library.

Change-Id: Ic3a8f29cd9b168f064bc2d02f15341b5ea1afef0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194593
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197106
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@iki.fi>
2026-01-13 14:03:43 +01:00
Tor Lillqvist e11f21a4d9 Don't even try to load a clearly bogus sofficeapp library
If it is smaller than 1000 bytes it can't be real, it must be the
dummy text file in the --enable-mergelibs case.

Change-Id: Ib3a913830bf34dc1e17955626576e72f5f7cd2d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194592
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197104
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@iki.fi>
2026-01-13 14:03:30 +01:00
Miklos Vajna 6112dac3ab cool#13770 lok: add a file save dialog callback
Commit f4b9d6f024b27c4d8ddaabfe0eaa0b404137e3cf (Add horrible hack to
ask the filename when exporting PDF in CODA-W, 2025-12-02) added a
callback from core to the LOK client to trigger a file picker during PDF
export.

The problem is that in its current form, this callback is
Windows-specific so other platforms (Linux, macOS) can't provide their
implementation in a straightforward way.

Fix the problem by reworkig this, so it works similar to the anyInput
callback, which is cross-platform already.

The behavior for the case when the new callback is not registered is
meant to be unchanged.

Change-Id: I27934774889fc827772b2665799eca358dd62e55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195381
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2025-12-11 15:49:35 +01:00
Jan Holesovsky 7c8a7f9887 LibreOfficeKit is actually supported on macOS
Change-Id: I9d00dc356d11533ca3f8b436bf44fdb2bf1c82f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194788
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-11-28 20:55:51 +01:00
Stephan Bergmann ebca26e903 Explain the seemingly unused LokHookPreInit2 typedef
...which had apparently always been unused since it got introduced in
5de22d1e55 "Handle 'addfont' from Collabora
Online", but is used by e.g.
<https://github.com/CollaboraOnline/online/commit/f98900c73c357af4588dfe95c191b4bf2020ea1e>
"Add a remote font download feature"

Change-Id: I292672d140356e8a0562d383452536924dd3b17b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192090
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Jenkins
2025-10-10 15:33:02 +02:00
Marco Cecchetti 150525a38e lok: color preview: avoid chart color palette reset on preview
Notify color preview state: enabled/disabled
Avoid current color palette to be cleared if user is just previewing a
color for a data series or a data point with the color picker.

Change-Id: I8b5fcd7e675d34f68b0323703ec509493fc48492
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186337
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190035
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2025-08-24 23:21:44 +02:00
Caolán McNamara b639097a66 add a way to get the count of current documents.
and don't destroy kit on closing all view of one document in
gtktiledviewer. Or maybe gtktiledviewer should keep track of
the count of current views itself.

Change-Id: I59d61d5c0a8dc2ddce42081e2fd6a52b85f9ae2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188350
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-07-25 17:55:45 +02:00
Mike Kaganski 84f96525bd LOK: Introduce "read-only mode with tracked changes management"
When it is enabled, most of the editing commands in a read-only view
are disabled, as usual; but the commands to manage tracked changes
are enabled, and allow user to accept / reject / comment on changes.
Saving is enabled, too.

Change-Id: Ic8bafc335c47ecd1b897c428a804cea2bc677cb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186686
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit c4f3d75567d5664259e01ff14a75e6f3e952ac9a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186733
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-06-20 11:15:35 +02:00
Miklos Vajna f12991396d cool#11064 vcl lok: fold the scheduler info into the anyinput callback
This changes the LOK API added in commit
e9e39e45f0daed52276377321088aa4d49b112b6 (cool#11064 vcl lok: expose
info about the scheduler, 2025-02-14) so that a LOK client doesn't have
to query the priority of the most urgent task: instead the anyInput
callback gets it as a parameter.

The scheduler is a hot path and it's not expected this priority
information would be needed in other places, so folding the new LOK API
into the anyInput callback simplifies things.

Change-Id: I1385055bfa27f47a243d40683b54cb2ddc9d33bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181878
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2025-02-19 14:22:39 +01:00
Patrick Luby 18e5d1ce26 Related: tdf#145127 force error when compiling for unsupported Apple OSs
While LibreOfficeKit can be built on macOS, the built library won't work
as intended since a headless vcl implementation is needed. Currently,
iOS is the only Apple OS that has a headless vcl implementation so
force a compiler error.

Change-Id: Ib9318851ff7e6c98531672ba7241c22a91f3ef7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180093
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Tested-by: Jenkins
2025-01-16 16:24:22 +01:00
Henry Castro 7174a1a7b4 lokit: add scale parameter to "renderNextSlideLayer"
When client side change the device pixel ratio.

Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I6356ff2a2e6513ac835b5f02a755173aafe01dc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178580
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179825
Tested-by: Jenkins
2025-01-06 17:09:14 +01:00
Marco Cecchetti 7364b3a2d8 lok: slideshow rework: check that requested slide is the expected one
Change-Id: I225dfea9981d43fb90888f5025792e9d24d9a789
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173061
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178129
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2024-12-09 14:34:12 +01:00
Michael Meeks 58249677c3 cool#4250 - add API to set per view options.
Change-Id: I5e3b3b3548ba93b96b33fe682405a2b0b53bbdee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176715
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 8dcb86a4a724f143f7d5cfcc3d1231a7f924cbd9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177445
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-11-28 15:09:27 +01:00
Miklos Vajna a22fe103e7 Related: cool#9735 vcl lok: add an AnyInput() callback
Open the 300 pages bugdoc, paste a oneliner plain text content in a
paragraph which is part of a numbered list, observe a 274 ms hang till
layout is done for all pages, then we get an updated tile. This could be
better, there is no such hang in the desktop case.

What happens is that 1) vcl doesn't try to invoke the poll callback of
the LOK client when there was a processed timer and 2) Writer layout
doesn't try to split its work into pieces because the LOK client has no
way to inform vcl that it has pending input events.

Fix the first problem in this commit: add a new API that allows a LOK
client to inform vcl that it has pending input events and use that
SvpSalInstance::ImplYield(): if a LOK client has pending input events,
then invoke the poll callback after each processed timer. For example,
this allows the LOK client to process emitted callbacks between two idle
layout jobs, word counting, etc.

The second problem around Writer to use
comphelper::LibreOfficeKit::anyInput() is not yet fixed.

Change-Id: I2e39253bfc4d1b5546bc60eef9ff05ccdc0868b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171846
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-08-14 11:17:33 +02:00
Michael Meeks f9df8d71a9 lok: join Webdav Ticker thread.
Add 'startThreads' lok method for the few thread scenarios where
we need to have a background thread running that cannot be started
opportunistically.

Also add that to the ThreadJoinable interface so we can get into
UNO components' implementations to handle their worker threads
easily.

Implement joining and re-starting in WebDAV ucp too.

Change-Id: I329ef9decb32b263197e4c03a0d54952985fdd0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167858
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170979
Tested-by: Jenkins
2024-07-26 13:37:26 +02:00
Michael Weghorn ed984edae6 libreofficekitgtk: Add include for SAL_DLLPUBLIC_EXPORT
`SAL_DLLPUBLIC_EXPORT` is defined in `include/sal/types.h`,
so add a corresponding include in
`include/LibreOfficeKit/LibreOfficeKitGtk.h` before using it.

Without this, Qt Creator's Clang code model would'nt find it,
resulting in errors like

    .../libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx:15: error: In included file: unknown type name 'SAL_DLLPUBLIC_EXPORT'

being shown when editing the file
`libreofficekit/qa/gtktiledviewer/gtv-lokdocview-signal-handlers.cxx`
in Qt Creator.

Change-Id: Iedd3490be9de72b931573b305d283d80b25a4645
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170749
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-07-19 13:27:16 +02:00
Attila Szűcs 84d63cfccf Sw: extract/transform document structure 2
inserting a ContentControl, now generate a unique ID for it...
search the lowest possible non used (non negative) number

added a GetType() function for SwXContentControl that get it from
SwContentControl, and used it for extract and transform.

Added some support for all other types.. some are not really usable
yet.

Fixed a problem when setting checkbox check, did not changed its
content.

If content is set to “”. It now set as placeholder,
and reset its content to the initial placeholder value, like:
“Choose an item” or  “Click here to enter text”
(work for checkbox, and picture CntentControl.)

Change-Id: I0fc696f73734bdfb9ac5b8fdc6891168b8d4ed5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170600
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-07-17 10:52:38 +02:00
Attila Szűcs f8e7da23b6 SW: exctract document structure
It extract form controls, and write its data to JSON.

It is a basic 1. version, for now it only recognize:
-PlainText (and write its text)
-CheckBox (and write its state)

but it writes some common data for any type of controls:
ID, alias, Tag, TabIndex, and its index.

Change-Id: I9ff74cd013c6f1118942207059181678713504af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170381
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2024-07-12 10:45:49 +02:00
Marco Cecchetti bf972de2c1 lok: expose presentation info and slide render functions
This exposes the (impress only) function to get the current
presentation info in JSON format and the slide rendering functions
that enable rendering of slide layers to a bitmap.

Change-Id: Id0591d5894f730eae48b3edc986ae5d804ce7c81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170263
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-07-10 11:47:49 +02:00
Mike Kaganski a337a6ed16 warning C6011: Dereferencing NULL pointer 'sNewPath'
C:\lo\build\instdir\sdk\include\LibreOfficeKit\LibreOfficeKitInit.h(161) : warning C6011:
 Dereferencing NULL pointer 'sNewPath'. : Lines: 136, 137, 138, 140, 143, 144, 157, 159, 160, 161

Change-Id: I0fba0db79b4a36f293e867da262a970eb152e3d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169651
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-06-27 20:44:24 +02:00
Mike Kaganski 2c2d84fefc Revert "LOK: Introduce LOK_CALLBACK_STATUS_UPDATE"
This reverts commit bbd32b39ea.
A following commit will implement an alternative method without a
new enum member.

Change-Id: Id00a4a0abe68fc69b1a3a81c731c8085e3dbca2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169467
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-06-25 12:03:32 +02:00
Mike Kaganski bbd32b39ea LOK: Introduce LOK_CALLBACK_STATUS_UPDATE
This allows to send status messages separately from statechanged;
this is needed in Impress to notify about any mode update, not only
masterview-related.

Also send SlideMasterPage updates automatically from core.

Change-Id: I0a50dbe61a5f2f28cd418eb4416819a6a76810b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169314
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-06-21 15:46:17 +02:00
Darshan-upadhyay1110 40ddb619cf Add new LOK CALLBACK for vertical ruler
- We're adding a new LOK callback LOK_CALLBACK_VERTICAL_RULER_UPDATE.
- The reason is that we currently override the existing callback.
- Using the same callback for both vertical and horizontal rulers causes an issue.
- override will create problem like it will only send any one of the ruler orientation update.
- It results in online updates being limited to just one ruler orientation.
- By introducing a new callback, we ensure updates for both vertical and horizontal rulers both are captured correctly in online.

Change-Id: I02d0e3e7e4ac8a07a83644460aa0ba36e0f3c013
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167481
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 11b936629dd4ef9308d63b312900b8b7c8ff19b4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167464
Tested-by: Jenkins
2024-06-17 10:23:27 +02:00
Michael Meeks ccc2e526d1 lok: add isForkedChild method.
This can be used to tag short-lived transient 'save' processes
to encourage them not to mutate eg. filesystem state that is
shared with the parent process.

Change-Id: I027d18cbe4ce519b31c4fc1d3ac46b916d1efc87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165407
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 9dab5edb90d14ad6f71cc2ac96cc504c1e8c290b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165427
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-03-28 17:07:15 +01:00
Gökay Şatır d50d40b12c Allow enabling comment editing in readonly view mode.
Online side can set this property to allow comment editing. This is the infra.
Implementation will be in another commit.

Change-Id: I3a6f1ad6818c2c6587d98896c3d6d913d51a2295
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164988
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-03-19 16:53:37 +01:00
Pranam Lashkari 34daf30c7a LOK: send inner text boundry information of shapes/textbox on change
instroduced new callback for LOK LOK_CALLBACK_SHAPE_INNER_TEXT

now if innert text is changed LOK is instantly updated about new textarea

Change-Id: I0a88e1dd77556e47f14359ce0a98701a327aceda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164497
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-08 10:55:26 +01:00
Gökay Şatır 97d32edf39 Collaborative editing with readonly and edit views.
We can have both readOnly and editor views at the same time while collaboratively editing a document.
Our current solution is to disable any command if the user's view is readonly.
We want to have a closer behaviour to desktop app with readonly views.
For this purpose, we are allowing more interactions from online server to core side.
We also need to filter out the events like the core side readonly view do (next commit).
This commit initiates the readonly view infrastructure.

The patches previous commit reverts were an example of how we disable things in readonly mode. We needed to open a window for getting hyperlink information.
With this patch, we try to separate the edit and readonly view modes on core side.

More notes:

We need "&& !comphelper::LibreOfficeKit::isActive()" or it falls into an endless loop with this patch.
When we disable editing on a browser, almost all user actions are disabled.

(cherry picked from commit 81dae2ca5187bd24aea0befb099a5b53535b5d03)

Change-Id: Ia25368dd8065206ec6b4b83eb2f685531110cc78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164527
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-03-07 15:44:29 +01:00
Gökay Şatır 693b7fcf7a Revert hyperlinkInfoAtPositon changes.
Revert "Implement hyperlinkInfoAtPosition for Impress."

This reverts commit 876543305c78cb596720da087454a5c54e5feb06.

Revert "Readonly Hyperlink Info - normalize the clicked coordinates."

This reverts commit 322669725b771f5fa2b3c10c5fb73238ca3713f6.

Revert "Implement hyperlinkInfoAtPosition function for Calc."

This reverts commit be01dd78c47b51b19603a6259504e29b11979b0b.

Revert "Implement hyperlinkInfoAtPosition for Writer."

This reverts commit 6773c8929690f557d29bc282dd8f5c4381da3484.

Revert "In readonly mode, we restrict many events like click."

This reverts commit a4f3b97e506f38e0c43d6fbf1192cc523750a9fd.

(cherry picked from commit c3f1d63178d6aaa0888085c7b641eb6d49a18276)

Conflicts:
	sc/source/ui/unoobj/docuno.cxx
	sd/source/ui/unoidl/unomodel.cxx
	sw/source/uibase/uno/unotxdoc.cxx

Change-Id: Ie821a4bca6e6b4649cea17748c44af105cd45d30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164481
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-03-07 08:12:11 +01:00
Caolán McNamara d5fbbc750c use getCommandValues instead of adding a getViewRenderState
Change-Id: Ib6db5dd8ef1db2745cb3c616bb81b1ac2baf6504
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163812
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163931
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-27 09:25:23 +01:00
Caolán McNamara ab897d8fa0 add getViewRenderState to LibreOfficeKitDocument
so we can get the initial render state as it is when created

Change-Id: I1202cbbf478bc4f62f4d587e1f2766c61f172cb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163666
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit effe8f6e5cc5389b234a6e57540f935de4a6f201)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163843
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-26 11:15:48 +01:00
Michael Meeks 52f2720af1 lok: implement a joinThreads function - to wind down thread pools.
Necessary to do this before forking on Unix systems; use a
dynamic_cast interface since this is all for internal use.

Change-Id: I8a911322acd4ec5654eb0d14804c09d513a0bd4b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163335
Tested-by: Jenkins
2024-02-14 17:29:02 +01:00
Hossein 0d37cbb937 Normalize include syntax in include/LibreOfficeKit
Changed #include <LibreOfficeKit/...> to #include "..." in the header
folder include/LibreOfficeKit/.

The reason is described in:

C[++]: Normalizing include syntax ("" vs <>)
https://lists.freedesktop.org/archives/libreoffice/2017-November/078778.html

Change-Id: I8ccbbde38eb649428f99e39b6f0529dffc3e4206
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161809
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-01-24 06:03:11 +01:00
Mike Kaganski 06ff6370a4 Send tooltip text to LOK
Call vcl::Window::RequestHelp from LOKPostAsyncEvent for
mouse movement. Introduce LOK_CALLBACK_TOOLTIP callback
type, and send it from SwEditWin::RequestHelp.

Intention is, that the tooltip is shown by client at the
current mouse pointer position, which is hopefully not
far away from the point that generated the mouse event.
On the next movement, the client starts a timer to hide
the tooltip. If the next tooltip message arrives, the
tooltip would be updated in the new place.

Alternatively, the payload could contain the coordinates
from the HelpEvent.

Change-Id: I8e96eb6e6983ad8d13b4c5d7be4d51ff3fd11893
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161302
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-04 14:12:23 +01:00
Gökay Şatır 6fc77c2fa4 In readonly mode, we restrict many events like click.
In readonly mode, Online users need to be able to click on a hyperlink and get the related info.

For this purpose, this PR adds a new function template that sends the hyperlink info if there is any at the clicked position.

I will send the implementation with the next commit.

Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I886ea22a7097aac73ade0da78a88ddfc95ad819c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160022
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161372
Tested-by: Jenkins
2023-12-28 13:33:59 +01:00
Marco Cecchetti 96ed41755b lok: a11y: implemented support for notifying core log to client
In this way core log can be printed to the browser console.
This may help in understanding if some core event occurs earlier or
later wrt a client event.

Change-Id: I720ef9b149e98ddbc252aa069649019e79ef6cb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158780
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
(cherry picked from commit d8dc138be7e69750d1a346b3b49cecc1201e8d46)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159331
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-11-11 22:22:52 +01:00
Marco Cecchetti f3b20f31d5 lok: a11y: impress: help screen reader to report shape selection
Refactored LOKDocumentFocusListener::notifyEvent.

Implemented 2 new callbacks:
- LOK_CALLBACK_A11Y_EDITING_IN_SELECTION_STATE: it says the client if
editing in a shape or cell is active or it isn't.
- LOK_CALLBACK_A11Y_SELECTION_CHANGED: it says if a shape has been
selected/unselected, the name of the shape and text content are sent
too for being reported by a screen reader.

(cherry picked from commit 76899152ec3d1924cc72d2b869e197a1e34a0a1a)

Conflicts:
	sfx2/source/view/viewsh.cxx

Change-Id: I644bcc7daeb8772805688a9bccdabd0631ce0a22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158562
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-10-27 19:28:52 +02:00
Marco Cecchetti 70cddea8cb lok: a11y: send list item prefix length to client
Implemented getListPrefixSize function which relies on
UNO_NAME_NUMBERING_LEVEL, UNO_NAME_NUMBERING character attributes.
The former provides the list item level, the latter is a boolean that
says if a prefix (bullet/number) is present or not for the list item.
It has been needed to modify
SwAccessibleParagraph::_getSupplementalAttributesImpl so that it
returns such properties for list item only and not for simple
paragraph too. In fact for a simple paragraph the default value for
the level property was returned which is 0 exactly the same value for
top list item.

Change-Id: Ia651af4d4b2372eed42c90b0752e16fd47a4fdec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156816
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com>
(cherry picked from commit 038903d2e066de9525a3baffdd232484ef44ff51)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157780
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-22 15:25:19 +02:00
Caolán McNamara ef5cb6cdcd make FunctionBasedURPConnection simpler
and leave it to the client how it wants to read/provide the data

Change-Id: Ibd4d967b79a699c96d1ea8529544b585a97cc0c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157405
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-29 14:14:39 +02:00
Skyler Grey 8e246331f6 Add a FunctionBasedURPConnection and a websocket URP connector
- FunctionBasedURPConnection is used to enable a client to open a URP
  connection to a fresh Kit instance in COOL.
- This URP connector can be used with that and
  https://github.com/CollaboraOnline/online/pull/6992 to use a Java Uno
  Remote Protocol client over websockets
- For interoperability with existing Collabora Online websockets a
  prefix (urp ) is added to each message sent and a similar prefix
  (urp: ) is expected on each message recieved. This allows sending over
  the same websocket as other data is being transmitted through. If you
  are writing a bridge to work with this, you will need to add/strip the
  prefixes accordingly
- This commit uses Java WebSocket
  (https://github.com/TooTallNate/Java-WebSocket) to send data over
  websockets.

Change-Id: I2bda3d0b988bef7883f9b6829eeb5b7ae8075f27
Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151171
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-09-01 16:55:37 +02:00
Marco Cecchetti 59c2e114f7 lok: a11y: when we are inside a table notify table and current cell info
When we get in one or more tables we notify row and column count.
When we get out one or more table we notify we are leaving a table.
When the fosused cell changes we notify the new row/col index.
The paragraph content is notified together with table info, so that
client has some opportunity for getting the screen reader to report
together content and table info.

Change-Id: Ic524259aa1879a70fc3de2467bdee27475352b7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155577
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-08-14 08:09:53 +02:00