In PDF's there can be action annotations to form fields and to additional actions of widget annotations.
Okular currently only parses the additional actions of "FormField::AdditionalActionType" these are: CalculateField, ValidateField, FormatField and FieldModified.
For Bug 307304 we need support for Focus In / Focus Out actions.
For Bug 306818 we need support for MousePressed actions.
The actions are:
actionCursorEntering, ///< Performed when the cursor enters the annotation's active area actionCursorLeaving, ///< Performed when the cursor exists the annotation's active area actionMousePressed, ///< Performed when the mouse button is pressed inside the annotation's active area actionMouseReleased, ///< Performed when the mouse button is released inside the annotation's active area actionFocusIn, ///< Performed when the annotation receives the input focus actionFocusOut, ///< Performed when the annotation loses the input focus
These actions are actions of the widget annotation. In Qt5 API "Annotation::AdditionalActionType".
Currently I don't see a way to get those actions in the Qt API in connection to their corresponding FormFields. We see the annotation widget in PDFGenerator::addAnnotations but only do something with PageOpeningAction and PageClosingAction and there is no link between the FormField and the widget annotation.
In internal poppler API this should be something like FormWidget::getWidgetAnnotation() then we could call getAdditionalAction on that annotation.
So I think what we need here would be a link between a FormField and the annotation additional actions. As the Qt API already combines annoation widget properties with the field (isVisible) I think it would be least confusing to also expose the WidgetAnnoation actions through the form actions interface.
I have a working prototype that executes the focusOut actions from Bug 307304. I hope to finish this up for review later today or tomorrow.