7#include <QtCore/private/qnapi_p.h>
8#include <QtCore/private/qohoscommon_p.h>
9#include <QtCore/qglobal.h>
14#include <qohosplugincore.h>
15#include <qohosutils.h>
34 JsState &jsState, std::function<QNapi::Value(JsState &, T)> promiseValueFactory,
35 const QOhosConsumer<JsState &, QOhosConsumer<JsState &, T>> &asyncCallFunc);
38 QNapi::Object eventSourceObject,
const std::string &eventTypeName,
47 std::chrono::milliseconds delay);
60 JsState &jsState, std::function<QNapi::Value(JsState &, T)> promiseValueFactory,
61 const QOhosConsumer<JsState &, QOhosConsumer<JsState &, T>> &asyncCallFunc)
63 auto promiseDeferred = QNapi::Promise::Deferred::New(jsState.env());
67 makeCallOnceConsumerWrapper<
JsState &, T>(
68 [promiseDeferred, promiseValueFactory = std::move(promiseValueFactory)](
JsState &jsState, T result) {
69 promiseDeferred.Resolve(promiseValueFactory(jsState, result));
72 return promiseDeferred.Promise();
78 auto optPropValue = QNapi::getOptionalPropOrEmpty<T>(object, propName);
79 return !optPropValue.IsEmpty()
80 ? makeQOhosOptional(optPropValue)
void update(Qt::InputMethodQueries queries) override
Notification on editor updates.
QRectF keyboardRect() const override
This function can be reimplemented to return virtual keyboard rectangle in currently active window co...
void setSoftwareKeyboardVisibilityStatus(bool visible)
void showInputPanel() override
Request to show input panel.
void invokeAction(QInputMethod::Action action, int cursorPosition) override
Called when the word currently being composed in the input item is tapped by the user.
void setLastInputTypeToTriggerSoftKeyboard(RequestKeyboardReason inputType)
void reset() override
Method to be called when input method needs to be reset.
void hideInputPanel() override
Request to hide input panel.
bool eventFilter(QObject *obj, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
bool isInputPanelVisible() const override
Returns input panel visibility status.
QObject * focusObjectOrNull() const
void setFocusObject(QObject *object) override
This virtual method gets called to notify updated focus to object.
bool isAnimating() const override
This function can be reimplemented to return true whenever input method is animating shown or hidden.
std::enable_if_t< qohosplugincore_h_detail::isQOhosOptional< QOhosInvokeResult< Func, T > >, QOhosInvokeResult< Func, T > > andThen(Func &&func) const
JsInputMethodInsertedTextComposer & operator=(const JsInputMethodInsertedTextComposer &)=delete
JsInputMethodInsertedTextComposer(JsInputMethodInsertedTextComposer &&)=delete
static JsInputMethodInsertedTextComposer & instance()
JsInputMethodInsertedTextComposer & operator=(JsInputMethodInsertedTextComposer &&)=delete
QOhosOptional< InsertedTextId > lastId() const
JsInputMethodInsertedTextComposer(const JsInputMethodInsertedTextComposer &)=delete
QOhosInsertedText makeInsertedText(const std::string &text)
InsertedTextId id() const
QOhosInsertedText(const std::string &text, const InsertedTextId &id)
Combined button and popup list for selecting options.
QOhosOptional< QOhosInputContext::Direction > tryMapInputMethodDirectionToQt(::InputMethod_Direction direction)
::InputMethod_TextInputType mapQtInputMethodHintsToOhosImeTextInputType(Qt::InputMethodHints hints)
::InputMethod_EnterKeyType mapQtToOhosImeEnterKeyType(Qt::EnterKeyType qtEnterKeyType)
const Qt::EnterKeyType defaultEnterKeyType
void notifyOhosInputMethodAboutPossibleAutocorrection(const QOhosInsertedText &insertedText, int cursorPosition)
const Qt::InputMethodHints defaultInputMethodHints
QPoint clampToRect(const QPoint &p, const QRect &rect)
::InputMethod_RequestKeyboardReason mapQtToOhosImeRequestReason(QOhosInputContext::RequestKeyboardReason qtRequestKeyboardReason)
QOhosOptional< int > tryGetIntPropertyFromQuery(Qt::InputMethodQuery property, QSharedPointer< QInputMethodQueryEvent > query)
std::shared_ptr< void > registerOnOffMethodsBasedEventHandler(QNapi::Object eventSourceObject, const std::string &eventTypeName, QNapi::CallbackFuncWrapper handler, OnOffMethodsBasedEventHandlerOptions options={})
void clearJsTimeout(JsState &jsState, int timerId)
int setJsTimeout(JsState &jsState, std::function< void(const CallbackInfo &)> timeoutFunc, std::chrono::milliseconds delay)
QOhosOptional< T > getOptionalProperty(const QNapi::Object &object, const std::string &propName)
QNapi::Promise adaptAsyncCallResultToJsPromise(JsState &jsState, std::function< QNapi::Value(JsState &, T)> promiseValueFactory, const QOhosConsumer< JsState &, QOhosConsumer< JsState &, T > > &asyncCallFunc)
QNapi::Promise makeResolvedPromise(QNapi::Value valueForResolve)
void invokeInJsThreadAndWaitForContinue(std::function< void(JsState &, std::function< void()>)> &&task)
QOhosOptional< std::uint32_t > tryGetCodeFromJsBusinessError(const Napi::Error &error)
QOhosOptional< void > makeEmptyQOhosOptional()
std::function< bool(QNapi::Object)> optEventSourceAliveCheckFunc
QOhosOptional< QNapi::ValueWrapper > extraOnArg
QOhosOptional< QNapi::ValueWrapper > extraOffArg