2004-09-04 22:28:14 +00:00
|
|
|
/***************************************************************************
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
* Copyright (C) 2004-2005 by Enrico Ros <eros.kde@email.it> *
|
2004-09-04 22:28:14 +00:00
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2007-04-20 11:26:05 +00:00
|
|
|
#include "action.h"
|
2007-04-19 18:30:20 +00:00
|
|
|
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
// kde includes
|
|
|
|
#include <klocale.h>
|
|
|
|
|
2004-12-10 16:04:45 +00:00
|
|
|
// local includes
|
2007-01-03 14:30:48 +00:00
|
|
|
#include "document.h"
|
2007-01-06 14:25:33 +00:00
|
|
|
#include "sound.h"
|
2004-09-04 22:28:14 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
using namespace Okular;
|
|
|
|
|
2007-05-02 21:59:44 +00:00
|
|
|
class Okular::ActionPrivate
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
2007-05-02 21:59:44 +00:00
|
|
|
public:
|
|
|
|
ActionPrivate()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~ActionPrivate()
|
|
|
|
{
|
|
|
|
}
|
2007-01-03 14:30:48 +00:00
|
|
|
};
|
|
|
|
|
2007-05-02 21:59:44 +00:00
|
|
|
Action::Action( ActionPrivate &dd )
|
|
|
|
: d_ptr( &dd )
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-04-20 12:37:12 +00:00
|
|
|
Action::~Action()
|
2004-09-04 22:28:14 +00:00
|
|
|
{
|
2007-05-02 21:59:44 +00:00
|
|
|
delete d_ptr;
|
2004-12-10 16:04:45 +00:00
|
|
|
}
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
|
2007-04-20 12:37:12 +00:00
|
|
|
QString Action::actionTip() const
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
// GotoAction
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
class Okular::GotoActionPrivate : public Okular::ActionPrivate
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-05-02 22:50:27 +00:00
|
|
|
GotoActionPrivate( const QString &fileName, const DocumentViewport &viewport )
|
2007-05-02 21:59:44 +00:00
|
|
|
: ActionPrivate(), m_extFileName( fileName ), m_vp( viewport )
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QString m_extFileName;
|
|
|
|
DocumentViewport m_vp;
|
|
|
|
};
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
GotoAction::GotoAction( const QString& fileName, const DocumentViewport & viewport )
|
|
|
|
: Action( *new GotoActionPrivate( fileName, viewport ) )
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
GotoAction::~GotoAction()
|
2006-11-27 08:08:39 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
Action::ActionType GotoAction::actionType() const
|
2006-11-27 08:08:39 +00:00
|
|
|
{
|
|
|
|
return Goto;
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
QString GotoAction::actionTip() const
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const GotoAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_extFileName.isEmpty() ? ( d->m_vp.isValid() ? i18n( "Go to page %1", d->m_vp.pageNumber + 1 ) : "" ) :
|
2006-11-27 08:08:39 +00:00
|
|
|
i18n("Open external file");
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
bool GotoAction::isExternal() const
|
2006-11-27 08:08:39 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const GotoAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return !d->m_extFileName.isEmpty();
|
2006-11-27 08:08:39 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
QString GotoAction::fileName() const
|
2006-11-27 08:08:39 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const GotoAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_extFileName;
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
DocumentViewport GotoAction::destViewport() const
|
2006-11-27 08:08:39 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const GotoAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_vp;
|
2006-11-27 08:08:39 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
// ExecuteAction
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
class Okular::ExecuteActionPrivate : public Okular::ActionPrivate
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-05-02 22:50:27 +00:00
|
|
|
ExecuteActionPrivate( const QString &file, const QString & parameters )
|
2007-05-02 21:59:44 +00:00
|
|
|
: ActionPrivate(), m_fileName( file ), m_parameters( parameters )
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QString m_fileName;
|
|
|
|
QString m_parameters;
|
|
|
|
};
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
ExecuteAction::ExecuteAction( const QString &file, const QString & parameters )
|
|
|
|
: Action( *new ExecuteActionPrivate( file, parameters ) )
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
ExecuteAction::~ExecuteAction()
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
Action::ActionType ExecuteAction::actionType() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
return Execute;
|
|
|
|
}
|
2006-11-27 08:08:39 +00:00
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
QString ExecuteAction::actionTip() const
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::ExecuteAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return i18n( "Execute '%1'...", d->m_fileName );
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
QString ExecuteAction::fileName() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::ExecuteAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_fileName;
|
2006-12-04 09:31:53 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
QString ExecuteAction::parameters() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::ExecuteAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_parameters;
|
2006-12-04 09:31:53 +00:00
|
|
|
}
|
|
|
|
|
2007-04-20 12:37:12 +00:00
|
|
|
// BrowseAction
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
class Okular::BrowseActionPrivate : public Okular::ActionPrivate
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-05-02 22:50:27 +00:00
|
|
|
BrowseActionPrivate( const QString &url )
|
2007-05-02 21:59:44 +00:00
|
|
|
: ActionPrivate(), m_url( url )
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QString m_url;
|
|
|
|
};
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
BrowseAction::BrowseAction( const QString &url )
|
|
|
|
: Action( *new BrowseActionPrivate( url ) )
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
BrowseAction::~BrowseAction()
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
Action::ActionType BrowseAction::actionType() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
return Browse;
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
QString BrowseAction::actionTip() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::BrowseAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_url;
|
2006-12-04 09:31:53 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
QString BrowseAction::url() const
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::BrowseAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_url;
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
// DocumentAction
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
class Okular::DocumentActionPrivate : public Okular::ActionPrivate
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-05-02 22:50:27 +00:00
|
|
|
DocumentActionPrivate( enum DocumentAction::DocumentActionType documentActionType )
|
2007-05-02 21:59:44 +00:00
|
|
|
: ActionPrivate(), m_type( documentActionType )
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
DocumentAction::DocumentActionType m_type;
|
2007-01-03 14:30:48 +00:00
|
|
|
};
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
DocumentAction::DocumentAction( enum DocumentActionType documentActionType )
|
|
|
|
: Action( *new DocumentActionPrivate( documentActionType ) )
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
DocumentAction::~DocumentAction()
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
DocumentAction::DocumentActionType DocumentAction::documentActionType() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::DocumentAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_type;
|
2006-12-04 09:31:53 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
Action::ActionType DocumentAction::actionType() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
return DocAction;
|
2006-12-04 09:31:53 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
QString DocumentAction::actionTip() const
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::DocumentAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
switch ( d->m_type )
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
{
|
|
|
|
case PageFirst:
|
|
|
|
return i18n( "First Page" );
|
|
|
|
case PagePrev:
|
|
|
|
return i18n( "Previous Page" );
|
|
|
|
case PageNext:
|
|
|
|
return i18n( "Next Page" );
|
|
|
|
case PageLast:
|
|
|
|
return i18n( "Last Page" );
|
|
|
|
case HistoryBack:
|
|
|
|
return i18n( "Back" );
|
|
|
|
case HistoryForward:
|
|
|
|
return i18n( "Forward" );
|
|
|
|
case Quit:
|
|
|
|
return i18n( "Quit" );
|
|
|
|
case Presentation:
|
|
|
|
return i18n( "Start Presentation" );
|
|
|
|
case EndPresentation:
|
|
|
|
return i18n( "End Presentation" );
|
|
|
|
case Find:
|
|
|
|
return i18n( "Find..." );
|
|
|
|
case GoToPage:
|
|
|
|
return i18n( "Go To Page..." );
|
2006-06-16 16:01:26 +00:00
|
|
|
case Close:
|
|
|
|
default: ;
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
}
|
2006-12-04 09:31:53 +00:00
|
|
|
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
// SoundAction
|
2007-01-03 14:30:48 +00:00
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
class Okular::SoundActionPrivate : public Okular::ActionPrivate
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-05-02 22:50:27 +00:00
|
|
|
SoundActionPrivate( double volume, bool sync, bool repeat, bool mix, Okular::Sound *sound )
|
2007-05-02 21:59:44 +00:00
|
|
|
: ActionPrivate(), m_volume( volume ), m_sync( sync ),
|
|
|
|
m_repeat( repeat ), m_mix( mix ), m_sound( sound )
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
~SoundActionPrivate()
|
2007-01-06 14:25:33 +00:00
|
|
|
{
|
|
|
|
delete m_sound;
|
|
|
|
}
|
|
|
|
|
2007-01-03 14:30:48 +00:00
|
|
|
double m_volume;
|
2007-09-07 13:13:50 +00:00
|
|
|
bool m_sync : 1;
|
|
|
|
bool m_repeat : 1;
|
|
|
|
bool m_mix : 1;
|
2007-01-03 14:30:48 +00:00
|
|
|
Okular::Sound *m_sound;
|
|
|
|
};
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
SoundAction::SoundAction( double volume, bool sync, bool repeat, bool mix, Okular::Sound *sound )
|
|
|
|
: Action( *new SoundActionPrivate( volume, sync, repeat, mix, sound ) )
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
SoundAction::~SoundAction()
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
Action::ActionType SoundAction::actionType() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
return Sound;
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
QString SoundAction::actionTip() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
return i18n( "Play sound..." );
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
double SoundAction::volume() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::SoundAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_volume;
|
2006-12-04 09:31:53 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
bool SoundAction::synchronous() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::SoundAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_sync;
|
2006-12-04 09:31:53 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
bool SoundAction::repeat() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::SoundAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_repeat;
|
2006-12-04 09:31:53 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
bool SoundAction::mix() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::SoundAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_mix;
|
2006-12-04 09:31:53 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
Okular::Sound *SoundAction::sound() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
2007-05-02 22:50:27 +00:00
|
|
|
Q_D( const Okular::SoundAction );
|
2007-01-03 14:30:48 +00:00
|
|
|
return d->m_sound;
|
2006-12-04 09:31:53 +00:00
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
// MovieAction
|
2007-05-02 21:59:44 +00:00
|
|
|
|
2007-08-29 11:59:54 +00:00
|
|
|
#if 0
|
2007-05-02 22:50:27 +00:00
|
|
|
class Okular::MovieActionPrivate : public Okular::ActionPrivate
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
2007-05-02 21:59:44 +00:00
|
|
|
public:
|
2007-05-02 22:50:27 +00:00
|
|
|
MovieActionPrivate()
|
2007-05-02 21:59:44 +00:00
|
|
|
: ActionPrivate()
|
|
|
|
{
|
|
|
|
}
|
2007-01-03 14:30:48 +00:00
|
|
|
};
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
MovieAction::MovieAction()
|
|
|
|
: Action( *new MovieActionPrivate() )
|
2007-01-03 14:30:48 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
MovieAction::~MovieAction()
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
Action::ActionType MovieAction::actionType() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
return Movie;
|
|
|
|
}
|
|
|
|
|
2007-05-02 22:50:27 +00:00
|
|
|
QString MovieAction::actionTip() const
|
2006-12-04 09:31:53 +00:00
|
|
|
{
|
|
|
|
return i18n( "Play movie..." );
|
- Page/Link: tooltips for links backported
- Page: rotation does not switch height and width
- Document/Part/Generator:
1. Add API for attaching stuff to the interface: ActionCollection and the Navigation Panel
also add possibility to merge an XML .rc file with menu layout. Relevant functions are:
QString Generator::getXMLFile(), returns a QString with your .rc file name.
void Generator::setupGUI (KActionCollection* , QToolbox* ), add your components to the user interface
2. Supporting backend settings:
If during startup, backends which provide a configuration ([X-KDE-oKularHasInternalSettings]
set to true) are found, a menu item: configure backends is created, clicking on it results in
loading all the generators that have settings, but not those that dont. the Generator::addPages(KConfigDialog *dlg)
function should be overloaded by a generator and dlg->addPage should be used to add pages.
If a user opens a file that needs an already loaded generator, the already loaded one is used instead of loading another.
3. Error/Warning/Notice sending support, to send a notice/error/warning, add a relevant notice/error/warning(QString& txt ,int duration)
to the generator class, and sending a message to the user is as simple as emitting a signal!
4. Intercepting of events generated by the PageView is done by Generator::handleEvent(QEvent*), subclass it, do a switch on QEvent::type(), handle your
event and return true if pageview is to proceed with its handling or false if not.
5. Support configuring the KPrinter on the generator side, use Generator::canConfigurePrinter(), return true there, and you get a nonconfigured KPrinter in your
Generator::print()
6. PixmapRequest handling update:
a.) Generator::canGeneratePixmap is now Generator::canGeneratePixmap(bool async)
b.) Document::sendGeneratorRequests is a slot now
c.) Old way of sending pixmaps (Document::requestPixmaps(QValueList<PixmapRequest*> checking if we can generate pixmap if not, waiting for receiving)
is replaced with: requestPixmaps only queues the pixmap all checking if w can generate is done in sendGeneratorReqest, the sendGeneratorRequest is
run in three places:
1. in requestPixmaps when we receive a request
2. in requestDone if pixmapStack is not empty
3. sendGeneratorRequest, apart from removing invalid requests, takes the current request and if generator canGeratePixmap(request->async)
it removes the pixmap from stack and sends to generator if not, QTimer::singleshots to itself after 20ms, it ends when stack has no valid pixmap request
7. Added a commented out zoom field to PixmapGenerator, mightcome in handy sometime
- TextPage: add instructions that handle simplyfing the RegularAreaRect, no more double painted borders in selection rectangles, this rocks.
svn path=/trunk/playground/graphics/oKular/kpdf/; revision=445196
2005-08-10 16:14:39 +00:00
|
|
|
}
|
2007-08-29 11:59:54 +00:00
|
|
|
#endif
|