QObject wrapper around shared_ptr<CPdf>. More...
#include <qspdf.h>
Public Slots | |
| bool | isReadOnly () |
| bool | isEncrypted () |
| bool | isLinearized () |
| bool | needsCredentials () |
| bool | isValid () |
| void | unloadPdf () |
| bool | saveAs (QString name) |
| bool | save (bool newRevision=false) |
| bool | setPassword (const QString &pass) |
| QSDict * | getDictionary () |
| void | removePage (int position) |
| int | getPagePosition (QSPage *page) |
| int | getPagePosition (QObject *page) |
| int | getPageCount () |
| QSPage * | insertPage (QSPage *page, int position) |
| QSPage * | insertPage (QObject *page, int position) |
| QSPage * | getPage (int position) |
| QSPage * | getFirstPage () |
| QSPage * | getLastPage () |
| QSPage * | getNextPage (QSPage *page) |
| QSPage * | getNextPage (QObject *page) |
| QSPage * | getPrevPage (QSPage *page) |
| QSPage * | getPrevPage (QObject *page) |
| bool | hasNextPage (QSPage *page) |
| bool | hasNextPage (QObject *page) |
| bool | hasPrevPage (QSPage *page) |
| bool | hasPrevPage (QObject *page) |
| int | getRevisionsCount () |
| int | getActualRevision () |
| bool | referenceValid (int valueNum, int valueGen) |
Public Member Functions | |
| QSPdf (boost::shared_ptr< CPdf >_pdf, BaseCore *_base, bool _destructive=false) | |
| virtual | ~QSPdf () |
| boost::shared_ptr< CPdf > | get () const |
| void | set (boost::shared_ptr< CPdf > pdf) |
Private Attributes | |
| boost::shared_ptr< CPdf > | obj |
| bool | destructive |
QObject wrapper around shared_ptr<CPdf>.
Construct wrapper with given PDF document
| _pdf | Pdf document | |
| _base | Scripting base | |
| _destructive | If true, document will be closed (without saving) when this object is deleted |
References destructive, and obj.
| gui::QSPdf::~QSPdf | ( | ) | [virtual] |
destructor
References unloadPdf().
| boost::shared_ptr< CPdf > gui::QSPdf::get | ( | ) | const |
Get CPdf held inside this class. Not exposed to scripting
References obj.
Referenced by gui::PageSpace::firstPage(), gui::PageSpace::lastPage(), gui::PageSpace::nextPage(), gui::PageSpace::prevPage(), and gui::PageSpace::refresh().
| int gui::QSPdf::getActualRevision | ( | ) | [slot] |
Get actual revision number
References gui::QSCObject::nullPtr(), and obj.
| QSDict * gui::QSPdf::getDictionary | ( | ) | [slot] |
References gui::QSCObject::base, gui::QSCObject::nullPtr(), and obj.
| QSPage * gui::QSPdf::getFirstPage | ( | ) | [slot] |
Get first page
References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSCObject::nullPtr(), and obj.
| QSPage * gui::QSPdf::getLastPage | ( | ) | [slot] |
Get last page in document
References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSCObject::nullPtr(), and obj.
| QSPage * gui::QSPdf::getNextPage | ( | QObject * | page | ) | [slot] |
Return page next to the one specified
| page | Page to examine |
References getNextPage(), and gui::QSCObject::qobject_cast().
Return page next to the one specified
| page | Page to examine |
References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSPage::get(), gui::QSCObject::nullPtr(), and obj.
Referenced by getNextPage().
| QSPage * gui::QSPdf::getPage | ( | int | position | ) | [slot] |
Return page at given position (numbering starts from 1)
| position | Page number |
References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSCObject::nullPtr(), and obj.
| int gui::QSPdf::getPageCount | ( | ) | [slot] |
Return number of pages in document
References gui::QSCObject::nullPtr(), and obj.
Referenced by gui::PageSpace::refresh().
| int gui::QSPdf::getPagePosition | ( | QObject * | page | ) | [slot] |
Return position of given page
| page | page to examine |
References getPagePosition(), and gui::QSCObject::qobject_cast().
| int gui::QSPdf::getPagePosition | ( | QSPage * | page | ) | [slot] |
Return position of given page
| page | page to examine |
References gui::QSPage::get(), gui::QSCObject::nullPtr(), and obj.
Referenced by getPagePosition().
| QSPage * gui::QSPdf::getPrevPage | ( | QObject * | page | ) | [slot] |
Return page previous to the one specified
| page | Page to examine |
References getPrevPage(), and gui::QSCObject::qobject_cast().
Return page previous to the one specified
| page | Page to examine |
References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSPage::get(), gui::QSCObject::nullPtr(), and obj.
Referenced by getPrevPage().
| int gui::QSPdf::getRevisionsCount | ( | ) | [slot] |
Get count of revisions
References gui::QSCObject::nullPtr(), and obj.
| bool gui::QSPdf::hasNextPage | ( | QObject * | page | ) | [slot] |
Return true if next page in relation to given page exists
| page | Page to examine |
References hasNextPage(), and gui::QSCObject::qobject_cast().
| bool gui::QSPdf::hasNextPage | ( | QSPage * | page | ) | [slot] |
Return true if next page in relation to given page exists
| page | Page to examine |
References gui::QSPage::get(), gui::QSCObject::nullPtr(), and obj.
Referenced by hasNextPage().
| bool gui::QSPdf::hasPrevPage | ( | QObject * | page | ) | [slot] |
Return true if previous page in relation to given page exists
| page | Page to examine |
References hasPrevPage(), and gui::QSCObject::qobject_cast().
| bool gui::QSPdf::hasPrevPage | ( | QSPage * | page | ) | [slot] |
Return true if previous page in relation to given page exists
| page | Page to examine |
References gui::QSPage::get(), gui::QSCObject::nullPtr(), and obj.
Referenced by hasPrevPage().
| QSPage * gui::QSPdf::insertPage | ( | QObject * | page, | |
| int | position | |||
| ) | [slot] |
QSA bugfix version Insert page in document at specified position
| page | page to insert | |
| position | Position in which to insert |
References gui::QSCObject::base, gui::BaseCore::errorException(), insertPage(), and gui::QSCObject::qobject_cast().
Insert page in document at specified position
| page | page to insert | |
| position | Position in which to insert |
References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSPage::get(), gui::QSCObject::nullPtr(), and obj.
Referenced by insertPage().
| bool gui::QSPdf::isEncrypted | ( | ) | [slot] |
Checks whether document is encrypted.
References gui::QSCObject::nullPtr(), and obj.
| bool gui::QSPdf::isLinearized | ( | ) | [slot] |
References gui::QSCObject::nullPtr(), and obj.
| bool gui::QSPdf::isReadOnly | ( | ) | [slot] |
Checks whether document is opened in read-only mode
References gui::QSCObject::nullPtr(), obj, and pdfobjects::CPdf::ReadOnly.
| bool gui::QSPdf::isValid | ( | ) | [slot] |
Check for PDF validity - return true, if this object is valid PDF wrapper, false if the pdf was closed or not yet opened
References obj.
| bool gui::QSPdf::needsCredentials | ( | ) | [slot] |
Return true if document is protected and opening the document reqires credentials (usually a password), false otherwise.
References obj.
| bool gui::QSPdf::referenceValid | ( | int | valueNum, | |
| int | valueGen | |||
| ) | [slot] |
Check validity of specified reference
| valueNum | Object number | |
| valueGen | Generation number |
References pdfobjects::IndiRef::gen, pdfobjects::isRefValid(), gui::QSCObject::nullPtr(), pdfobjects::IndiRef::num, and obj.
| void gui::QSPdf::removePage | ( | int | position | ) | [slot] |
Remove page at given position (numbering starts from 1)
| position | Page number to remove |
References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSCObject::nullPtr(), and obj.
| bool gui::QSPdf::save | ( | bool | newRevision = false |
) | [slot] |
Save document to disk under original name
| newRevision | If true, create new revision while saving |
References gui::QSCObject::base, gui::BaseCore::errorException(), and obj.
| bool gui::QSPdf::saveAs | ( | QString | name | ) | [slot] |
Save copy under different name. Does not check if the file exists, overwrite anything without warning
| name | Name of file |
References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSCObject::nullPtr(), obj, and util::saveCopy().
| void gui::QSPdf::set | ( | boost::shared_ptr< CPdf > | ) |
Set CPdf held inside this class. Not exposed to scripting
| CPdf object |
References obj.
| bool gui::QSPdf::setPassword | ( | const QString & | pass | ) | [slot] |
Sets PDF password to use for decryption. Needed for opening password-protected documents
| pass | password to set |
References obj, and util::setPdfPassword().
| void gui::QSPdf::unloadPdf | ( | ) | [slot] |
Close the document, if it was opened with 'destructive' flag set (via loadPdf). Otherwise it does nothing. The document must not be used in any way after it is closed
References destructive, and obj.
Referenced by ~QSPdf().
bool gui::QSPdf::destructive [private] |
Destructive flag - if the PDF file may be closed with the unloadPdf() function
Referenced by QSPdf(), and unloadPdf().
boost::shared_ptr<CPdf> gui::QSPdf::obj [private] |
Pointer to object held in class
Referenced by get(), getActualRevision(), getDictionary(), getFirstPage(), getLastPage(), getNextPage(), getPage(), getPageCount(), getPagePosition(), getPrevPage(), getRevisionsCount(), hasNextPage(), hasPrevPage(), insertPage(), isEncrypted(), isLinearized(), isReadOnly(), isValid(), needsCredentials(), QSPdf(), referenceValid(), removePage(), save(), saveAs(), set(), setPassword(), and unloadPdf().