#include <cannotation.h>
Public Types | |
| typedef std::vector< std::string > | SupportedList |
Public Member Functions | |
| virtual | ~IAnnotInitializator () |
| virtual SupportedList | getSupportedList () const =0 |
| virtual bool | operator() (boost::shared_ptr< CDict > &annotDict, std::string annotType)=0 |
Annotation initializator interface.
Provides interface for initializators of annotation dictionaries. Implementator should return all supported annotation types by getSupportedList method. Function operator initializes given annotation dictionary.
This is implementation of stateless builder design pattern (stateless means that result is constructed in one step and returned directly from construct function operator).
| typedef std::vector<std::string> pdfobjects::utils::IAnnotInitializator::SupportedList |
Type for supported initializer names.
| virtual pdfobjects::utils::IAnnotInitializator::~IAnnotInitializator | ( | ) | [inline, virtual] |
| virtual SupportedList pdfobjects::utils::IAnnotInitializator::getSupportedList | ( | ) | const [pure virtual] |
Returns list of supported annotation types.
Returned container contains all supprted annotation types, which can be used in function operator to make some initialization.
Implemented in pdfobjects::utils::UniversalAnnotInitializer, pdfobjects::utils::TextAnnotInitializer, and pdfobjects::utils::LinkAnnotInitializer.
| virtual bool pdfobjects::utils::IAnnotInitializator::operator() | ( | boost::shared_ptr< CDict > & | annotDict, | |
| std::string | annotType | |||
| ) | [pure virtual] |
Initialization (builder) function.
| annotDict | Annotation dictionary to initialize. | |
| annotType | Name of the annotation type to initialize. |
Initializes given dictionary to given annotType annotation type. If doesn't support such type, doesn't do any special initialization and returns with false.
In any case checks whether given annotDict contains Type field with /Annot value and if not sets this value.
Implemntator may do some checking and fail if given annotType can't be initialized (for example if it is initialized as different type which is in conflict with desired one).
Implemented in pdfobjects::utils::UniversalAnnotInitializer, pdfobjects::utils::TextAnnotInitializer, and pdfobjects::utils::LinkAnnotInitializer.