#include <KoShapeSavingContext.h>
Public Types | |
| Store | |
| Flat | |
| PresentationShape = 1 | |
| If set the style of family presentation is used, when not set the family graphic is used. | |
| DrawId = 2 | |
| Save the draw:id used for referencing the shape. | |
| AutoStyleInStyleXml = 4 | |
| If set the automatic style will be marked as being needed in styles.xml. | |
| UniqueMasterPages = 8 | |
| If set duplicate master pages will be merged to one. | |
| enum | SavingMode { Store, Flat } |
| enum | ShapeSavingOption { PresentationShape = 1, DrawId = 2, AutoStyleInStyleXml = 4, UniqueMasterPages = 8 } |
| The Style used for saving the shape. More... | |
Public Member Functions | |
| KoShapeSavingContext (KoXmlWriter &xmlWriter, KoGenStyles &mainStyles, KoEmbeddedDocumentSaver &embeddedSaver, SavingMode savingMode=Store) | |
| Constructor. | |
| KoXmlWriter & | xmlWriter () |
| Get the xml writer. | |
| void | setXmlWriter (KoXmlWriter &xmlWriter) |
| Set the xml writer. | |
| KoGenStyles & | mainStyles () |
| Get the main styles. | |
| KoEmbeddedDocumentSaver & | embeddedSaver () |
| Get the embedded document saver. | |
| bool | isSet (ShapeSavingOption option) const |
| Check if an option is set. | |
| void | setOptions (KoShapeSavingOptions options) |
| Set the options to use. | |
| void | addOption (ShapeSavingOption option) |
| add an option to the set of options stored on this context, will leave the other options intact. | |
| void | removeOption (ShapeSavingOption option) |
| remove an option, will leave the other options intact. | |
| KoShapeSavingOptions | options () const |
| Get the options used. | |
| const QString | drawId (const KoShape *shape, bool insert=true) |
| Get the draw id for a shape. | |
| void | clearDrawIds () |
| Clear out all given draw ids. | |
| void | addLayerForSaving (const KoShapeLayer *layer) |
| Adds a layer to save into a layer-set in styles.xml according to 9.1.2/9.1.3 odf spec. | |
| void | saveLayerSet (KoXmlWriter *xmlWriter) const |
| Saves the layers added with addLayerForSaving to the xml writer. | |
| QString | addImageForSaving (const QPixmap &pixmap) |
| Adds a pixmap for saving into the Pictures subfolder within the odf file Note that images added this way should only be transient images like textures from styles etc Real images should be added to the ImageCollection. | |
| bool | saveImages (KoStore *store, KoXmlWriter *manifestWriter) const |
| Saves images added with addImageForSaving to the store. | |
| void | addDataCenter (KoDataCenter *dataCenter) |
| Add data center. | |
| bool | saveDataCenter (KoStore *store, KoXmlWriter *manifestWriter) |
| Save the data centers. | |
The Style used for saving the shape.
| KoShapeSavingContext::KoShapeSavingContext | ( | KoXmlWriter & | xmlWriter, | |
| KoGenStyles & | mainStyles, | |||
| KoEmbeddedDocumentSaver & | embeddedSaver, | |||
| SavingMode | savingMode = Store | |||
| ) |
Constructor.
| xmlWriter | used for writing the xml | |
| mainStyles | for saving the styles | |
| embeddedSaver | for saving embedded documents | |
| savingMode | either Store (a KoStore will be used) or Flat (all data must be inline in the XML) |
| QString KoShapeSavingContext::addImageForSaving | ( | const QPixmap & | pixmap | ) |
Adds a pixmap for saving into the Pictures subfolder within the odf file Note that images added this way should only be transient images like textures from styles etc Real images should be added to the ImageCollection.
| pixmap | the pixmap to save |
| void KoShapeSavingContext::addLayerForSaving | ( | const KoShapeLayer * | layer | ) |
Adds a layer to save into a layer-set in styles.xml according to 9.1.2/9.1.3 odf spec.
| layer | the layer to save |
| void KoShapeSavingContext::clearDrawIds | ( | ) |
Clear out all given draw ids.
This is needed for checking if master pages are the same. In normal saving this should not be called.
| const QString KoShapeSavingContext::drawId | ( | const KoShape * | shape, | |
| bool | insert = true | |||
| ) |
Get the draw id for a shape.
The draw:id is unique for all shapes.
| shape | for which the draw id should be returned | |
| insert | if true a new draw id will be generated if there is non yet |
| KoEmbeddedDocumentSaver & KoShapeSavingContext::embeddedSaver | ( | ) |
Get the embedded document saver.
| bool KoShapeSavingContext::isSet | ( | ShapeSavingOption | option | ) | const |
Check if an option is set.
| KoGenStyles & KoShapeSavingContext::mainStyles | ( | ) |
Get the main styles.
| KoShapeSavingContext::KoShapeSavingOptions KoShapeSavingContext::options | ( | ) | const |
Get the options used.
| bool KoShapeSavingContext::saveDataCenter | ( | KoStore * | store, | |
| KoXmlWriter * | manifestWriter | |||
| ) |
Save the data centers.
This calls KoDataCenter::completeSaving()
| void KoShapeSavingContext::setOptions | ( | KoShapeSavingOptions | options | ) |
Set the options to use.
| options | to use |
| void KoShapeSavingContext::setXmlWriter | ( | KoXmlWriter & | xmlWriter | ) |
Set the xml writer.
Change the xmlWriter that is used in the Context e.g. for saving to styles.xml instead of content.xml
| xmlWriter | to use |
| KoXmlWriter & KoShapeSavingContext::xmlWriter | ( | ) |
Get the xml writer.
1.4.7