mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-24 18:35:37 +00:00
Implemented PDF:FullScreen and Close action to KPDF 'Presentation' and
'EndPresentation' actions. Based on testcase by Mikolaj. svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=403726
This commit is contained in:
parent
9709ffbd6b
commit
e5ed6251a6
|
@ -992,6 +992,12 @@ void KPDFDocument::processLink( const KPDFLink * link )
|
|||
case KPDFLinkAction::Quit:
|
||||
kapp->quit();
|
||||
break;
|
||||
case KPDFLinkAction::Presentation:
|
||||
emit linkPresentation();
|
||||
break;
|
||||
case KPDFLinkAction::EndPresentation:
|
||||
emit linkEndPresentation();
|
||||
break;
|
||||
case KPDFLinkAction::Find:
|
||||
emit linkFind();
|
||||
break;
|
||||
|
|
|
@ -102,6 +102,8 @@ class KPDFDocument : public QObject
|
|||
signals:
|
||||
void linkFind();
|
||||
void linkGoToPage();
|
||||
void linkPresentation();
|
||||
void linkEndPresentation();
|
||||
void openURL(const KURL &url);
|
||||
|
||||
private:
|
||||
|
|
|
@ -322,6 +322,10 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a )
|
|||
link = new KPDFLinkAction( KPDFLinkAction::GoToPage );
|
||||
else if ( !strcmp( name, "Find" ) )
|
||||
link = new KPDFLinkAction( KPDFLinkAction::Find );
|
||||
else if ( !strcmp( name, "FullScreen" ) )
|
||||
link = new KPDFLinkAction( KPDFLinkAction::Presentation );
|
||||
else if ( !strcmp( name, "Close" ) )
|
||||
link = new KPDFLinkAction( KPDFLinkAction::EndPresentation );
|
||||
else
|
||||
kdDebug() << "Unknown named action: '" << name << "'" << endl;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,8 @@ class KPDFLinkAction : public KPDFLink
|
|||
{
|
||||
public:
|
||||
// define types of actions
|
||||
enum ActionType { PageFirst, PagePrev, PageNext, PageLast, HistoryBack, HistoryForward, Quit, Find, GoToPage };
|
||||
enum ActionType { PageFirst, PagePrev, PageNext, PageLast, HistoryBack, HistoryForward,
|
||||
Quit, Presentation, EndPresentation, Find, GoToPage };
|
||||
|
||||
// query for action type
|
||||
ActionType actionType() const { return m_type; }
|
||||
|
|
12
part.cpp
12
part.cpp
|
@ -104,6 +104,8 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
|
|||
m_document = new KPDFDocument();
|
||||
connect( m_document, SIGNAL( linkFind() ), this, SLOT( slotFind() ) );
|
||||
connect( m_document, SIGNAL( linkGoToPage() ), this, SLOT( slotGoToPage() ) );
|
||||
connect( m_document, SIGNAL( linkPresentation() ), this, SLOT( slotShowPresentation() ) );
|
||||
connect( m_document, SIGNAL( linkEndPresentation() ), this, SLOT( slotHidePresentation() ) );
|
||||
connect( m_document, SIGNAL( openURL(const KURL &) ), this, SLOT( openURL(const KURL &) ) );
|
||||
|
||||
// widgets: [] splitter []
|
||||
|
@ -727,12 +729,16 @@ void Part::slotShowProperties()
|
|||
|
||||
void Part::slotShowPresentation()
|
||||
{
|
||||
if ( m_presentationWidget )
|
||||
delete (PresentationWidget*) m_presentationWidget;
|
||||
|
||||
slotHidePresentation();
|
||||
m_presentationWidget = new PresentationWidget( m_document );
|
||||
}
|
||||
|
||||
void Part::slotHidePresentation()
|
||||
{
|
||||
if ( m_presentationWidget )
|
||||
delete (PresentationWidget*) m_presentationWidget;
|
||||
}
|
||||
|
||||
void Part::slotPrint()
|
||||
{
|
||||
if (m_document->pages() == 0) return;
|
||||
|
|
Loading…
Reference in a new issue