ohos: Register JS TTS listeners


Register JS engine `onStart`, `onComplete`, `onStop` and `onError`
listeners. Register listeners in setEngineListenerInJsThread to
forward events from the JS thread to the EngineListeners interface
on the Qt thread (with usage of QtThreadBasedEngineListeners
decorator).

Add makeOnStateCallbackDelegate helper, parameterized by a pointer to
an EngineEventsListener member function, to share the `onStart` and
`onStop` callback implementation.

Skipped `onData` listener since audio is streamed directly from the
engine and does not require forwarding.

Currently, JS API doesn't provide any way to disconnect from listeners,
so no action for clear is done.

Task-number: QTBUG-147179
Pick-to: 6.12
Change-Id: I81daaa8e92ecdd3eafa459ac9ab9084fc2d15f6f
Reviewed-by: Zbigniew Chyla <zbigniew.chyla@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
commit62d6ce070b07439cf17cd197a6f046dccffc8264
parent4c610be90d4db73da4e44995391f5d138397b4c3
authorArkadiusz Zarębski <arkadiusz.zarebski@qt.io>
committerArkadiusz Zarębski <arkadiusz.zarebski@qt.io>
commit timeMon, 31 Aug 2026 06:57:48 +0000