Add Page::annotation

Will use it later
This commit is contained in:
Albert Astals Cid 2017-10-25 15:21:46 +02:00 committed by Albert Astals Cid
parent 5c9edea430
commit 8690497be7
2 changed files with 16 additions and 0 deletions

View file

@ -488,6 +488,16 @@ QLinkedList< Annotation* > Page::annotations() const
return m_annotations;
}
Annotation * Page::annotation( const QString & uniqueName ) const
{
foreach(Annotation *a, m_annotations)
{
if ( a->uniqueName() == uniqueName )
return a;
}
return nullptr;
}
const Action * Page::pageAction( PageAction action ) const
{
switch ( action )

View file

@ -249,6 +249,12 @@ class OKULARCORE_EXPORT Page
*/
QLinkedList< Annotation* > annotations() const;
/**
* Returns the annotation with the given unique name.
* @since TODO
*/
Annotation * annotation( const QString & uniqueName ) const;
/**
* Returns the @ref Action object which is associated with the given page @p action
* or 0 if no page action is set.