gui::QSPdf Class Reference

QObject wrapper around shared_ptr<CPdf>. More...

#include <qspdf.h>

Inheritance diagram for gui::QSPdf:
gui::QSCObject

List of all members.

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)
QSDictgetDictionary ()
void removePage (int position)
int getPagePosition (QSPage *page)
int getPagePosition (QObject *page)
int getPageCount ()
QSPageinsertPage (QSPage *page, int position)
QSPageinsertPage (QObject *page, int position)
QSPagegetPage (int position)
QSPagegetFirstPage ()
QSPagegetLastPage ()
QSPagegetNextPage (QSPage *page)
QSPagegetNextPage (QObject *page)
QSPagegetPrevPage (QSPage *page)
QSPagegetPrevPage (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< CPdfget () const
void set (boost::shared_ptr< CPdf > pdf)

Private Attributes

boost::shared_ptr< CPdfobj
bool destructive

Detailed Description

QObject wrapper around shared_ptr<CPdf>.


Constructor & Destructor Documentation

gui::QSPdf::QSPdf ( boost::shared_ptr< CPdf _pdf,
BaseCore _base,
bool  _destructive = false 
)

Construct wrapper with given PDF document

Parameters:
_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().


Member Function Documentation

boost::shared_ptr< CPdf > gui::QSPdf::get (  )  const

Get CPdf held inside this class. Not exposed to scripting

Returns:
CPdf object

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

See also:
CPdf::getActualRevision
Returns:
actual revison

References gui::QSCObject::nullPtr(), and obj.

QSDict * gui::QSPdf::getDictionary (  )  [slot]
See also:
CPdf::getDictionary
Returns:
document catalog

References gui::QSCObject::base, gui::QSCObject::nullPtr(), and obj.

QSPage * gui::QSPdf::getFirstPage (  )  [slot]

Get first page

See also:
CPdf::getFirstPage
Returns:
first page in document

References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSCObject::nullPtr(), and obj.

QSPage * gui::QSPdf::getLastPage (  )  [slot]

Get last page in document

See also:
CPdf::getLastPage
Returns:
last page

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

See also:
CPdf::getNextPage
Parameters:
page Page to examine
Returns:
next page
qsa bugfix version

References getNextPage(), and gui::QSCObject::qobject_cast().

QSPage * gui::QSPdf::getNextPage ( QSPage page  )  [slot]

Return page next to the one specified

See also:
CPdf::getNextPage
Parameters:
page Page to examine
Returns:
next page

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)

See also:
CPdf::getPage()
Parameters:
position Page number
Returns:
page at positoin

References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSCObject::nullPtr(), and obj.

int gui::QSPdf::getPageCount (  )  [slot]

Return number of pages in document

See also:
CPdf::getPageCount
Returns:
count of pages

References gui::QSCObject::nullPtr(), and obj.

Referenced by gui::PageSpace::refresh().

int gui::QSPdf::getPagePosition ( QObject *  page  )  [slot]

Return position of given page

See also:
CPdf::getPagePosition
Parameters:
page page to examine
Returns:
page position or -1 in case of error (page not in document, invalid page, etc...)
QSA bugfix version

References getPagePosition(), and gui::QSCObject::qobject_cast().

int gui::QSPdf::getPagePosition ( QSPage page  )  [slot]

Return position of given page

See also:
CPdf::getPagePosition
Parameters:
page page to examine
Returns:
page position or -1 in case of error (page not in document, invalid page, etc...)

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

See also:
CPdf::getPrevPage
Parameters:
page Page to examine
Returns:
previous page
qsa bugfix version

References getPrevPage(), and gui::QSCObject::qobject_cast().

QSPage * gui::QSPdf::getPrevPage ( QSPage page  )  [slot]

Return page previous to the one specified

See also:
CPdf::getPrevPage
Parameters:
page Page to examine
Returns:
previous page

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

See also:
CPdf::getRevisionsCount
Returns:
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

See also:
CPdf::hasNextPage
Parameters:
page Page to examine
Returns:
presence of next page
qsa bugfix version

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

See also:
CPdf::hasNextPage
Parameters:
page Page to examine
Returns:
presence of next page

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

See also:
CPdf::hasPrevPage
Parameters:
page Page to examine
Returns:
presence of previous page
qsa bugfix version

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

See also:
CPdf::hasPrevPage
Parameters:
page Page to examine
Returns:
presence of previous page

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

See also:
CPdf::insertPage
Parameters:
page page to insert
position Position in which to insert

References gui::QSCObject::base, gui::BaseCore::errorException(), insertPage(), and gui::QSCObject::qobject_cast().

QSPage * gui::QSPdf::insertPage ( QSPage page,
int  position 
) [slot]

Insert page in document at specified position

See also:
CPdf::insertPage
Parameters:
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.

Returns:
true if encrypted, false otherwise.

References gui::QSCObject::nullPtr(), and obj.

bool gui::QSPdf::isLinearized (  )  [slot]
See also:
CPdf::isLinearized()
Returns:
True if document is linearized

References gui::QSCObject::nullPtr(), and obj.

bool gui::QSPdf::isReadOnly (  )  [slot]

Checks whether document is opened in read-only mode

Returns:
true if read-only, false if read-write.

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

Returns:
True if document is valid

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

Parameters:
valueNum Object number
valueGen Generation number
Returns:
True if valid and is contained in this document

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)

See also:
CPdf::removePage()
Parameters:
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

Parameters:
newRevision If true, create new revision while saving
Returns:
true if saved succesfully, false if failed to save because of any reason

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

Parameters:
name Name of file
Returns:
true if saved successfully, false if any error occured

References gui::QSCObject::base, gui::BaseCore::errorException(), gui::QSCObject::nullPtr(), obj, and util::saveCopy().

void gui::QSPdf::set ( boost::shared_ptr< CPdf pdf  ) 

Set CPdf held inside this class. Not exposed to scripting

Parameters:
pdf 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

Parameters:
pass password to set
Returns:
true if the password was successfully set, false in case of error (bad password ...)

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().


Member Data Documentation

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]

The documentation for this class was generated from the following files: