Commit e5ed6251 authored by Enrico Ros's avatar Enrico Ros

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
parent 9709ffbd
......@@ -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; }
......
......@@ -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;
......
......@@ -101,6 +101,7 @@ protected slots:
void slotShowProperties();
void slotShowLeftPanel();
void slotShowPresentation();
void slotHidePresentation();
// can be connected to widget elements
void updateViewActions();
void enableTOC(bool enable);
......
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