Commit 5b1276dc authored by Pino Toscano's avatar Pino Toscano

Add for GotoAction the possibility to represent a named destination, instead of a viewport.

svn path=/trunk/KDE/kdegraphics/okular/; revision=967385
parent 16db4f6a
......@@ -56,8 +56,14 @@ class Okular::GotoActionPrivate : public Okular::ActionPrivate
{
}
GotoActionPrivate( const QString &fileName, const QString &namedDestination )
: ActionPrivate(), m_extFileName( fileName ), m_dest( namedDestination )
{
}
QString m_extFileName;
DocumentViewport m_vp;
QString m_dest;
};
GotoAction::GotoAction( const QString& fileName, const DocumentViewport & viewport )
......@@ -65,6 +71,11 @@ GotoAction::GotoAction( const QString& fileName, const DocumentViewport & viewpo
{
}
GotoAction::GotoAction( const QString& fileName, const QString& namedDestination )
: Action( *new GotoActionPrivate( fileName, namedDestination ) )
{
}
GotoAction::~GotoAction()
{
}
......@@ -99,6 +110,12 @@ DocumentViewport GotoAction::destViewport() const
return d->m_vp;
}
QString GotoAction::destinationName() const
{
Q_D( const GotoAction );
return d->m_dest;
}
// ExecuteAction
class Okular::ExecuteActionPrivate : public Okular::ActionPrivate
......
......@@ -97,6 +97,16 @@ class OKULAR_EXPORT GotoAction : public Action
*/
GotoAction( const QString& fileName, const DocumentViewport & viewport );
/**
* 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 );
/**
* Destroys the goto action.
*/
......@@ -127,6 +137,13 @@ class OKULAR_EXPORT GotoAction : public Action
*/
DocumentViewport destViewport() const;
/**
* Returns the document named destination the goto action points to.
*
* @since 0.9 (KDE 4.3)
*/
QString destinationName() const;
private:
Q_DECLARE_PRIVATE( GotoAction )
Q_DISABLE_COPY( GotoAction )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment