MCPcopy Create free account
hub / github.com/KDE/okular / processFormMouseScriptAction

Method processFormMouseScriptAction

core/document.cpp:4621–4657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4619}
4620
4621void Document::processFormMouseScriptAction(const Action *action, Okular::FormField *ff, MouseEventType fieldMouseEventType)
4622{
4623 if (!action || action->actionType() != Action::Script) {
4624 return;
4625 }
4626
4627 Okular::Event::EventType eventType = Okular::Event::UnknownEvent;
4628
4629 switch (fieldMouseEventType) {
4630 case Document::FieldMouseDown:
4631 eventType = Okular::Event::FieldMouseDown;
4632 break;
4633 case Document::FieldMouseEnter:
4634 eventType = Okular::Event::FieldMouseEnter;
4635 break;
4636 case Document::FieldMouseExit:
4637 eventType = Okular::Event::FieldMouseExit;
4638 break;
4639 case Document::FieldMouseUp:
4640 eventType = Okular::Event::FieldMouseUp;
4641 break;
4642 }
4643
4644 // Lookup the page of the FormFieldText
4645 int foundPage = d->findFieldPageNumber(ff);
4646
4647 if (foundPage == -1) {
4648 qCDebug(OkularCoreDebug) << "Could not find page for formfield!";
4649 return;
4650 }
4651
4652 std::shared_ptr<Event> event = Event::createFieldMouseEvent(ff, d->m_pagesVector[foundPage], eventType);
4653
4654 const ScriptAction *linkscript = static_cast<const ScriptAction *>(action);
4655
4656 d->executeScriptEvent(event, linkscript);
4657}
4658
4659void Document::processFormMouseUpScripAction(const Action *action, Okular::FormField *ff)
4660{

Callers 1

slotMouseActionMethod · 0.80

Calls 3

actionTypeMethod · 0.80
findFieldPageNumberMethod · 0.80
executeScriptEventMethod · 0.80

Tested by

no test coverage detected