|
pdfedit
0.4.5
About: PDFedit is a free and open source library for manipulating PDF documents.
Fossies Dox: pdfedit-0.4.5.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
#include <iproperty.h>


Public Member Functions | |
| boost::shared_ptr< IProperty > | clone () const |
| virtual void | setPdf (boost::weak_ptr< CPdf > p) |
| boost::weak_ptr< CPdf > | getPdf () const |
| void | canChange () const |
| const IndiRef & | getIndiRef () const |
| virtual void | setIndiRef (const IndiRef &rf) |
| void | setIndiRef (IndiRef::ObjNum n, IndiRef::GenNum g) |
| PropertyMode | getMode () const |
| void | setMode (PropertyMode md) |
| virtual PropertyType | getType () const =0 |
| virtual void | getStringRepresentation (std::string &str) const =0 |
| void | dispatchChange () const |
| void | lockChange () |
| void | unlockChange () |
| virtual Object * | _makeXpdfObject () const =0 |
| virtual | ~IProperty () |
Public Member Functions inherited from observer::ObserverHandler< T > | |
| virtual | ~ObserverHandler () |
| virtual void | registerObserver (const Observer &observer) |
| virtual void | unregisterObserver (const Observer &observer) |
| virtual void | notifyObservers (boost::shared_ptr< T > newValue, boost::shared_ptr< const ObserverContext > context) |
Static Public Member Functions | |
| template<typename T > | |
| static boost::shared_ptr< T > | getSmartCObjectPtr (const boost::shared_ptr< IProperty > &ptr) |
Protected Member Functions | |
| IProperty (boost::weak_ptr< CPdf > _pdf=boost::shared_ptr< CPdf >()) | |
| IProperty (boost::weak_ptr< CPdf > _pdf, const IndiRef &rf) | |
| virtual IProperty * | doClone () const =0 |
Protected Member Functions inherited from observer::ObserverHandler< T > | |
| void | dumpObservers () const |
Additional Inherited Members | |
Public Types inherited from observer::ObserverHandler< T > | |
| typedef boost::shared_ptr < const IObserver< T > > | Observer |
| typedef PriorityList< Observer > | ObserverList |
| typedef IChangeContext< T > | ObserverContext |
Protected Attributes inherited from observer::ObserverHandler< T > | |
| ObserverList | observers |
Narrow interface describing properties of every pdf object. We use this interface when accessing properties of pdf object.
Each IProperty is associated with one pdf object. Changes made to this object are visible by xpdf only after calling dispatchChange() method.
When accessing complex properties, we have to know their type. According to the type, we can cast this object to CArray, CDict, CStream to get more functionality.
This object implements Observer interface which means we can observe changes made to all cobjects.
REMARK: The association with CPdf is stored in pdf variable as weak_ptr<CPdf>. Each access to this variable has to be checked with weak_ptr::lock method which transforms it to proper shared_ptr if the underlaying pointer is still valid.
Definition at line 95 of file iproperty.h.
|
protected |
Copy constructor. Basic constructor.
Definition at line 40 of file iproperty.cc.
References pdfobjects::IndiRef::gen, and pdfobjects::IndiRef::num.
Constructor.
Definition at line 48 of file iproperty.cc.
|
inlinevirtual |
Destructor.
Definition at line 290 of file iproperty.h.
References observer::ObserverHandler< T >::observers.
|
pure virtual |
Create xpdf object from this object. This is a factory method because we do not know the type of instance of this object.
Implemented in pdfobjects::CStream, pdfobjects::CDict, pdfobjects::CArray, pdfobjects::CObjectSimple< Tp >, and pdfobjects::CInlineImage.
| void pdfobjects::IProperty::canChange | ( | ) | const |
Checks if a property can be changed.
Definition at line 80 of file iproperty.cc.
Referenced by pdfobjects::CArray::addProperty(), pdfobjects::CDict::addProperty(), pdfobjects::CArray::delProperty(), pdfobjects::CDict::delProperty(), pdfobjects::CStream::setBuffer(), pdfobjects::CArray::setProperty(), pdfobjects::CDict::setProperty(), and pdfobjects::CStream::setRawBuffer().
| boost::shared_ptr< IProperty > pdfobjects::IProperty::clone | ( | ) | const |
Copy constructor. Returns deep copy.
REMARK: This is an example of Factory method design pattern where we do not know the real type of the instance of this object.
Definition at line 56 of file iproperty.cc.
References doClone().
Referenced by pdfobjects::CArray::addProperty(), pdfobjects::CDict::addProperty(), pdfobjects::CStream::doClone(), pdfobjects::CArray::setProperty(), and pdfobjects::CDict::setProperty().
| void pdfobjects::IProperty::dispatchChange | ( | ) | const |
Notify Writer object that this object has changed.
We have to call this function to make changes visible.
REMARK: This is an example of Template method design pattern.
Definition at line 91 of file iproperty.cc.
References getIndiRef(), getPdf(), pdfobjects::hasValidPdf(), pdfobjects::hasValidPdf(), pdfobjects::hasValidRef(), and pdfobjects::utils::objHasParent().
|
protectedpure virtual |
Implementation of clone method.
REMARK: This is an example of Template method design pattern.
Implemented in pdfobjects::CObjectSimple< Tp >, pdfobjects::CStream, pdfobjects::CDict, and pdfobjects::CArray.
Referenced by clone().
Returns object identification number. If it is a direct object returns identification and generation number of parent object.
Definition at line 179 of file iproperty.h.
Referenced by pdfobjects::CArray::addProperty(), pdfobjects::CDict::addProperty(), dispatchChange(), pdfobjects::hasValidRef(), pdfobjects::utils::objHasParent(), pdfobjects::CArray::setProperty(), and pdfobjects::CDict::setProperty().
|
inline |
Get mode of this property.
Definition at line 207 of file iproperty.h.
Referenced by pdfobjects::CArray::_setMode(), pdfobjects::CDict::_setMode(), and gui::propertyFactory().
|
inline |
Returns pdf in which this object resides.
Definition at line 162 of file iproperty.h.
Referenced by pdfobjects::CArray::_makeXpdfObject(), pdfobjects::CDict::_makeXpdfObject(), pdfobjects::CDict::_setMode(), pdfobjects::CArray::addProperty(), pdfobjects::CDict::addProperty(), dispatchChange(), pdfobjects::hasValidPdf(), pdfobjects::utils::objHasParent(), gui::RefProperty::readValue(), pdfobjects::CArray::setProperty(), pdfobjects::CDict::setProperty(), and gui::RefProperty::setValue().
|
inlinestatic |
Returns pointer to derived object.
| ptr | Pointer to an IProperty. |
Definition at line 228 of file iproperty.h.
References STATIC_CHECK.
|
pure virtual |
Returns string representation according to pdf specification of this object or its children.
| str | Output string. |
Implemented in pdfobjects::CStream, pdfobjects::CObjectSimple< Tp >, pdfobjects::CDict, pdfobjects::CArray, and pdfobjects::CInlineImage.
Referenced by ip_validate(), ip_validate(), ip_validate(), ip_validate(), and operator<<().
|
pure virtual |
Returns type of instance of this object.
Implemented in pdfobjects::CStream, pdfobjects::CObjectSimple< Tp >, pdfobjects::CDict, and pdfobjects::CArray.
Referenced by util::getRef(), util::getTypeId(), util::getTypeName(), pdfobjects::isIPType(), util::isSimple(), operator<<(), and gui::propertyFactory().
|
inline |
Lock changes. Do not dispatch changes.
Definition at line 272 of file iproperty.h.
Set object identification number and generation number.
| rf | Indirect reference identification and generation number. |
Reimplemented in pdfobjects::CStream, pdfobjects::CDict, and pdfobjects::CArray.
Definition at line 186 of file iproperty.h.
Referenced by pdfobjects::CArray::setIndiRef(), pdfobjects::CDict::setIndiRef(), and pdfobjects::CStream::setIndiRef().
|
inline |
Set object identification number and generation number.
| n | Objects identification number. |
| g | Objects generation number. |
Definition at line 195 of file iproperty.h.
References pdfobjects::IndiRef::gen, and pdfobjects::IndiRef::num.
|
inline |
|
virtual |
Set association with pdf.
| p | pdf that this object belongs to |
Reimplemented in pdfobjects::CStream, pdfobjects::CDict, and pdfobjects::CArray.
Definition at line 75 of file iproperty.cc.
Referenced by pdfobjects::CArray::setPdf(), pdfobjects::CDict::setPdf(), and pdfobjects::CStream::setPdf().
|
inline |
Unlock changes. Do dispatch changes.
Definition at line 277 of file iproperty.h.