2004-12-10 16:04:45 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2007-04-20 12:37:12 +00:00
|
|
|
#ifndef _OKULAR_ACTION_H_
|
|
|
|
#define _OKULAR_ACTION_H_
|
2004-12-10 16:04:45 +00:00
|
|
|
|
2011-06-01 08:31:44 +00:00
|
|
|
#include "global.h"
|
2014-10-27 21:35:06 +00:00
|
|
|
#include "okularcore_export.h"
|
2006-05-08 20:12:04 +00:00
|
|
|
|
2018-08-31 09:23:45 +00:00
|
|
|
#include <QString>
|
|
|
|
#include <QVariant>
|
2006-09-21 08:45:36 +00:00
|
|
|
|
|
|
|
namespace Okular {
|
|
|
|
|
2007-05-02 21:59:44 +00:00
|
|
|
class ActionPrivate;
|
2007-05-02 22:50:27 +00:00
|
|
|
class GotoActionPrivate;
|
|
|
|
class ExecuteActionPrivate;
|
|
|
|
class BrowseActionPrivate;
|
|
|
|
class DocumentActionPrivate;
|
|
|
|
class SoundActionPrivate;
|
2008-04-13 22:30:27 +00:00
|
|
|
class ScriptActionPrivate;
|
2007-05-02 22:50:27 +00:00
|
|
|
class MovieActionPrivate;
|
2012-09-27 10:42:17 +00:00
|
|
|
class RenditionActionPrivate;
|
2012-04-03 12:18:10 +00:00
|
|
|
class MovieAnnotation;
|
2012-09-27 10:42:17 +00:00
|
|
|
class ScreenAnnotation;
|
|
|
|
class Movie;
|
2006-10-09 18:02:59 +00:00
|
|
|
class Sound;
|
2007-01-03 14:30:48 +00:00
|
|
|
class DocumentViewport;
|
2006-10-09 18:02:59 +00:00
|
|
|
|
2004-12-10 16:04:45 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* @short Encapsulates data that describes an action.
|
2005-01-10 13:43:44 +00:00
|
|
|
*
|
2007-04-20 12:58:15 +00:00
|
|
|
* This is the base class for actions. It makes mandatory for inherited
|
2007-04-20 12:37:12 +00:00
|
|
|
* widgets to reimplement the 'actionType' method and return the type of
|
2007-04-20 12:58:15 +00:00
|
|
|
* the action described by the reimplemented class.
|
2004-12-10 16:04:45 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT Action
|
2004-12-10 16:04:45 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-11-27 08:08:39 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Describes the type of action.
|
2006-11-27 08:08:39 +00:00
|
|
|
*/
|
2007-04-20 12:37:12 +00:00
|
|
|
enum ActionType {
|
2006-11-27 08:08:39 +00:00
|
|
|
Goto, ///< Goto a given page or external document
|
|
|
|
Execute, ///< Execute a command or external application
|
|
|
|
Browse, ///< Browse a given website
|
2007-05-02 22:50:27 +00:00
|
|
|
DocAction, ///< Start a custom action
|
2006-11-27 08:08:39 +00:00
|
|
|
Sound, ///< Play a sound
|
2008-04-13 22:30:27 +00:00
|
|
|
Movie, ///< Play a movie
|
2012-09-27 10:42:17 +00:00
|
|
|
Script, ///< Executes a Script code
|
2016-11-26 15:00:02 +00:00
|
|
|
Rendition, ///< Play a movie and/or execute a Script code @since 0.16 (KDE 4.10)
|
|
|
|
BackendOpaque ///< Calls back to the backend with the action @since 1.1
|
2006-11-27 08:08:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Destroys the action.
|
2006-11-27 08:08:39 +00:00
|
|
|
*/
|
2007-04-20 12:37:12 +00:00
|
|
|
virtual ~Action();
|
2006-11-27 08:08:39 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the type of the action. Every inherited class must return
|
2006-11-27 08:08:39 +00:00
|
|
|
* an unique identifier.
|
|
|
|
*
|
2007-04-20 12:37:12 +00:00
|
|
|
* @see ActionType
|
2006-11-27 08:08:39 +00:00
|
|
|
*/
|
2007-04-20 12:37:12 +00:00
|
|
|
virtual ActionType actionType() const = 0;
|
2004-12-10 16:04:45 +00:00
|
|
|
|
2006-11-27 08:08:39 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns a i18n'ed tip of the action that is presented to
|
2006-11-27 08:08:39 +00:00
|
|
|
* the user.
|
|
|
|
*/
|
2007-04-20 12:37:12 +00:00
|
|
|
virtual QString actionTip() const;
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2012-04-03 12:18:10 +00:00
|
|
|
/**
|
|
|
|
* Sets the "native" @p id of the action.
|
|
|
|
*
|
|
|
|
* This is for use of the Generator, that can optionally store an
|
|
|
|
* handle (a pointer, an identifier, etc) of the "native" action
|
|
|
|
* object, if any.
|
|
|
|
*
|
|
|
|
* @note Okular makes no use of this
|
|
|
|
*
|
|
|
|
* @since 0.15 (KDE 4.9)
|
|
|
|
*/
|
|
|
|
void setNativeId( const QVariant &id );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the "native" id of the action.
|
|
|
|
*
|
|
|
|
* @since 0.15 (KDE 4.9)
|
|
|
|
*/
|
|
|
|
QVariant nativeId() const;
|
|
|
|
|
2018-04-30 11:41:55 +00:00
|
|
|
/**
|
|
|
|
* Returns the next actions to be executed after.
|
|
|
|
*
|
|
|
|
* @since 1.5
|
|
|
|
*/
|
|
|
|
QVector< Action * > nextActions() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the next actions.
|
|
|
|
*
|
|
|
|
* Takes ownership of the objects in the actions vector.
|
|
|
|
* @since 1.5
|
|
|
|
*/
|
|
|
|
void setNextActions( const QVector< Action * > &actions );
|
|
|
|
|
2007-05-02 21:59:44 +00:00
|
|
|
protected:
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @cond PRIVATE
|
2007-05-02 21:59:44 +00:00
|
|
|
Action( ActionPrivate &dd );
|
|
|
|
Q_DECLARE_PRIVATE( Action )
|
|
|
|
ActionPrivate *d_ptr;
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @endcond
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2007-05-02 21:59:44 +00:00
|
|
|
private:
|
2007-04-20 12:37:12 +00:00
|
|
|
Q_DISABLE_COPY( Action )
|
2004-12-10 16:04:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-11-27 08:08:39 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* The Goto action changes the viewport to another page
|
2006-11-27 08:08:39 +00:00
|
|
|
* or loads an external document.
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT GotoAction : public Action
|
2004-12-10 16:04:45 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-11-27 08:08:39 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Creates a new goto action.
|
2006-11-27 08:08:39 +00:00
|
|
|
*
|
|
|
|
* @p fileName The name of an external file that shall be loaded.
|
|
|
|
* @p viewport The target viewport information of the current document.
|
|
|
|
*/
|
2007-05-02 22:50:27 +00:00
|
|
|
GotoAction( const QString& fileName, const DocumentViewport & viewport );
|
2006-11-27 08:08:39 +00:00
|
|
|
|
2009-05-13 11:13:04 +00:00
|
|
|
/**
|
|
|
|
* Creates a new goto action.
|
|
|
|
*
|
|
|
|
* @p fileName The name of an external file that shall be loaded.
|
|
|
|
* @p namedDestination The target named destination for the target document.
|
|
|
|
*
|
|
|
|
* @since 0.9 (KDE 4.3)
|
|
|
|
*/
|
|
|
|
GotoAction( const QString& fileName, const QString& namedDestination );
|
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Destroys the goto action.
|
2007-01-03 14:30:48 +00:00
|
|
|
*/
|
2007-05-02 22:50:27 +00:00
|
|
|
virtual ~GotoAction();
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2006-11-27 08:08:39 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action type.
|
2006-11-27 08:08:39 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
ActionType actionType() const override;
|
2006-11-27 08:08:39 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action tip.
|
2006-11-27 08:08:39 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
QString actionTip() const override;
|
2004-12-10 16:04:45 +00:00
|
|
|
|
2006-11-27 08:08:39 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns whether the goto action points to an external document.
|
2006-11-27 08:08:39 +00:00
|
|
|
*/
|
|
|
|
bool isExternal() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the filename of the external document.
|
|
|
|
*/
|
|
|
|
QString fileName() const;
|
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the document viewport the goto action points to.
|
2006-11-27 08:08:39 +00:00
|
|
|
*/
|
|
|
|
DocumentViewport destViewport() const;
|
|
|
|
|
2009-05-13 11:13:04 +00:00
|
|
|
/**
|
|
|
|
* Returns the document named destination the goto action points to.
|
|
|
|
*
|
|
|
|
* @since 0.9 (KDE 4.3)
|
|
|
|
*/
|
|
|
|
QString destinationName() const;
|
|
|
|
|
2004-12-10 16:04:45 +00:00
|
|
|
private:
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_DECLARE_PRIVATE( GotoAction )
|
|
|
|
Q_DISABLE_COPY( GotoAction )
|
2004-12-10 16:04:45 +00:00
|
|
|
};
|
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* The Execute action executes an external application.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT ExecuteAction : public Action
|
2004-12-10 16:04:45 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Creates a new execute action.
|
2006-12-04 09:31:53 +00:00
|
|
|
*
|
|
|
|
* @param fileName The file name of the application to execute.
|
|
|
|
* @param parameters The parameters of the application to execute.
|
|
|
|
*/
|
2007-05-02 22:50:27 +00:00
|
|
|
ExecuteAction( const QString &fileName, const QString ¶meters );
|
2004-12-10 16:04:45 +00:00
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Destroys the execute action.
|
2007-01-03 14:30:48 +00:00
|
|
|
*/
|
2007-05-02 22:50:27 +00:00
|
|
|
virtual ~ExecuteAction();
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action type.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
ActionType actionType() const override;
|
2006-12-04 09:31:53 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action tip.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
QString actionTip() const override;
|
2004-12-10 16:04:45 +00:00
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
|
|
|
* Returns the file name of the application to execute.
|
|
|
|
*/
|
|
|
|
QString fileName() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the parameters of the application to execute.
|
|
|
|
*/
|
|
|
|
QString parameters() const;
|
|
|
|
|
2004-12-10 16:04:45 +00:00
|
|
|
private:
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_DECLARE_PRIVATE( ExecuteAction )
|
|
|
|
Q_DISABLE_COPY( ExecuteAction )
|
2004-12-10 16:04:45 +00:00
|
|
|
};
|
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* The Browse action browses an url by opening a web browser or
|
2018-09-01 08:25:57 +00:00
|
|
|
* email client, depending on the url protocol (e.g. http, mailto, etc.).
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT BrowseAction : public Action
|
2004-12-10 16:04:45 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Creates a new browse action.
|
2006-12-04 09:31:53 +00:00
|
|
|
*
|
|
|
|
* @param url The url to browse.
|
|
|
|
*/
|
2018-09-01 08:25:57 +00:00
|
|
|
explicit BrowseAction( const QUrl &url );
|
2004-12-10 16:04:45 +00:00
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Destroys the browse action.
|
2007-01-03 14:30:48 +00:00
|
|
|
*/
|
2007-05-02 22:50:27 +00:00
|
|
|
virtual ~BrowseAction();
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action type.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
ActionType actionType() const override;
|
2006-12-04 09:31:53 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action tip.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
QString actionTip() const override;
|
2004-12-10 16:04:45 +00:00
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
|
|
|
* Returns the url to browse.
|
|
|
|
*/
|
2014-08-10 18:36:41 +00:00
|
|
|
QUrl url() const;
|
2006-12-04 09:31:53 +00:00
|
|
|
|
2004-12-10 16:04:45 +00:00
|
|
|
private:
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_DECLARE_PRIVATE( BrowseAction )
|
|
|
|
Q_DISABLE_COPY( BrowseAction )
|
2004-12-10 16:04:45 +00:00
|
|
|
};
|
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* The DocumentAction action contains an action that is performed on
|
2006-12-04 09:31:53 +00:00
|
|
|
* the current document.
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT DocumentAction : public Action
|
2004-12-10 16:04:45 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
|
|
|
* Describes the possible action types.
|
|
|
|
*
|
|
|
|
* WARNING KEEP IN SYNC WITH POPPLER!
|
|
|
|
*/
|
2007-04-20 12:37:12 +00:00
|
|
|
enum DocumentActionType {
|
2006-12-04 09:31:53 +00:00
|
|
|
PageFirst = 1, ///< Jump to first page
|
|
|
|
PagePrev = 2, ///< Jump to previous page
|
|
|
|
PageNext = 3, ///< Jump to next page
|
|
|
|
PageLast = 4, ///< Jump to last page
|
|
|
|
HistoryBack = 5, ///< Go back in page history
|
|
|
|
HistoryForward = 6, ///< Go forward in page history
|
|
|
|
Quit = 7, ///< Quit application
|
|
|
|
Presentation = 8, ///< Start presentation
|
|
|
|
EndPresentation = 9, ///< End presentation
|
|
|
|
Find = 10, ///< Open find dialog
|
|
|
|
GoToPage = 11, ///< Goto page
|
|
|
|
Close = 12 ///< Close document
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Creates a new document action.
|
2006-12-04 09:31:53 +00:00
|
|
|
*
|
2007-05-27 09:53:45 +00:00
|
|
|
* @param documentActionType The type of document action.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2007-05-02 22:50:27 +00:00
|
|
|
explicit DocumentAction( enum DocumentActionType documentActionType );
|
2006-12-04 09:31:53 +00:00
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Destroys the document action.
|
2007-01-03 14:30:48 +00:00
|
|
|
*/
|
2007-05-02 22:50:27 +00:00
|
|
|
virtual ~DocumentAction();
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action type.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
ActionType actionType() const override;
|
2006-12-04 09:31:53 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action tip.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
QString actionTip() const override;
|
2004-12-10 16:04:45 +00:00
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
|
|
|
* Returns the type of action.
|
|
|
|
*/
|
2007-04-20 12:37:12 +00:00
|
|
|
DocumentActionType documentActionType() const;
|
2006-12-04 09:31:53 +00:00
|
|
|
|
2004-12-10 16:04:45 +00:00
|
|
|
private:
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_DECLARE_PRIVATE( DocumentAction )
|
|
|
|
Q_DISABLE_COPY( DocumentAction )
|
2004-12-10 16:04:45 +00:00
|
|
|
};
|
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* The Sound action plays a sound on activation.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT SoundAction : public Action
|
2006-10-09 18:02:59 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Creates a new sound action.
|
2006-12-04 09:31:53 +00:00
|
|
|
*
|
|
|
|
* @param volume The volume of the sound.
|
|
|
|
* @param synchronous Whether the sound shall be played synchronous.
|
|
|
|
* @param repeat Whether the sound shall be repeated.
|
|
|
|
* @param mix Whether the sound shall be mixed.
|
|
|
|
* @param sound The sound object which contains the sound data.
|
|
|
|
*/
|
2007-05-02 22:50:27 +00:00
|
|
|
SoundAction( double volume, bool synchronous, bool repeat, bool mix, Okular::Sound *sound );
|
2006-12-04 09:31:53 +00:00
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Destroys the sound action.
|
2007-01-03 14:30:48 +00:00
|
|
|
*/
|
2007-05-02 22:50:27 +00:00
|
|
|
virtual ~SoundAction();
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action type.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
ActionType actionType() const override;
|
2006-12-04 09:31:53 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action tip.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
QString actionTip() const override;
|
2006-12-04 09:31:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the volume of the sound.
|
|
|
|
*/
|
|
|
|
double volume() const;
|
2006-10-09 18:02:59 +00:00
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the sound shall be played synchronous.
|
|
|
|
*/
|
|
|
|
bool synchronous() const;
|
2006-10-09 18:02:59 +00:00
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the sound shall be repeated.
|
|
|
|
*/
|
|
|
|
bool repeat() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether the sound shall be mixed.
|
|
|
|
*/
|
|
|
|
bool mix() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the sound object which contains the sound data.
|
|
|
|
*/
|
|
|
|
Okular::Sound *sound() const;
|
2006-10-09 18:02:59 +00:00
|
|
|
|
|
|
|
private:
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_DECLARE_PRIVATE( SoundAction )
|
|
|
|
Q_DISABLE_COPY( SoundAction )
|
2006-10-09 18:02:59 +00:00
|
|
|
};
|
|
|
|
|
2008-04-13 22:30:27 +00:00
|
|
|
/**
|
|
|
|
* The Script action executes a Script code.
|
|
|
|
*
|
|
|
|
* @since 0.7 (KDE 4.1)
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT ScriptAction : public Action
|
2008-04-13 22:30:27 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new Script action.
|
|
|
|
*
|
|
|
|
* @param script The code to execute.
|
|
|
|
*/
|
|
|
|
ScriptAction( enum ScriptType type, const QString &script );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the browse action.
|
|
|
|
*/
|
|
|
|
virtual ~ScriptAction();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the action type.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
ActionType actionType() const override;
|
2008-04-13 22:30:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the action tip.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
QString actionTip() const override;
|
2008-04-13 22:30:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the type of action.
|
|
|
|
*/
|
|
|
|
ScriptType scriptType() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the code.
|
|
|
|
*/
|
|
|
|
QString script() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE( ScriptAction )
|
|
|
|
Q_DISABLE_COPY( ScriptAction )
|
|
|
|
};
|
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2012-04-03 12:18:10 +00:00
|
|
|
* The Movie action executes an operation on a video on activation.
|
|
|
|
*
|
|
|
|
* @since 0.15 (KDE 4.9)
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT MovieAction : public Action
|
2004-12-10 16:04:45 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-04-03 12:18:10 +00:00
|
|
|
/**
|
|
|
|
* Describes the possible operation types.
|
|
|
|
*/
|
|
|
|
enum OperationType {
|
|
|
|
Play,
|
|
|
|
Stop,
|
|
|
|
Pause,
|
|
|
|
Resume
|
|
|
|
};
|
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Creates a new movie action.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2018-09-01 08:25:57 +00:00
|
|
|
explicit MovieAction( OperationType operation );
|
2006-12-04 09:31:53 +00:00
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Destroys the movie action.
|
2007-01-03 14:30:48 +00:00
|
|
|
*/
|
2007-05-02 22:50:27 +00:00
|
|
|
virtual ~MovieAction();
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2006-12-04 09:31:53 +00:00
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action type.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
ActionType actionType() const override;
|
2006-12-04 09:31:53 +00:00
|
|
|
|
|
|
|
/**
|
2007-04-20 12:58:15 +00:00
|
|
|
* Returns the action tip.
|
2006-12-04 09:31:53 +00:00
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
QString actionTip() const override;
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2012-04-03 12:18:10 +00:00
|
|
|
/**
|
|
|
|
* Returns the operation type.
|
|
|
|
*/
|
|
|
|
OperationType operation() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p annotation that is associated with the movie action.
|
|
|
|
*/
|
|
|
|
void setAnnotation( MovieAnnotation *annotation );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the annotation or @c 0 if no annotation has been set.
|
|
|
|
*/
|
|
|
|
MovieAnnotation* annotation() const;
|
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
private:
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_DECLARE_PRIVATE( MovieAction )
|
|
|
|
Q_DISABLE_COPY( MovieAction )
|
2004-12-10 16:04:45 +00:00
|
|
|
};
|
|
|
|
|
2012-09-27 10:42:17 +00:00
|
|
|
/**
|
|
|
|
* The Rendition action executes an operation on a video or
|
|
|
|
* executes some JavaScript code on activation.
|
|
|
|
*
|
|
|
|
* @since 0.16 (KDE 4.10)
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT RenditionAction : public Action
|
2012-09-27 10:42:17 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Describes the possible operation types.
|
|
|
|
*/
|
|
|
|
enum OperationType {
|
|
|
|
None, ///< Execute only the JavaScript
|
|
|
|
Play, ///< Start playing the video
|
|
|
|
Stop, ///< Stop playing the video
|
|
|
|
Pause, ///< Pause the video
|
|
|
|
Resume ///< Resume playing the video
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a new rendition action.
|
|
|
|
*
|
|
|
|
* @param operation The type of operation the action executes.
|
|
|
|
* @param movie The movie object the action references.
|
|
|
|
* @param scriptType The type of script the action executes.
|
|
|
|
* @param script The actual script the action executes.
|
|
|
|
*/
|
|
|
|
RenditionAction( OperationType operation, Okular::Movie *movie, enum ScriptType scriptType, const QString &script );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the rendition action.
|
|
|
|
*/
|
|
|
|
virtual ~RenditionAction();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the action type.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
ActionType actionType() const override;
|
2012-09-27 10:42:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the action tip.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
QString actionTip() const override;
|
2012-09-27 10:42:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the operation type.
|
|
|
|
*/
|
|
|
|
OperationType operation() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the movie object or @c 0 if no movie object was set on construction time.
|
|
|
|
*/
|
|
|
|
Okular::Movie* movie() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the type of script.
|
|
|
|
*/
|
|
|
|
ScriptType scriptType() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the script code.
|
|
|
|
*/
|
|
|
|
QString script() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the @p annotation that is associated with the rendition action.
|
|
|
|
*/
|
|
|
|
void setAnnotation( ScreenAnnotation *annotation );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the annotation or @c 0 if no annotation has been set.
|
|
|
|
*/
|
|
|
|
ScreenAnnotation* annotation() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE( RenditionAction )
|
|
|
|
Q_DISABLE_COPY( RenditionAction )
|
|
|
|
};
|
|
|
|
|
2016-11-26 15:00:02 +00:00
|
|
|
class OKULARCORE_EXPORT BackendOpaqueAction : public Action
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BackendOpaqueAction();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the action type.
|
|
|
|
*/
|
2017-03-02 19:38:50 +00:00
|
|
|
ActionType actionType() const override;
|
2016-11-26 15:00:02 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY( BackendOpaqueAction )
|
|
|
|
};
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
}
|
|
|
|
|
2004-12-10 16:04:45 +00:00
|
|
|
#endif
|