KoShapeSavingContext Class Reference

The set of data for the ODF file format used during saving of a shape. More...

#include <KoShapeSavingContext.h>

List of all members.

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.
KoXmlWriterxmlWriter ()
 Get the xml writer.
void setXmlWriter (KoXmlWriter &xmlWriter)
 Set the xml writer.
KoGenStylesmainStyles ()
 Get the main styles.
KoEmbeddedDocumentSaverembeddedSaver ()
 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.


Detailed Description

The set of data for the ODF file format used during saving of a shape.


Member Enumeration Documentation

enum KoShapeSavingContext::ShapeSavingOption

The Style used for saving the shape.

Enumerator:
PresentationShape  If set the style of family presentation is used, when not set the family graphic is used.

See OpenDocument 9.2.15 Common Drawing Shape Attributes / Style

DrawId  Save the draw:id used for referencing the shape.

See OpenDocument 9.2.15 Common Drawing Shape Attributes / ID

AutoStyleInStyleXml  If set the automatic style will be marked as being needed in styles.xml.
UniqueMasterPages  If set duplicate master pages will be merged to one.


Constructor & Destructor Documentation

KoShapeSavingContext::KoShapeSavingContext ( KoXmlWriter xmlWriter,
KoGenStyles mainStyles,
KoEmbeddedDocumentSaver embeddedSaver,
SavingMode  savingMode = Store 
)

Constructor.

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


Member Function Documentation

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.

Parameters:
pixmap the pixmap to save
Returns:
the filename of the pixmap to refer to

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.

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

See also:
KoPAPastePage::process

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.

Parameters:
shape for which the draw id should be returned
insert if true a new draw id will be generated if there is non yet
Returns:
the draw id for the shape or and empty string if it was not found

KoEmbeddedDocumentSaver & KoShapeSavingContext::embeddedSaver (  ) 

Get the embedded document saver.

Returns:
embedded document saver

bool KoShapeSavingContext::isSet ( ShapeSavingOption  option  )  const

Check if an option is set.

Returns:
ture if the option is set, false otherwise

KoGenStyles & KoShapeSavingContext::mainStyles (  ) 

Get the main styles.

Returns:
main styles

KoShapeSavingContext::KoShapeSavingOptions KoShapeSavingContext::options (  )  const

Get the options used.

Returns:
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.

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

Parameters:
xmlWriter to use

KoXmlWriter & KoShapeSavingContext::xmlWriter (  ) 

Get the xml writer.

Returns:
xmlWriter


The documentation for this class was generated from the following files:
Generated on Sun Jul 20 22:37:16 2008 for libs/flake by  doxygen 1.4.7