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>