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

Method processDocumentAction

core/document.cpp:4588–4619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4586}
4587
4588void Document::processDocumentAction(const Action *action, DocumentAdditionalActionType type)
4589{
4590 if (!action || action->actionType() != Action::Script) {
4591 return;
4592 }
4593
4594 Event::EventType eventType = Okular::Event::UnknownEvent;
4595
4596 switch (type) {
4597 case Document::CloseDocument:
4598 eventType = Okular::Event::DocWillClose;
4599 break;
4600 case Document::SaveDocumentStart:
4601 eventType = Okular::Event::DocWillSave;
4602 break;
4603 case Document::SaveDocumentFinish:
4604 eventType = Okular::Event::DocDidSave;
4605 break;
4606 case Document::PrintDocumentStart:
4607 eventType = Okular::Event::DocWillPrint;
4608 break;
4609 case Document::PrintDocumentFinish:
4610 eventType = Okular::Event::DocDidPrint;
4611 break;
4612 }
4613
4614 std::shared_ptr<Event> event = Event::createDocEvent(eventType);
4615
4616 const ScriptAction *linkScript = static_cast<const ScriptAction *>(action);
4617
4618 d->executeScriptEvent(event, linkScript);
4619}
4620
4621void Document::processFormMouseScriptAction(const Action *action, Okular::FormField *ff, MouseEventType fieldMouseEventType)
4622{

Callers

nothing calls this directly

Calls 2

actionTypeMethod · 0.80
executeScriptEventMethod · 0.80

Tested by

no test coverage detected