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:
Enrico Ros 2005-04-07 09:53:15 +00:00
parent 9709ffbd6b
commit e5ed6251a6
6 changed files with 24 additions and 4 deletions

View file

@ -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;

View file

@ -102,6 +102,8 @@ class KPDFDocument : public QObject
signals:
void linkFind();
void linkGoToPage();
void linkPresentation();
void linkEndPresentation();
void openURL(const KURL &url);
private:

View file

@ -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;
}

View file

@ -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; }

View file

@ -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;

1
part.h
View file

@ -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);