A XAML generator for Mako, allowing simple generation of XAML fragments for individual DOM nodes or entire pages. More...
#include <xamlgenerator.h>
Classes | |
class | CAnnotationXAML |
Class for receiving XAML generated for annotation appearances in a bulk fashion. More... | |
class | CResourceEntry |
Resource entry. More... | |
Public Member Functions | |
virtual IRAInputStreamPtr | generateXAML (const IDOMNodePtr &node, const IDOMCatalogPtr &catalog=IDOMCatalogPtr())=0 |
Generate XAML for the given DOM Node, returning the result in a stream. | |
virtual void | generateXAML (const IDOMNodePtr &node, const IOutputStreamPtr &outputStream, const IDOMCatalogPtr &catalog=IDOMCatalogPtr())=0 |
Alternate form of generateXAML() when an existing stream should be used. | |
virtual IRAInputStreamPtr | generateXAMLForPageAndAnnotationAppearances (const IPagePtr &page, CAnnotationXAMLVect &appearanceXAMLs)=0 |
Generate XAML for the given IPage and all the annotation appearances present on the page. The XAML for the page will be in the returned stream, and appearanceXAMLs will be populated with the XAML for all annotation appearances. This will usually be faster than using generateXAML() on the page contents and then separately invoking generateXAMLForPageAnnotationAppearances(). | |
virtual IRAInputStreamPtr | generateXAMLForAppearance (const IAnnotationAppearancePtr &appearance, const IAnnotationPtr &annotation, const IPagePtr &page)=0 |
Generate XAML for a given annotation appearance. Provide the annotation and page from which the appearance comes. The page is required as some annotations may need to be composited against the page backdrop. This is slower than invoking generateXAMLForPageAnnotationAppearances() which is in turn slower than using generateXAMLForPageAndAnnotations(). | |
virtual void | generateXAMLForAppearance (const IAnnotationAppearancePtr &appearance, const IAnnotationPtr &annotation, const IPagePtr &page, const IOutputStreamPtr &outputStream)=0 |
Alternate form of generateXAMLForAppearance() where an existing stream should be used. Provide the annotation and page from which the appearance comes. The page is required as some annotations may need to be composited against the page backdrop. This is slower than invoking generateXAMLForPageAnnotationAppearances() which is in turn slower than using generateXAMLForPageAndAnnotations(). | |
virtual void | generateXAMLForPageAnnotationAppearances (const IPagePtr &page, CAnnotationXAMLVect &appearanceXAMLs)=0 |
Generate XAML for all the annotation appearances on the given page. This is generally more efficient than using generateXAMLForAppearance() repeatedly for every page, but not as fast as using generateXAMLForPageAndAnnotations() to generate XAML for the page and the annotations in one bulk operation. | |
virtual IInputStreamPtr | getResource (const U8String &name)=0 |
Get the stream for a named resource. An exception will be thrown if the resource cannot be found. | |
virtual void | getResources (CEDLVector< CResourceEntry > &resources)=0 |
Get all the resources in a vector. | |
virtual void | setSubsetFonts (bool subset)=0 |
Set whether fonts should be subset in the output. | |
virtual void | setMergeFonts (bool merge)=0 |
Set whether or not an attempt will be made to merge disparate subsets of a font into a single font. | |
virtual void | setMergeImages (bool merge=true)=0 |
Set if the XAML writer should attempt to merge adjacent images. The default is true. | |
virtual void | setColorImageMaxResolution (float resolution, float threshold=0.0f, IDOMImageDownsamplerFilter::eDownsamplingMethod method=IDOMImageDownsamplerFilter::eBicubic)=0 |
Set the desired maximum resolution, threshold and downsampling method for color images for XAML output. | |
virtual void | setGrayImageMaxResolution (float resolution, float threshold=0.0f, IDOMImageDownsamplerFilter::eDownsamplingMethod method=IDOMImageDownsamplerFilter::eBicubic)=0 |
Set the desired maximum resolution, threshold and downsampling method for gray images. | |
virtual void | setMonoImageMaxResolution (float resolution, float threshold=0.0f, IDOMImageDownsamplerFilter::eDownsamplingMethod method=IDOMImageDownsamplerFilter::eSubsample)=0 |
Set the desired maximum resolution, threshold and downsampling method for monochrome images. | |
virtual void | setTargetColorSpace (const IDOMColorSpacePtr &targetSpace)=0 |
Set the target color space for the output. The default behaviour is to, where possible, leave the color space of objects unchanged. | |
virtual void | setTargetProfile (const IDOMICCProfilePtr &profile)=0 |
Set the target color space for the output using an ICC profile. The default behaviour is to, where possible, leave the color space of objects unchanged. | |
virtual void | applyColorConverterTransform (const IColorConverterTransformPtr &transform)=0 |
Apply the given color converter transform to the contents before writing XAML. This supersedes the target color space parameters described above. This allows for more advanced configuration of the color spaces of the output. | |
virtual void | setRenderResolution (uint32 resolution)=0 |
Set the resolution to use if page content requires rendering in order to be output as XAML. The default is 150dpi. This is affected also by the maximum image resolution parameters. | |
virtual void | applyRendererTransform (const IRendererTransformPtr &transform)=0 |
Apply the given renderer transform to the contents before writing XAML. This supersedes the target color space parameters described above. This allows for more advanced configuration of rendering. | |
virtual void | setPreferredColorImageFormat (IImageEncoderTransform::eEncodeFormat format)=0 |
Set the desired image format for color images that need to be reencoded for XAML output. The default is eEFAuto. Note: this is advisory only and may not be honoured in all cases if the image cannot be represented in XAML in the desired form. | |
virtual void | setPreferredGrayImageFormat (IImageEncoderTransform::eEncodeFormat format)=0 |
Set the desired image format for gray images that need to be reencoded for XAML output. The default is eEFAuto. Note: this is advisory only and may not be honoured in all cases if the image cannot be represented in XPS in the desired form. | |
virtual void | setPreferredMonoImageFormat (IImageEncoderTransform::eEncodeFormat format)=0 |
Set the desired image format for monochrome images that need to be reencoded for XAML output. The default is eEFAuto. Note: this is advisory only and may not be honoured in all cases if the image cannot be represented in XPS in the desired form. | |
virtual void | setJPEGQuality (uint8 quality)=0 |
Set the JPEG quality to use when encoding images in JPEG format. Equivalent to calling setParameter() with the parameter name "JPEGQuality" and the value being the required quality. | |
virtual void | applyEncoderTransform (const IImageEncoderTransformPtr &transform)=0 |
Apply the given image encoder transform to the contents before writing to XAML. This supersedes the image encoding parameters described above. This allows for more advanced configuration of image encoding. | |
Public Member Functions inherited from IRCObject | |
virtual void | addRef () const =0 |
Increases the reference count of the actual object pointed to. This would take place during an assignment or copying. | |
virtual bool | decRef () const =0 |
Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to. | |
virtual int32 | getRefCount () const =0 |
Retrieve the current reference count of the actual object pointed to. | |
Static Public Member Functions | |
static JAWSMAKO_API IXAMLGeneratorPtr | create (const IJawsMakoPtr &jawsMako, const U8String &resourcePrefix=U8String(), const IProgressMonitorPtr &progressMonitor=IProgressMonitorPtr()) |
Create a XAML generator instance. | |
Additional Inherited Members | |
Protected Member Functions inherited from IRCObject | |
virtual | ~IRCObject () |
Virtual destructor. | |
A XAML generator for Mako, allowing simple generation of XAML fragments for individual DOM nodes or entire pages.
The XAML is provided in a stream, with resources used by the XAML presented as streams tracked by instances of this object, which can be requested via getResource(). Resources are reused where possible for multiple XAML fragments.
|
static |
Create a XAML generator instance.
jawsMako | The JawsMako instance. |
resourcePrefix | A path fragment to prepend to resource names when generating XAML. Useful for cases where the resources are to be written to disk somewhere else than alongside the XAML fragment. |
progressMonitor | The progress monitor which allows aborting an operation or registering a progress callback. |
|
pure virtual |
Generate XAML for the given DOM Node, returning the result in a stream.
node | The DOM node to be represented as XAML. |
catalog | The catalog associated with the node. Optional, but required if the names of named elements are to be present in the generated XAML. |
|
pure virtual |
Alternate form of generateXAML() when an existing stream should be used.
node | The DOM node to be represented as XAML. |
outputStream | The destination stream for the XAML. |
catalog | The catalog associated with the node. Optional, but required if the names of named elements are to be present in the generated XAML. |
|
pure virtual |
Generate XAML for a given annotation appearance. Provide the annotation and page from which the appearance comes. The page is required as some annotations may need to be composited against the page backdrop. This is slower than invoking generateXAMLForPageAnnotationAppearances() which is in turn slower than using generateXAMLForPageAndAnnotations().
appearance | The appearance to be presented as XAML. |
annotation | The annotation that contains the appearance. Required in order to position the annotation against the page background correctly. |
page | The page the appearance appears on. |
|
pure virtual |
Alternate form of generateXAMLForAppearance() where an existing stream should be used. Provide the annotation and page from which the appearance comes. The page is required as some annotations may need to be composited against the page backdrop. This is slower than invoking generateXAMLForPageAnnotationAppearances() which is in turn slower than using generateXAMLForPageAndAnnotations().
appearance | The appearance to be presented as XAML. |
annotation | The annotation that contains the appearance. Required in order to position the annotation against the page background correctly. |
page | The page the appearance appears on. |
|
pure virtual |
Generate XAML for the given IPage and all the annotation appearances present on the page. The XAML for the page will be in the returned stream, and appearanceXAMLs will be populated with the XAML for all annotation appearances. This will usually be faster than using generateXAML() on the page contents and then separately invoking generateXAMLForPageAnnotationAppearances().
page | The DOM node to be produced as XAML |
appearanceXAMLs | A vector to receive the XAML for the annotation appearances. |
|
pure virtual |
Generate XAML for all the annotation appearances on the given page. This is generally more efficient than using generateXAMLForAppearance() repeatedly for every page, but not as fast as using generateXAMLForPageAndAnnotations() to generate XAML for the page and the annotations in one bulk operation.
page | The page whose annotations should be represented as XAML. |
appearanceXAMLs | A vector to receive the XAML for the annotation appearances. |
|
pure virtual |
Get the stream for a named resource. An exception will be thrown if the resource cannot be found.
name | The name of the resource. |
|
pure virtual |
Get all the resources in a vector.
resources | A reference to a vector to receive the entries. |
|
pure virtual |
Set the desired maximum resolution, threshold and downsampling method for color images for XAML output.
The default behaviour is leave the image resolution unchanged.
resolution | The desired output resolution, in dpi. Pass 0 to leave images unchanged, which is the default. |
threshold | The threshold above which images will be reduced to the desired resolution. Pass 0 to use the resolution. |
method | The method to use when downsampling. The default is bicubic for color images. |
|
pure virtual |
Set the desired maximum resolution, threshold and downsampling method for gray images.
The default behaviour is leave the image resolution unchanged.
resolution | The desired output resolution, in dpi. Pass 0 to leave images unchanged, which is the default. |
threshold | The threshold above which images will be reduced to the desired resolution. Pass 0 to use the resolution. |
method | The method to use when downsampling. The default is bicubic for gray images. |
|
pure virtual |
Set the JPEG quality to use when encoding images in JPEG format. Equivalent to calling setParameter() with the parameter name "JPEGQuality" and the value being the required quality.
quality | The desired quality level, with 1 being lowest quality and 5 being highest quality. |
|
pure virtual |
Set whether or not an attempt will be made to merge disparate subsets of a font into a single font.
The default is false. Equivalent to calling setParameter with "MergeFonts" as the parameter name.
Some formats such as PostScript and XPS tend to include many font subsets and for output it is often avantageous to attempt to merge these fonts into a single font where possible.
Note that it is possible to enable both font subsetting and merging at the same time. In this case merging happens first, followed by subsetting of the merged results.
|
pure virtual |
Set the desired maximum resolution, threshold and downsampling method for monochrome images.
The default behaviour is leave the image resolution unchanged.
resolution | The desired output resolution, in dpi. Pass 0 to leave images unchanged, which is the default. |
threshold | The threshold above which images will be reduced to the desired resolution. Pass 0 to use the resolution. |
method | The method to use when downsampling. The default is subsample for monochrome images; using any other method will result in grayscale output. |
|
pure virtual |
Set the desired image format for color images that need to be reencoded for XAML output. The default is eEFAuto. Note: this is advisory only and may not be honoured in all cases if the image cannot be represented in XAML in the desired form.
format | The desired format. |
|
pure virtual |
Set the desired image format for gray images that need to be reencoded for XAML output. The default is eEFAuto. Note: this is advisory only and may not be honoured in all cases if the image cannot be represented in XPS in the desired form.
format | The desired format. |
|
pure virtual |
Set the desired image format for monochrome images that need to be reencoded for XAML output. The default is eEFAuto. Note: this is advisory only and may not be honoured in all cases if the image cannot be represented in XPS in the desired form.
format | The desired format. |
|
pure virtual |
Set the resolution to use if page content requires rendering in order to be output as XAML. The default is 150dpi. This is affected also by the maximum image resolution parameters.
resolution | The desired resolution in dpi. |
|
pure virtual |
Set whether fonts should be subset in the output.
The default is false. Equivalent to calling setParameter with "SubsetFonts" as the parameter name. Note that all fonts may not be subsetted; for some subsetting may be forbidden, and for others there may be little gain in subsetting.
|
pure virtual |
Set the target color space for the output. The default behaviour is to, where possible, leave the color space of objects unchanged.
targetSpace | The desired color space. Must be a simple or ICC space. |
|
pure virtual |
Set the target color space for the output using an ICC profile. The default behaviour is to, where possible, leave the color space of objects unchanged.
profile | The desired profile. |