Okular
10 #include <KLocalizedString>
16 #include "sourcereference_p.h"
20 class Okular::ActionPrivate
27 virtual ~ActionPrivate()
29 qDeleteAll(m_nextActions);
32 ActionPrivate(
const ActionPrivate &) =
delete;
33 ActionPrivate &operator=(
const ActionPrivate &) =
delete;
39 Action::Action(ActionPrivate &dd)
69 return d->m_nextActions;
75 qDeleteAll(d->m_nextActions);
76 d->m_nextActions = actions;
81 class Okular::GotoActionPrivate :
public Okular::ActionPrivate
86 , m_extFileName(fileName)
91 GotoActionPrivate(
const QString &fileName,
const QString &namedDestination)
93 , m_extFileName(fileName)
94 , m_dest(namedDestination)
104 :
Action(*new GotoActionPrivate(fileName, viewport))
109 :
Action(*new GotoActionPrivate(fileName, namedDestination))
125 return d->m_extFileName.isEmpty() ? (d->m_vp.isValid() ?
i18n(
"Go to page %1", d->m_vp.pageNumber + 1) :
QLatin1String(
"")) :
i18n(
"Open external file");
131 return !d->m_extFileName.isEmpty();
137 return d->m_extFileName;
154 class Okular::ExecuteActionPrivate :
public Okular::ActionPrivate
157 ExecuteActionPrivate(
const QString &file,
const QString ¶meters)
160 , m_parameters(parameters)
169 :
Action(*new ExecuteActionPrivate(file, parameters))
185 return i18n(
"Execute '%1'...", d->m_fileName);
191 return d->m_fileName;
197 return d->m_parameters;
202 class Okular::BrowseActionPrivate :
public Okular::ActionPrivate
205 explicit BrowseActionPrivate(
const QUrl &url)
215 :
Action(*new BrowseActionPrivate(url))
232 int row = 0, col = 0;
233 if (extractLilyPondSourceReference(d->m_url, &source, &row, &col)) {
234 return sourceReferenceToolTip(source, row, col);
236 return d->m_url.toDisplayString();
247 class Okular::DocumentActionPrivate :
public Okular::ActionPrivate
252 , m_type(documentActionType)
260 :
Action(*new DocumentActionPrivate(documentActionType))
284 return i18n(
"First Page");
286 return i18n(
"Previous Page");
288 return i18n(
"Next Page");
290 return i18n(
"Last Page");
294 return i18n(
"Forward");
298 return i18n(
"Start Presentation");
300 return i18n(
"End Presentation");
302 return i18n(
"Find...");
304 return i18n(
"Go To Page...");
314 class Okular::SoundActionPrivate :
public Okular::ActionPrivate
317 SoundActionPrivate(
double volume,
bool sync,
bool repeat,
bool mix,
Okular::Sound *sound)
327 ~SoundActionPrivate()
override
340 :
Action(*new SoundActionPrivate(volume, sync, repeat, mix, sound))
355 return i18n(
"Play sound...");
390 class Okular::ScriptActionPrivate :
public Okular::ActionPrivate
405 :
Action(*new ScriptActionPrivate(type, script))
421 switch (d->m_scriptType) {
423 return i18n(
"JavaScript Script");
432 return d->m_scriptType;
443 class Okular::MovieActionPrivate :
public Okular::ActionPrivate
448 , m_operation(operation)
449 , m_annotation(nullptr)
458 :
Action(*new MovieActionPrivate(operation))
473 return i18n(
"Play movie...");
479 return d->m_operation;
491 return d->m_annotation;
496 class Okular::RenditionActionPrivate :
public Okular::ActionPrivate
501 , m_operation(operation)
503 , m_scriptType(scriptType)
505 , m_annotation(nullptr)
517 :
Action(*new RenditionActionPrivate(operation, movie, scriptType, script))
534 switch (d->m_operation) {
537 switch (d->m_scriptType) {
539 return i18n(
"JavaScript Script");
544 return i18n(
"Play movie");
546 return i18n(
"Stop movie");
548 return i18n(
"Pause movie");
550 return i18n(
"Resume movie");
557 return d->m_operation;
569 return d->m_scriptType;
587 return d->m_annotation;
590 BackendOpaqueAction::BackendOpaqueAction()
591 :
Action(*new ActionPrivate())
597 return BackendOpaque;
ScriptType scriptType() const
Returns the type of action.
QString actionTip() const override
Returns the action tip.
@ HistoryBack
Go back in page history.
Contains information about a sound object.
@ JavaScript
JavaScript code.
MovieAction(OperationType operation)
Creates a new movie action.
ActionType actionType() const override
Returns the action type.
ActionType actionType() const override
Returns the action type.
The documentation to the global Okular namespace.
ActionType actionType() const override
Returns the action type.
The Rendition action executes an operation on a video or executes some JavaScript code on activation.
ActionType actionType() const override
Returns the action type.
ScriptType scriptType() const
Returns the type of script.
QString actionTip() const override
Returns the action tip.
QString fileName() const
Returns the filename of the external document.
Encapsulates data that describes an action.
@ PageFirst
Jump to first page.
The Goto action changes the viewport to another page or loads an external document.
~DocumentAction() override
Destroys the document action.
DocumentAction(enum DocumentActionType documentActionType)
Creates a new document action.
QString destinationName() const
Returns the document named destination the goto action points to.
ExecuteAction(const QString &fileName, const QString ¶meters)
Creates a new execute action.
@ EndPresentation
End presentation.
The Script action executes a Script code.
@ PageLast
Jump to last page.
bool repeat() const
Returns whether the sound shall be repeated.
@ PagePrev
Jump to previous page.
void setAnnotation(MovieAnnotation *annotation)
Sets the annotation that is associated with the movie action.
QUrl url() const
Returns the url to browse.
~RenditionAction() override
Destroys the rendition action.
The Execute action executes an external application.
@ HistoryForward
Go forward in page history.
QString actionTip() const override
Returns the action tip.
@ Play
Start playing the video.
QString actionTip() const override
Returns the action tip.
QString actionTip() const override
Returns the action tip.
OperationType operation() const
Returns the operation type.
ActionType actionType() const override
Returns the action type.
ScreenAnnotation * annotation() const
Returns the annotation or 0 if no annotation has been set.
QString actionTip() const override
Returns the action tip.
RenditionAction(OperationType operation, Okular::Movie *movie, enum ScriptType scriptType, const QString &script)
Creates a new rendition action.
The Movie action executes an operation on a video on activation.
QString i18n(const char *text, const TYPE &arg...)
QString actionTip() const override
Returns the action tip.
virtual QString actionTip() const
Returns a i18n'ed tip of the action that is presented to the user.
~ExecuteAction() override
Destroys the execute action.
@ Goto
Goto a given page or external document.
OperationType
Describes the possible operation types.
DocumentActionType
Describes the possible action types.
OperationType
Describes the possible operation types.
GotoAction(const QString &fileName, const DocumentViewport &viewport)
Creates a new goto action.
QString script() const
Returns the code.
ActionType actionType() const override
Returns the action type.
DocumentViewport destViewport() const
Returns the document viewport the goto action points to.
void setNativeId(const QVariant &id)
Sets the "native" id of the action.
Contains information about a movie object.
@ PageNext
Jump to next page.
OperationType operation() const
Returns the operation type.
ScriptType
Describes the possible script types.
Okular::Sound * sound() const
Returns the sound object which contains the sound data.
MovieAnnotation * annotation() const
Returns the annotation or 0 if no annotation has been set.
QVector< Action * > nextActions() const
Returns the next actions to be executed after.
ActionType
Describes the type of action.
ScriptAction(enum ScriptType type, const QString &script)
Creates a new Script action.
QString script() const
Returns the script code.
QVariant nativeId() const
Returns the "native" id of the action.
~BrowseAction() override
Destroys the browse action.
@ None
Execute only the JavaScript.
~ScriptAction() override
Destroys the browse action.
bool synchronous() const
Returns whether the sound shall be played synchronous.
DocumentActionType documentActionType() const
Returns the type of action.
@ Script
Executes a Script code.
ActionType actionType() const override
Returns the action type.
double volume() const
Returns the volume of the sound.
@ Rendition
Play a movie and/or execute a Script code.
The Browse action browses an url by opening a web browser or email client, depending on the url proto...
Okular::Movie * movie() const
Returns the movie object or 0 if no movie object was set on construction time.
~SoundAction() override
Destroys the sound action.
@ Stop
Stop playing the video.
void setNextActions(const QVector< Action * > &actions)
Sets the next actions.
QString fileName() const
Returns the file name of the application to execute.
void setAnnotation(ScreenAnnotation *annotation)
Sets the annotation that is associated with the rendition action.
The Sound action plays a sound on activation.
QString actionTip() const override
Returns the action tip.
~GotoAction() override
Destroys the goto action.
bool isExternal() const
Returns whether the goto action points to an external document.
QString parameters() const
Returns the parameters of the application to execute.
@ Presentation
Start presentation.
The DocumentAction action contains an action that is performed on the current document.
bool mix() const
Returns whether the sound shall be mixed.
~MovieAction() override
Destroys the movie action.
SoundAction(double volume, bool synchronous, bool repeat, bool mix, Okular::Sound *sound)
Creates a new sound action.
BrowseAction(const QUrl &url)
Creates a new browse action.
@ Execute
Execute a command or external application.
@ DocAction
Start a custom action.
@ Resume
Resume playing the video.
ActionType actionType() const override
Returns the action type.
@ Browse
Browse a given website.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Sep 30 2023 03:54:22 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.