mirror of
https://invent.kde.org/graphics/okular
synced 2024-07-05 00:58:46 +00:00
rename (almost) every ActionFoo class to FooAction
exception to this is the ActionDocumentAction, renamed to DocumentAction and whose id is DocAction svn path=/trunk/KDE/kdegraphics/okular/; revision=660523
This commit is contained in:
parent
25b6b590b9
commit
106e96240c
156
core/action.cpp
156
core/action.cpp
|
@ -45,12 +45,12 @@ QString Action::actionTip() const
|
|||
return "";
|
||||
}
|
||||
|
||||
// ActionGoto
|
||||
// GotoAction
|
||||
|
||||
class Okular::ActionGotoPrivate : public Okular::ActionPrivate
|
||||
class Okular::GotoActionPrivate : public Okular::ActionPrivate
|
||||
{
|
||||
public:
|
||||
ActionGotoPrivate( const QString &fileName, const DocumentViewport &viewport )
|
||||
GotoActionPrivate( const QString &fileName, const DocumentViewport &viewport )
|
||||
: ActionPrivate(), m_extFileName( fileName ), m_vp( viewport )
|
||||
{
|
||||
}
|
||||
|
@ -59,51 +59,51 @@ class Okular::ActionGotoPrivate : public Okular::ActionPrivate
|
|||
DocumentViewport m_vp;
|
||||
};
|
||||
|
||||
ActionGoto::ActionGoto( const QString& fileName, const DocumentViewport & viewport )
|
||||
: Action( *new ActionGotoPrivate( fileName, viewport ) )
|
||||
GotoAction::GotoAction( const QString& fileName, const DocumentViewport & viewport )
|
||||
: Action( *new GotoActionPrivate( fileName, viewport ) )
|
||||
{
|
||||
}
|
||||
|
||||
ActionGoto::~ActionGoto()
|
||||
GotoAction::~GotoAction()
|
||||
{
|
||||
}
|
||||
|
||||
Action::ActionType ActionGoto::actionType() const
|
||||
Action::ActionType GotoAction::actionType() const
|
||||
{
|
||||
return Goto;
|
||||
}
|
||||
|
||||
QString ActionGoto::actionTip() const
|
||||
QString GotoAction::actionTip() const
|
||||
{
|
||||
Q_D( const ActionGoto );
|
||||
Q_D( const GotoAction );
|
||||
return d->m_extFileName.isEmpty() ? ( d->m_vp.isValid() ? i18n( "Go to page %1", d->m_vp.pageNumber + 1 ) : "" ) :
|
||||
i18n("Open external file");
|
||||
}
|
||||
|
||||
bool ActionGoto::isExternal() const
|
||||
bool GotoAction::isExternal() const
|
||||
{
|
||||
Q_D( const ActionGoto );
|
||||
Q_D( const GotoAction );
|
||||
return !d->m_extFileName.isEmpty();
|
||||
}
|
||||
|
||||
QString ActionGoto::fileName() const
|
||||
QString GotoAction::fileName() const
|
||||
{
|
||||
Q_D( const ActionGoto );
|
||||
Q_D( const GotoAction );
|
||||
return d->m_extFileName;
|
||||
}
|
||||
|
||||
DocumentViewport ActionGoto::destViewport() const
|
||||
DocumentViewport GotoAction::destViewport() const
|
||||
{
|
||||
Q_D( const ActionGoto );
|
||||
Q_D( const GotoAction );
|
||||
return d->m_vp;
|
||||
}
|
||||
|
||||
// ActionExecute
|
||||
// ExecuteAction
|
||||
|
||||
class Okular::ActionExecutePrivate : public Okular::ActionPrivate
|
||||
class Okular::ExecuteActionPrivate : public Okular::ActionPrivate
|
||||
{
|
||||
public:
|
||||
ActionExecutePrivate( const QString &file, const QString & parameters )
|
||||
ExecuteActionPrivate( const QString &file, const QString & parameters )
|
||||
: ActionPrivate(), m_fileName( file ), m_parameters( parameters )
|
||||
{
|
||||
}
|
||||
|
@ -112,44 +112,44 @@ class Okular::ActionExecutePrivate : public Okular::ActionPrivate
|
|||
QString m_parameters;
|
||||
};
|
||||
|
||||
ActionExecute::ActionExecute( const QString &file, const QString & parameters )
|
||||
: Action( *new ActionExecutePrivate( file, parameters ) )
|
||||
ExecuteAction::ExecuteAction( const QString &file, const QString & parameters )
|
||||
: Action( *new ExecuteActionPrivate( file, parameters ) )
|
||||
{
|
||||
}
|
||||
|
||||
ActionExecute::~ActionExecute()
|
||||
ExecuteAction::~ExecuteAction()
|
||||
{
|
||||
}
|
||||
|
||||
Action::ActionType ActionExecute::actionType() const
|
||||
Action::ActionType ExecuteAction::actionType() const
|
||||
{
|
||||
return Execute;
|
||||
}
|
||||
|
||||
QString ActionExecute::actionTip() const
|
||||
QString ExecuteAction::actionTip() const
|
||||
{
|
||||
Q_D( const Okular::ActionExecute );
|
||||
Q_D( const Okular::ExecuteAction );
|
||||
return i18n( "Execute '%1'...", d->m_fileName );
|
||||
}
|
||||
|
||||
QString ActionExecute::fileName() const
|
||||
QString ExecuteAction::fileName() const
|
||||
{
|
||||
Q_D( const Okular::ActionExecute );
|
||||
Q_D( const Okular::ExecuteAction );
|
||||
return d->m_fileName;
|
||||
}
|
||||
|
||||
QString ActionExecute::parameters() const
|
||||
QString ExecuteAction::parameters() const
|
||||
{
|
||||
Q_D( const Okular::ActionExecute );
|
||||
Q_D( const Okular::ExecuteAction );
|
||||
return d->m_parameters;
|
||||
}
|
||||
|
||||
// BrowseAction
|
||||
|
||||
class Okular::ActionBrowsePrivate : public Okular::ActionPrivate
|
||||
class Okular::BrowseActionPrivate : public Okular::ActionPrivate
|
||||
{
|
||||
public:
|
||||
ActionBrowsePrivate( const QString &url )
|
||||
BrowseActionPrivate( const QString &url )
|
||||
: ActionPrivate(), m_url( url )
|
||||
{
|
||||
}
|
||||
|
@ -157,68 +157,68 @@ class Okular::ActionBrowsePrivate : public Okular::ActionPrivate
|
|||
QString m_url;
|
||||
};
|
||||
|
||||
ActionBrowse::ActionBrowse( const QString &url )
|
||||
: Action( *new ActionBrowsePrivate( url ) )
|
||||
BrowseAction::BrowseAction( const QString &url )
|
||||
: Action( *new BrowseActionPrivate( url ) )
|
||||
{
|
||||
}
|
||||
|
||||
ActionBrowse::~ActionBrowse()
|
||||
BrowseAction::~BrowseAction()
|
||||
{
|
||||
}
|
||||
|
||||
Action::ActionType ActionBrowse::actionType() const
|
||||
Action::ActionType BrowseAction::actionType() const
|
||||
{
|
||||
return Browse;
|
||||
}
|
||||
|
||||
QString ActionBrowse::actionTip() const
|
||||
QString BrowseAction::actionTip() const
|
||||
{
|
||||
Q_D( const Okular::ActionBrowse );
|
||||
Q_D( const Okular::BrowseAction );
|
||||
return d->m_url;
|
||||
}
|
||||
|
||||
QString ActionBrowse::url() const
|
||||
QString BrowseAction::url() const
|
||||
{
|
||||
Q_D( const Okular::ActionBrowse );
|
||||
Q_D( const Okular::BrowseAction );
|
||||
return d->m_url;
|
||||
}
|
||||
|
||||
// ActionDocumentAction
|
||||
// DocumentAction
|
||||
|
||||
class Okular::ActionDocumentActionPrivate : public Okular::ActionPrivate
|
||||
class Okular::DocumentActionPrivate : public Okular::ActionPrivate
|
||||
{
|
||||
public:
|
||||
ActionDocumentActionPrivate( enum ActionDocumentAction::DocumentActionType documentActionType )
|
||||
DocumentActionPrivate( enum DocumentAction::DocumentActionType documentActionType )
|
||||
: ActionPrivate(), m_type( documentActionType )
|
||||
{
|
||||
}
|
||||
|
||||
ActionDocumentAction::DocumentActionType m_type;
|
||||
DocumentAction::DocumentActionType m_type;
|
||||
};
|
||||
|
||||
ActionDocumentAction::ActionDocumentAction( enum DocumentActionType documentActionType )
|
||||
: Action( *new ActionDocumentActionPrivate( documentActionType ) )
|
||||
DocumentAction::DocumentAction( enum DocumentActionType documentActionType )
|
||||
: Action( *new DocumentActionPrivate( documentActionType ) )
|
||||
{
|
||||
}
|
||||
|
||||
ActionDocumentAction::~ActionDocumentAction()
|
||||
DocumentAction::~DocumentAction()
|
||||
{
|
||||
}
|
||||
|
||||
ActionDocumentAction::DocumentActionType ActionDocumentAction::documentActionType() const
|
||||
DocumentAction::DocumentActionType DocumentAction::documentActionType() const
|
||||
{
|
||||
Q_D( const Okular::ActionDocumentAction );
|
||||
Q_D( const Okular::DocumentAction );
|
||||
return d->m_type;
|
||||
}
|
||||
|
||||
Action::ActionType ActionDocumentAction::actionType() const
|
||||
Action::ActionType DocumentAction::actionType() const
|
||||
{
|
||||
return DocumentAction;
|
||||
return DocAction;
|
||||
}
|
||||
|
||||
QString ActionDocumentAction::actionTip() const
|
||||
QString DocumentAction::actionTip() const
|
||||
{
|
||||
Q_D( const Okular::ActionDocumentAction );
|
||||
Q_D( const Okular::DocumentAction );
|
||||
switch ( d->m_type )
|
||||
{
|
||||
case PageFirst:
|
||||
|
@ -250,18 +250,18 @@ QString ActionDocumentAction::actionTip() const
|
|||
return QString();
|
||||
}
|
||||
|
||||
// ActionSound
|
||||
// SoundAction
|
||||
|
||||
class Okular::ActionSoundPrivate : public Okular::ActionPrivate
|
||||
class Okular::SoundActionPrivate : public Okular::ActionPrivate
|
||||
{
|
||||
public:
|
||||
ActionSoundPrivate( double volume, bool sync, bool repeat, bool mix, Okular::Sound *sound )
|
||||
SoundActionPrivate( double volume, bool sync, bool repeat, bool mix, Okular::Sound *sound )
|
||||
: ActionPrivate(), m_volume( volume ), m_sync( sync ),
|
||||
m_repeat( repeat ), m_mix( mix ), m_sound( sound )
|
||||
{
|
||||
}
|
||||
|
||||
~ActionSoundPrivate()
|
||||
~SoundActionPrivate()
|
||||
{
|
||||
delete m_sound;
|
||||
}
|
||||
|
@ -273,81 +273,81 @@ class Okular::ActionSoundPrivate : public Okular::ActionPrivate
|
|||
Okular::Sound *m_sound;
|
||||
};
|
||||
|
||||
ActionSound::ActionSound( double volume, bool sync, bool repeat, bool mix, Okular::Sound *sound )
|
||||
: Action( *new ActionSoundPrivate( volume, sync, repeat, mix, sound ) )
|
||||
SoundAction::SoundAction( double volume, bool sync, bool repeat, bool mix, Okular::Sound *sound )
|
||||
: Action( *new SoundActionPrivate( volume, sync, repeat, mix, sound ) )
|
||||
{
|
||||
}
|
||||
|
||||
ActionSound::~ActionSound()
|
||||
SoundAction::~SoundAction()
|
||||
{
|
||||
}
|
||||
|
||||
Action::ActionType ActionSound::actionType() const
|
||||
Action::ActionType SoundAction::actionType() const
|
||||
{
|
||||
return Sound;
|
||||
}
|
||||
|
||||
QString ActionSound::actionTip() const
|
||||
QString SoundAction::actionTip() const
|
||||
{
|
||||
return i18n( "Play sound..." );
|
||||
}
|
||||
|
||||
double ActionSound::volume() const
|
||||
double SoundAction::volume() const
|
||||
{
|
||||
Q_D( const Okular::ActionSound );
|
||||
Q_D( const Okular::SoundAction );
|
||||
return d->m_volume;
|
||||
}
|
||||
|
||||
bool ActionSound::synchronous() const
|
||||
bool SoundAction::synchronous() const
|
||||
{
|
||||
Q_D( const Okular::ActionSound );
|
||||
Q_D( const Okular::SoundAction );
|
||||
return d->m_sync;
|
||||
}
|
||||
|
||||
bool ActionSound::repeat() const
|
||||
bool SoundAction::repeat() const
|
||||
{
|
||||
Q_D( const Okular::ActionSound );
|
||||
Q_D( const Okular::SoundAction );
|
||||
return d->m_repeat;
|
||||
}
|
||||
|
||||
bool ActionSound::mix() const
|
||||
bool SoundAction::mix() const
|
||||
{
|
||||
Q_D( const Okular::ActionSound );
|
||||
Q_D( const Okular::SoundAction );
|
||||
return d->m_mix;
|
||||
}
|
||||
|
||||
Okular::Sound *ActionSound::sound() const
|
||||
Okular::Sound *SoundAction::sound() const
|
||||
{
|
||||
Q_D( const Okular::ActionSound );
|
||||
Q_D( const Okular::SoundAction );
|
||||
return d->m_sound;
|
||||
}
|
||||
|
||||
// ActionMovie
|
||||
// MovieAction
|
||||
|
||||
class Okular::ActionMoviePrivate : public Okular::ActionPrivate
|
||||
class Okular::MovieActionPrivate : public Okular::ActionPrivate
|
||||
{
|
||||
public:
|
||||
ActionMoviePrivate()
|
||||
MovieActionPrivate()
|
||||
: ActionPrivate()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
ActionMovie::ActionMovie()
|
||||
: Action( *new ActionMoviePrivate() )
|
||||
MovieAction::MovieAction()
|
||||
: Action( *new MovieActionPrivate() )
|
||||
{
|
||||
}
|
||||
|
||||
ActionMovie::~ActionMovie()
|
||||
MovieAction::~MovieAction()
|
||||
{
|
||||
}
|
||||
|
||||
Action::ActionType ActionMovie::actionType() const
|
||||
Action::ActionType MovieAction::actionType() const
|
||||
{
|
||||
return Movie;
|
||||
}
|
||||
|
||||
QString ActionMovie::actionTip() const
|
||||
QString MovieAction::actionTip() const
|
||||
{
|
||||
return i18n( "Play movie..." );
|
||||
}
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
namespace Okular {
|
||||
|
||||
class ActionPrivate;
|
||||
class ActionGotoPrivate;
|
||||
class ActionExecutePrivate;
|
||||
class ActionBrowsePrivate;
|
||||
class ActionDocumentActionPrivate;
|
||||
class ActionSoundPrivate;
|
||||
class ActionMoviePrivate;
|
||||
class GotoActionPrivate;
|
||||
class ExecuteActionPrivate;
|
||||
class BrowseActionPrivate;
|
||||
class DocumentActionPrivate;
|
||||
class SoundActionPrivate;
|
||||
class MovieActionPrivate;
|
||||
class Sound;
|
||||
class DocumentViewport;
|
||||
|
||||
|
@ -43,7 +43,7 @@ class OKULAR_EXPORT Action
|
|||
Goto, ///< Goto a given page or external document
|
||||
Execute, ///< Execute a command or external application
|
||||
Browse, ///< Browse a given website
|
||||
DocumentAction, ///< Start a custom action
|
||||
DocAction, ///< Start a custom action
|
||||
Sound, ///< Play a sound
|
||||
Movie ///< Play a movie
|
||||
};
|
||||
|
@ -81,7 +81,7 @@ class OKULAR_EXPORT Action
|
|||
* The Goto action changes the viewport to another page
|
||||
* or loads an external document.
|
||||
*/
|
||||
class OKULAR_EXPORT ActionGoto : public Action
|
||||
class OKULAR_EXPORT GotoAction : public Action
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
@ -90,12 +90,12 @@ class OKULAR_EXPORT ActionGoto : public Action
|
|||
* @p fileName The name of an external file that shall be loaded.
|
||||
* @p viewport The target viewport information of the current document.
|
||||
*/
|
||||
ActionGoto( const QString& fileName, const DocumentViewport & viewport );
|
||||
GotoAction( const QString& fileName, const DocumentViewport & viewport );
|
||||
|
||||
/**
|
||||
* Destroys the goto action.
|
||||
*/
|
||||
virtual ~ActionGoto();
|
||||
virtual ~GotoAction();
|
||||
|
||||
/**
|
||||
* Returns the action type.
|
||||
|
@ -123,14 +123,14 @@ class OKULAR_EXPORT ActionGoto : public Action
|
|||
DocumentViewport destViewport() const;
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE( ActionGoto )
|
||||
Q_DISABLE_COPY( ActionGoto )
|
||||
Q_DECLARE_PRIVATE( GotoAction )
|
||||
Q_DISABLE_COPY( GotoAction )
|
||||
};
|
||||
|
||||
/**
|
||||
* The Execute action executes an external application.
|
||||
*/
|
||||
class OKULAR_EXPORT ActionExecute : public Action
|
||||
class OKULAR_EXPORT ExecuteAction : public Action
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
@ -139,12 +139,12 @@ class OKULAR_EXPORT ActionExecute : public Action
|
|||
* @param fileName The file name of the application to execute.
|
||||
* @param parameters The parameters of the application to execute.
|
||||
*/
|
||||
ActionExecute( const QString &fileName, const QString ¶meters );
|
||||
ExecuteAction( const QString &fileName, const QString ¶meters );
|
||||
|
||||
/**
|
||||
* Destroys the execute action.
|
||||
*/
|
||||
virtual ~ActionExecute();
|
||||
virtual ~ExecuteAction();
|
||||
|
||||
/**
|
||||
* Returns the action type.
|
||||
|
@ -167,15 +167,15 @@ class OKULAR_EXPORT ActionExecute : public Action
|
|||
QString parameters() const;
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE( ActionExecute )
|
||||
Q_DISABLE_COPY( ActionExecute )
|
||||
Q_DECLARE_PRIVATE( ExecuteAction )
|
||||
Q_DISABLE_COPY( ExecuteAction )
|
||||
};
|
||||
|
||||
/**
|
||||
* The Browse action browses an url by opening a web browser or
|
||||
* email client, depedning on the url protocol (e.g. http, mailto, etc.).
|
||||
*/
|
||||
class OKULAR_EXPORT ActionBrowse : public Action
|
||||
class OKULAR_EXPORT BrowseAction : public Action
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
@ -183,12 +183,12 @@ class OKULAR_EXPORT ActionBrowse : public Action
|
|||
*
|
||||
* @param url The url to browse.
|
||||
*/
|
||||
ActionBrowse( const QString &url );
|
||||
BrowseAction( const QString &url );
|
||||
|
||||
/**
|
||||
* Destroys the browse action.
|
||||
*/
|
||||
virtual ~ActionBrowse();
|
||||
virtual ~BrowseAction();
|
||||
|
||||
/**
|
||||
* Returns the action type.
|
||||
|
@ -206,15 +206,15 @@ class OKULAR_EXPORT ActionBrowse : public Action
|
|||
QString url() const;
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE( ActionBrowse )
|
||||
Q_DISABLE_COPY( ActionBrowse )
|
||||
Q_DECLARE_PRIVATE( BrowseAction )
|
||||
Q_DISABLE_COPY( BrowseAction )
|
||||
};
|
||||
|
||||
/**
|
||||
* The DocumentAction action contains an action that is performed on
|
||||
* the current document.
|
||||
*/
|
||||
class OKULAR_EXPORT ActionDocumentAction : public Action
|
||||
class OKULAR_EXPORT DocumentAction : public Action
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
@ -242,12 +242,12 @@ class OKULAR_EXPORT ActionDocumentAction : public Action
|
|||
*
|
||||
* @param actionType The type of document action.
|
||||
*/
|
||||
explicit ActionDocumentAction( enum DocumentActionType documentActionType );
|
||||
explicit DocumentAction( enum DocumentActionType documentActionType );
|
||||
|
||||
/**
|
||||
* Destroys the document action.
|
||||
*/
|
||||
virtual ~ActionDocumentAction();
|
||||
virtual ~DocumentAction();
|
||||
|
||||
/**
|
||||
* Returns the action type.
|
||||
|
@ -265,14 +265,14 @@ class OKULAR_EXPORT ActionDocumentAction : public Action
|
|||
DocumentActionType documentActionType() const;
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE( ActionDocumentAction )
|
||||
Q_DISABLE_COPY( ActionDocumentAction )
|
||||
Q_DECLARE_PRIVATE( DocumentAction )
|
||||
Q_DISABLE_COPY( DocumentAction )
|
||||
};
|
||||
|
||||
/**
|
||||
* The Sound action plays a sound on activation.
|
||||
*/
|
||||
class OKULAR_EXPORT ActionSound : public Action
|
||||
class OKULAR_EXPORT SoundAction : public Action
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
@ -284,12 +284,12 @@ class OKULAR_EXPORT ActionSound : public Action
|
|||
* @param mix Whether the sound shall be mixed.
|
||||
* @param sound The sound object which contains the sound data.
|
||||
*/
|
||||
ActionSound( double volume, bool synchronous, bool repeat, bool mix, Okular::Sound *sound );
|
||||
SoundAction( double volume, bool synchronous, bool repeat, bool mix, Okular::Sound *sound );
|
||||
|
||||
/**
|
||||
* Destroys the sound action.
|
||||
*/
|
||||
virtual ~ActionSound();
|
||||
virtual ~SoundAction();
|
||||
|
||||
/**
|
||||
* Returns the action type.
|
||||
|
@ -327,25 +327,25 @@ class OKULAR_EXPORT ActionSound : public Action
|
|||
Okular::Sound *sound() const;
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE( ActionSound )
|
||||
Q_DISABLE_COPY( ActionSound )
|
||||
Q_DECLARE_PRIVATE( SoundAction )
|
||||
Q_DISABLE_COPY( SoundAction )
|
||||
};
|
||||
|
||||
/**
|
||||
* The Movie action plays a video on activation.
|
||||
*/
|
||||
class ActionMovie : public Action
|
||||
class MovieAction : public Action
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Creates a new movie action.
|
||||
*/
|
||||
ActionMovie();
|
||||
MovieAction();
|
||||
|
||||
/**
|
||||
* Destroys the movie action.
|
||||
*/
|
||||
virtual ~ActionMovie();
|
||||
virtual ~MovieAction();
|
||||
|
||||
/**
|
||||
* Returns the action type.
|
||||
|
@ -358,8 +358,8 @@ class ActionMovie : public Action
|
|||
QString actionTip() const;
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE( ActionMovie )
|
||||
Q_DISABLE_COPY( ActionMovie )
|
||||
Q_DECLARE_PRIVATE( MovieAction )
|
||||
Q_DISABLE_COPY( MovieAction )
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ using namespace Okular;
|
|||
class SoundInfo
|
||||
{
|
||||
public:
|
||||
explicit SoundInfo( const Sound * s = 0, const ActionSound * ls = 0 )
|
||||
explicit SoundInfo( const Sound * s = 0, const SoundAction * ls = 0 )
|
||||
: sound( s ), volume( 0.5 ), synchronous( false ), repeat( false ),
|
||||
mix( false )
|
||||
{
|
||||
|
@ -239,7 +239,7 @@ AudioPlayer * AudioPlayer::instance()
|
|||
return ≈
|
||||
}
|
||||
|
||||
void AudioPlayer::playSound( const Sound * sound, const ActionSound * linksound )
|
||||
void AudioPlayer::playSound( const Sound * sound, const SoundAction * linksound )
|
||||
{
|
||||
// we can't play null pointers ;)
|
||||
if ( !sound )
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
namespace Okular {
|
||||
|
||||
class ActionSound;
|
||||
class Sound;
|
||||
class SoundAction;
|
||||
|
||||
/**
|
||||
* @short An audio player.
|
||||
|
@ -41,7 +41,7 @@ class OKULAR_EXPORT AudioPlayer : public QObject
|
|||
* Enqueue the specified @p sound for playing, optionally taking more
|
||||
* information about the playing from the @p soundlink .
|
||||
*/
|
||||
void playSound( const Sound * sound, const ActionSound * linksound = 0 );
|
||||
void playSound( const Sound * sound, const SoundAction * linksound = 0 );
|
||||
|
||||
/**
|
||||
* Tell the AudioPlayer to stop all the playbacks.
|
||||
|
|
|
@ -1968,7 +1968,7 @@ void Document::processAction( const Action * action )
|
|||
switch( action->actionType() )
|
||||
{
|
||||
case Action::Goto: {
|
||||
const ActionGoto * go = static_cast< const ActionGoto * >( action );
|
||||
const GotoAction * go = static_cast< const GotoAction * >( action );
|
||||
d->m_nextDocumentViewport = go->destViewport();
|
||||
|
||||
// Explanation of why d->m_nextDocumentViewport is needed:
|
||||
|
@ -1998,7 +1998,7 @@ void Document::processAction( const Action * action )
|
|||
} break;
|
||||
|
||||
case Action::Execute: {
|
||||
const ActionExecute * exe = static_cast< const ActionExecute * >( action );
|
||||
const ExecuteAction * exe = static_cast< const ExecuteAction * >( action );
|
||||
QString fileName = exe->fileName();
|
||||
if ( fileName.endsWith( ".pdf" ) || fileName.endsWith( ".PDF" ) )
|
||||
{
|
||||
|
@ -2046,53 +2046,53 @@ void Document::processAction( const Action * action )
|
|||
KMessageBox::information( widget(), i18n( "No application found for opening file of mimetype %1.", mime->name() ) );
|
||||
} break;
|
||||
|
||||
case Action::DocumentAction: {
|
||||
const ActionDocumentAction * docaction = static_cast< const ActionDocumentAction * >( action );
|
||||
case Action::DocAction: {
|
||||
const DocumentAction * docaction = static_cast< const DocumentAction * >( action );
|
||||
switch( docaction->documentActionType() )
|
||||
{
|
||||
case ActionDocumentAction::PageFirst:
|
||||
case DocumentAction::PageFirst:
|
||||
setViewportPage( 0 );
|
||||
break;
|
||||
case ActionDocumentAction::PagePrev:
|
||||
case DocumentAction::PagePrev:
|
||||
if ( (*d->m_viewportIterator).pageNumber > 0 )
|
||||
setViewportPage( (*d->m_viewportIterator).pageNumber - 1 );
|
||||
break;
|
||||
case ActionDocumentAction::PageNext:
|
||||
case DocumentAction::PageNext:
|
||||
if ( (*d->m_viewportIterator).pageNumber < (int)d->m_pagesVector.count() - 1 )
|
||||
setViewportPage( (*d->m_viewportIterator).pageNumber + 1 );
|
||||
break;
|
||||
case ActionDocumentAction::PageLast:
|
||||
case DocumentAction::PageLast:
|
||||
setViewportPage( d->m_pagesVector.count() - 1 );
|
||||
break;
|
||||
case ActionDocumentAction::HistoryBack:
|
||||
case DocumentAction::HistoryBack:
|
||||
setPrevViewport();
|
||||
break;
|
||||
case ActionDocumentAction::HistoryForward:
|
||||
case DocumentAction::HistoryForward:
|
||||
setNextViewport();
|
||||
break;
|
||||
case ActionDocumentAction::Quit:
|
||||
case DocumentAction::Quit:
|
||||
emit quit();
|
||||
break;
|
||||
case ActionDocumentAction::Presentation:
|
||||
case DocumentAction::Presentation:
|
||||
emit linkPresentation();
|
||||
break;
|
||||
case ActionDocumentAction::EndPresentation:
|
||||
case DocumentAction::EndPresentation:
|
||||
emit linkEndPresentation();
|
||||
break;
|
||||
case ActionDocumentAction::Find:
|
||||
case DocumentAction::Find:
|
||||
emit linkFind();
|
||||
break;
|
||||
case ActionDocumentAction::GoToPage:
|
||||
case DocumentAction::GoToPage:
|
||||
emit linkGoToPage();
|
||||
break;
|
||||
case ActionDocumentAction::Close:
|
||||
case DocumentAction::Close:
|
||||
emit close();
|
||||
break;
|
||||
}
|
||||
} break;
|
||||
|
||||
case Action::Browse: {
|
||||
const ActionBrowse * browse = static_cast< const ActionBrowse * >( action );
|
||||
const BrowseAction * browse = static_cast< const BrowseAction * >( action );
|
||||
// if the url is a mailto one, invoke mailer
|
||||
if ( browse->url().startsWith( "mailto:", Qt::CaseInsensitive ) )
|
||||
KToolInvocation::invokeMailer( browse->url() );
|
||||
|
@ -2114,12 +2114,12 @@ void Document::processAction( const Action * action )
|
|||
} break;
|
||||
|
||||
case Action::Sound: {
|
||||
const ActionSound * linksound = static_cast< const ActionSound * >( action );
|
||||
const SoundAction * linksound = static_cast< const SoundAction * >( action );
|
||||
AudioPlayer::instance()->playSound( linksound->sound(), linksound );
|
||||
} break;
|
||||
|
||||
case Action::Movie:
|
||||
//const ActionMovie * browse = static_cast< const ActionMovie * >( action );
|
||||
//const MovieAction * movie = static_cast< const MovieAction * >( action );
|
||||
// TODO this (Movie action)
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -277,7 +277,7 @@ void CHMGenerator::additionalRequestData()
|
|||
new Okular::ObjectRect ( Okular::NormalizedRect(r,xScale,yScale),
|
||||
false,
|
||||
Okular::ObjectRect::Action,
|
||||
new Okular::ActionBrowse ( url )));
|
||||
new Okular::BrowseAction ( url )));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -286,7 +286,7 @@ void CHMGenerator::additionalRequestData()
|
|||
new Okular::ObjectRect ( Okular::NormalizedRect(r,xScale,yScale),
|
||||
false,
|
||||
Okular::ObjectRect::Action,
|
||||
new Okular::ActionGoto ( QString::null, viewport)));
|
||||
new Okular::GotoAction ( QString::null, viewport)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ Okular::ObjectRect* DjVuGenerator::convertKDjVuLink( int page, KDjVu::Link * lin
|
|||
vp.pageNumber = ( target.at(0) == QLatin1Char( '+' ) || target.at(0) == QLatin1Char( '-' ) ) ? page + tmppage : tmppage - 1;
|
||||
newpage = vp.pageNumber;
|
||||
}
|
||||
newlink = new Okular::ActionGoto( QString(), vp );
|
||||
newlink = new Okular::GotoAction( QString(), vp );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ Okular::ObjectRect* DjVuGenerator::convertKDjVuLink( int page, KDjVu::Link * lin
|
|||
{
|
||||
KDjVu::UrlLink* l = static_cast<KDjVu::UrlLink*>( link );
|
||||
QString url = l->url();
|
||||
newlink = new Okular::ActionBrowse( url );
|
||||
newlink = new Okular::BrowseAction( url );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,11 +167,11 @@ QLinkedList<Okular::ObjectRect*> DviGenerator::generateDviLinks( const dviPageIn
|
|||
Okular::DocumentViewport vp;
|
||||
fillViewportFromAnchor( vp, anch, pageWidth, pageHeight,
|
||||
orientation );
|
||||
okuLink = new Okular::ActionGoto( "", vp );
|
||||
okuLink = new Okular::GotoAction( "", vp );
|
||||
}
|
||||
else
|
||||
{
|
||||
okuLink = new Okular::ActionBrowse( dviLink.linkText );
|
||||
okuLink = new Okular::BrowseAction( dviLink.linkText );
|
||||
}
|
||||
if ( okuLink )
|
||||
{
|
||||
|
|
|
@ -199,7 +199,7 @@ QTextDocument* Converter::convert( const QString &fileName )
|
|||
const QTextBlock block = mSectionMap[ it.key() ];
|
||||
Okular::DocumentViewport viewport = calculateViewport( mTextDocument, block );
|
||||
|
||||
Okular::ActionGoto *action = new Okular::ActionGoto( QString(), viewport );
|
||||
Okular::GotoAction *action = new Okular::GotoAction( QString(), viewport );
|
||||
|
||||
emit addAction( action, it.value().first, it.value().second );
|
||||
}
|
||||
|
@ -736,7 +736,7 @@ bool Converter::convertLink( const QDomElement &element )
|
|||
mLocalLinks.insert( href.mid( 1 ), QPair<int, int>( startPosition, endPosition ) );
|
||||
} else {
|
||||
// external link
|
||||
Okular::ActionBrowse *action = new Okular::ActionBrowse( href );
|
||||
Okular::BrowseAction *action = new Okular::BrowseAction( href );
|
||||
emit addAction( action, startPosition, endPosition );
|
||||
}
|
||||
|
||||
|
|
|
@ -482,7 +482,7 @@ bool Converter::convertLink( QTextCursor *cursor, const QDomElement &element, co
|
|||
|
||||
int endPosition = cursor->position();
|
||||
|
||||
Okular::Action *action = new Okular::ActionBrowse( element.attribute( "href" ) );
|
||||
Okular::Action *action = new Okular::BrowseAction( element.attribute( "href" ) );
|
||||
emit addAction( action, startPosition, endPosition );
|
||||
|
||||
return true;
|
||||
|
|
|
@ -194,7 +194,7 @@ bool QUnpluck::open( const QString &fileName )
|
|||
viewport.rePos.normalizedY = 0;
|
||||
viewport.rePos.enabled = true;
|
||||
viewport.rePos.pos = Okular::DocumentViewport::TopLeft;
|
||||
mLinks[ i ].link = new Okular::ActionGoto( QString(), viewport );
|
||||
mLinks[ i ].link = new Okular::GotoAction( QString(), viewport );
|
||||
} else if ( mLinks[ i ].url.startsWith( "para:" ) ) {
|
||||
QPair<int, QTextBlock> data = mNamedTargets[ mLinks[ i ].url ];
|
||||
|
||||
|
@ -202,9 +202,9 @@ bool QUnpluck::open( const QString &fileName )
|
|||
|
||||
Okular::DocumentViewport viewport = calculateViewport( document, data.second );
|
||||
|
||||
mLinks[ i ].link = new Okular::ActionGoto( QString(), viewport );
|
||||
mLinks[ i ].link = new Okular::GotoAction( QString(), viewport );
|
||||
} else {
|
||||
mLinks[ i ].link = new Okular::ActionBrowse( mLinks[ i ].url );
|
||||
mLinks[ i ].link = new Okular::BrowseAction( mLinks[ i ].url );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -168,22 +168,22 @@ static Okular::Action* createLinkFromPopplerLink(const Poppler::Link *popplerLin
|
|||
case Poppler::Link::Goto:
|
||||
popplerLinkGoto = static_cast<const Poppler::LinkGoto *>(popplerLink);
|
||||
fillViewportFromLinkDestination( viewport, popplerLinkGoto->destination(), pdfdoc );
|
||||
link = new Okular::ActionGoto(popplerLinkGoto->fileName(), viewport);
|
||||
link = new Okular::GotoAction(popplerLinkGoto->fileName(), viewport);
|
||||
break;
|
||||
|
||||
case Poppler::Link::Execute:
|
||||
popplerLinkExecute = static_cast<const Poppler::LinkExecute *>(popplerLink);
|
||||
link = new Okular::ActionExecute( popplerLinkExecute->fileName(), popplerLinkExecute->parameters() );
|
||||
link = new Okular::ExecuteAction( popplerLinkExecute->fileName(), popplerLinkExecute->parameters() );
|
||||
break;
|
||||
|
||||
case Poppler::Link::Browse:
|
||||
popplerLinkBrowse = static_cast<const Poppler::LinkBrowse *>(popplerLink);
|
||||
link = new Okular::ActionBrowse( popplerLinkBrowse->url() );
|
||||
link = new Okular::BrowseAction( popplerLinkBrowse->url() );
|
||||
break;
|
||||
|
||||
case Poppler::Link::Action:
|
||||
popplerLinkAction = static_cast<const Poppler::LinkAction *>(popplerLink);
|
||||
link = new Okular::ActionDocumentAction( (Okular::ActionDocumentAction::DocumentActionType)popplerLinkAction->actionType() );
|
||||
link = new Okular::DocumentAction( (Okular::DocumentAction::DocumentActionType)popplerLinkAction->actionType() );
|
||||
break;
|
||||
|
||||
#ifdef HAVE_POPPLER_HEAD
|
||||
|
@ -210,7 +210,7 @@ static Okular::Action* createLinkFromPopplerLink(const Poppler::Link *popplerLin
|
|||
sound->setSoundEncoding( Okular::Sound::ALaw );
|
||||
break;
|
||||
}
|
||||
link = new Okular::ActionSound( popplerLinkSound->volume(), popplerLinkSound->synchronous(), popplerLinkSound->repeat(), popplerLinkSound->mix(), sound );
|
||||
link = new Okular::SoundAction( popplerLinkSound->volume(), popplerLinkSound->synchronous(), popplerLinkSound->repeat(), popplerLinkSound->mix(), sound );
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
|
|
@ -1472,7 +1472,7 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
|
|||
KMenu menu( this );
|
||||
QAction * actProcessLink = menu.addAction( i18n( "Follow This Link" ) );
|
||||
QAction * actCopyLinkLocation = 0;
|
||||
if ( dynamic_cast< const Okular::ActionBrowse * >( link ) )
|
||||
if ( dynamic_cast< const Okular::BrowseAction * >( link ) )
|
||||
actCopyLinkLocation = menu.addAction( KIcon( "edit-copy" ), i18n( "Copy Link Location" ) );
|
||||
QAction * res = menu.exec( e->globalPos() );
|
||||
if ( res )
|
||||
|
@ -1483,7 +1483,7 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
|
|||
}
|
||||
else if ( res == actCopyLinkLocation )
|
||||
{
|
||||
const Okular::ActionBrowse * browseLink = static_cast< const Okular::ActionBrowse * >( link );
|
||||
const Okular::BrowseAction * browseLink = static_cast< const Okular::BrowseAction * >( link );
|
||||
QClipboard *cb = QApplication::clipboard();
|
||||
cb->setText( browseLink->url(), QClipboard::Clipboard );
|
||||
if ( cb->supportsSelection() )
|
||||
|
|
|
@ -230,7 +230,7 @@ void TOC::slotExecuted( QTreeWidgetItem *i )
|
|||
QString externalFileName = tocItem->externalFileName();
|
||||
if ( !externalFileName.isEmpty() )
|
||||
{
|
||||
Okular::ActionGoto action( externalFileName, tocItem->viewport() );
|
||||
Okular::GotoAction action( externalFileName, tocItem->viewport() );
|
||||
m_document->processAction( &action );
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user