kspread

OpenDocument file format

Classes and methods related to the OpenDocument loading/saving. More...

Classes

class  KSpread::OdfLoadingContext
 Data used while loading. More...
class  KSpread::OdfSavingContext
 Data used while saving. More...

Namespaces

namespace  KSpread::Odf

Enumerations

enum  KSpread::Doc::SaveFlag { KSpread::Doc::SaveAll, KSpread::Doc::SaveSelected }

Functions

void KSpread::Sheet::addText (const QString &text, KoXmlWriter &writer) const
bool KSpread::Sheet::compareRows (int row1, int row2, int &maxCols, OdfSavingContext &tableContext) const
void KSpread::Sheet::convertPart (const QString &part, KoXmlWriter &writer) const
KSPREAD_EXPORT QString KSpread::Odf::convertRangeToRef (const QString &sheetName, const QRect &_area)
KSPREAD_EXPORT QString KSpread::Odf::convertRefToBase (const QString &sheet, const QRect &rect)
KSPREAD_EXPORT QString KSpread::Odf::convertRefToRange (const QString &sheet, const QRect &rect)
KSPREAD_EXPORT QString KSpread::Odf::decodeFormula (const QString &expr, const KLocale *locale=0, QString namespacePrefix=QString())
QPen KSpread::Odf::decodePen (const QString &str)
KSPREAD_EXPORT QString KSpread::Odf::encodeFormula (const QString &expr, const KLocale *locale=0)
QString KSpread::Odf::encodePen (const QPen &pen)
QString KSpread::Sheet::getPart (const KoXmlNode &part)
bool KSpread::Sheet::loadColumnFormat (const KoXmlElement &row, const KoOdfStylesReader &stylesReader, int &indexCol, QHash< QString, QRegion > &columnStyleRegions)
bool KSpread::Sheet::loadOdf (const KoXmlElement &sheet, OdfLoadingContext &odfContext, const Styles &autoStyles, const QHash< QString, Conditions > &conditionalStyles)
virtual bool KSpread::Doc::loadOdf (KoOdfReadStore &odfStore)
void KSpread::NamedAreaManager::loadOdf (const KoXmlElement &body)
bool KSpread::Map::loadOdf (const KoXmlElement &mymap, KoOdfLoadingContext &odfContext)
bool KSpread::DatabaseManager::loadOdf (const KoXmlElement &element)
bool KSpread::Cell::loadOdf (const KoXmlElement &element, OdfLoadingContext &tableContext)
void KSpread::CalculationSettings::loadOdf (const KoXmlElement &body)
void KSpread::Doc::loadOdfCalculationSettings (const KoXmlElement &body)
void KSpread::Cell::loadOdfCellText (const KoXmlElement &parent)
void KSpread::Conditions::loadOdfConditions (const StyleManager *styleManager, const KoXmlElement &element)
void KSpread::Sheet::loadOdfInsertStyles (const Styles &autoStyles, const QHash< QString, QRegion > &styleRegions, const QHash< QString, Conditions > &conditionalStyles, const QRect &usedArea)
void KSpread::Sheet::loadOdfMasterLayoutPage (KoStyleStack &styleStack)
void KSpread::Cell::loadOdfObjects (const KoXmlElement &e, KoOdfLoadingContext &odfContext)
void KSpread::Sheet::loadOdfSettings (const KoOasisSettings::NamedMap &settings)
void KSpread::Map::loadOdfSettings (KoOasisSettings &settings)
void KSpread::Validity::loadOdfValidation (Cell *const cell, const QString &validationName, OdfLoadingContext &tableContext)
bool KSpread::Sheet::loadRowFormat (const KoXmlElement &row, int &rowIndex, OdfLoadingContext &odfContext, QHash< QString, QRegion > &rowStyleRegions, QHash< QString, QRegion > &cellStyleRegions)
bool KSpread::Sheet::loadSheetStyleFormat (KoXmlElement *style)
void KSpread::Sheet::replaceMacro (QString &text, const QString &old, const QString &newS)
bool KSpread::Sheet::saveOdf (OdfSavingContext &tableContext)
virtual bool KSpread::Doc::saveOdf (SavingContext &documentContext)
void KSpread::NamedAreaManager::saveOdf (KoXmlWriter &xmlWriter) const
bool KSpread::Map::saveOdf (KoXmlWriter &xmlWriter, KoShapeSavingContext &savingContext)
void KSpread::DatabaseManager::saveOdf (KoXmlWriter &xmlWriter) const
bool KSpread::Cell::saveOdf (KoXmlWriter &xmlwriter, KoGenStyles &mainStyles, int row, int column, int &repeated, OdfSavingContext &savingContext)
bool KSpread::CalculationSettings::saveOdf (KoXmlWriter &settingsWriter) const
void KSpread::Cell::saveOdfAnnotation (KoXmlWriter &xmlwriter)
void KSpread::Sheet::saveOdfCells (KoXmlWriter &xmlWriter, KoGenStyles &mainStyles, int row, int maxCols, OdfSavingContext &tableContext)
void KSpread::Sheet::saveOdfColRowCell (KoXmlWriter &xmlWriter, KoGenStyles &mainStyles, int maxCols, int maxRows, OdfSavingContext &tableContext)
void KSpread::Conditions::saveOdfConditions (KoGenStyle &currentCellStyle) const
void KSpread::StyleStorage::saveOdfCreateDefaultStyles (int &maxCols, int &maxRows, OdfSavingContext &tableContext) const
void KSpread::Sheet::saveOdfHeaderFooter (KoXmlWriter &xmlWriter) const
bool KSpread::Doc::saveOdfHelper (SavingContext &documentContext, SaveFlag saveFlag, QString *plainText=0)
void KSpread::Sheet::saveOdfPrintStyleLayout (KoGenStyle &style) const
void KSpread::Sheet::saveOdfSettings (KoXmlWriter &settingsWriter) const
void KSpread::Map::saveOdfSettings (KoXmlWriter &settingsWriter)
QString KSpread::Sheet::saveOdfSheetStyleName (KoGenStyles &mainStyles)

Detailed Description

Classes and methods related to the OpenDocument loading/saving.


Enumeration Type Documentation

enum KSpread::Doc::SaveFlag [inherited]
Enumerator:
SaveAll 
SaveSelected 

Definition at line 98 of file Doc.h.


Function Documentation

void KSpread::Sheet::addText ( const QString text,
KoXmlWriter &  writer 
) const [protected, inherited]

Definition at line 3145 of file Sheet.cpp.

bool KSpread::Sheet::compareRows ( int  row1,
int  row2,
int &  maxCols,
OdfSavingContext tableContext 
) const [protected, inherited]

Definition at line 3024 of file Sheet.cpp.

void KSpread::Sheet::convertPart ( const QString part,
KoXmlWriter &  writer 
) const [protected, inherited]

Definition at line 3151 of file Sheet.cpp.

QString KSpread::Odf::convertRangeToRef ( const QString sheetName,
const QRect _area 
)

Definition at line 244 of file Util.cpp.

QString KSpread::Odf::convertRefToBase ( const QString sheet,
const QRect rect 
)

Definition at line 206 of file Util.cpp.

QString KSpread::Odf::convertRefToRange ( const QString sheet,
const QRect rect 
)

Definition at line 220 of file Util.cpp.

QString KSpread::Odf::decodeFormula ( const QString expr,
const KLocale locale = 0,
QString  namespacePrefix = QString() 
)

Converts an OpenDocument representation of a formula to a localized formula.

Parameters:
expr The expression to convert from OpenDocument format.
locale The locale to which the expression should be converted.
Note:
Use Region::loadOdf() for plain cell references.

Definition at line 339 of file Util.cpp.

QPen KSpread::Odf::decodePen ( const QString str  ) 

Creates a QPen of OpenDocument pen attributes str .

Returns:
the created QPen

Definition at line 287 of file Util.cpp.

QString KSpread::Odf::encodeFormula ( const QString expr,
const KLocale locale = 0 
)

Converts a localized formula to an OpenDocument representation of a formula.

Parameters:
expr The expression to convert to OpenDocument format.
locale The locale from which the expression should be converted.
Note:
Use Region::saveOdf() for plain cell references.

Definition at line 534 of file Util.cpp.

QString KSpread::Odf::encodePen ( const QPen pen  ) 

Creates OpenDocument pen attributes of the QPen pen .

Returns:
the OpenDocument pen attributes

Definition at line 249 of file Util.cpp.

QString KSpread::Sheet::getPart ( const KoXmlNode &  part  )  [protected, inherited]

Definition at line 2334 of file Sheet.cpp.

bool KSpread::Sheet::loadColumnFormat ( const KoXmlElement &  row,
const KoOdfStylesReader &  stylesReader,
int &  indexCol,
QHash< QString, QRegion > &  columnStyleRegions 
) [protected, inherited]

Loads the properties of a column from a table:table-column element in an OASIS XML file defaultColumnCellStyles is a map from column indicies to the default cell style for that column.

Definition at line 2694 of file Sheet.cpp.

bool KSpread::Sheet::loadOdf ( const KoXmlElement &  sheet,
OdfLoadingContext odfContext,
const Styles autoStyles,
const QHash< QString, Conditions > &  conditionalStyles 
) [inherited]

Definition at line 2382 of file Sheet.cpp.

bool Doc::loadOdf ( KoOdfReadStore &  odfStore  )  [virtual, inherited]

Main loading method.

See also:
Map::loadOdf

Definition at line 464 of file Doc.cpp.

void NamedAreaManager::loadOdf ( const KoXmlElement &  body  )  [inherited]

Definition at line 180 of file NamedAreaManager.cpp.

bool Map::loadOdf ( const KoXmlElement &  mymap,
KoOdfLoadingContext &  odfContext 
) [inherited]

Definition at line 510 of file Map.cpp.

bool DatabaseManager::loadOdf ( const KoXmlElement &  element  )  [inherited]

Loads databases.

Definition at line 61 of file DatabaseManager.cpp.

bool Cell::loadOdf ( const KoXmlElement &  element,
OdfLoadingContext tableContext 
) [inherited]

Loads a cell from an OASIS XML element.

Parameters:
element An OASIS XML element
tableContext The loading context assoiated with the XML element

Definition at line 1336 of file Cell.cpp.

void CalculationSettings::loadOdf ( const KoXmlElement &  body  )  [inherited]

Definition at line 85 of file CalculationSettings.cpp.

void KSpread::Doc::loadOdfCalculationSettings ( const KoXmlElement &  body  )  [inherited]
void Cell::loadOdfCellText ( const KoXmlElement &  parent  )  [protected, inherited]

Load the text paragraphs from an OASIS XML cell description.

Parameters:
parent The DOM element representing the cell.

Definition at line 1613 of file Cell.cpp.

void Conditions::loadOdfConditions ( const StyleManager styleManager,
const KoXmlElement &  element 
) [inherited]

Loads the condtional formattings.

Definition at line 476 of file Condition.cpp.

void KSpread::Sheet::loadOdfInsertStyles ( const Styles autoStyles,
const QHash< QString, QRegion > &  styleRegions,
const QHash< QString, Conditions > &  conditionalStyles,
const QRect usedArea 
) [protected, inherited]

Inserts the styles contained in styleRegions into the style storage.

Looks automatic styles up in the map of preloaded automatic styles, autoStyles , and custom styles in the StyleManager. The region is restricted to usedArea .

Definition at line 2807 of file Sheet.cpp.

void KSpread::Sheet::loadOdfMasterLayoutPage ( KoStyleStack &  styleStack  )  [protected, inherited]

Definition at line 2567 of file Sheet.cpp.

void Cell::loadOdfObjects ( const KoXmlElement &  e,
KoOdfLoadingContext &  odfContext 
) [protected, inherited]

Definition at line 1667 of file Cell.cpp.

void KSpread::Sheet::loadOdfSettings ( const KoOasisSettings::NamedMap &  settings  )  [inherited]

Definition at line 3278 of file Sheet.cpp.

void Map::loadOdfSettings ( KoOasisSettings &  settings  )  [inherited]

Definition at line 356 of file Map.cpp.

void Validity::loadOdfValidation ( Cell *const   cell,
const QString validationName,
OdfLoadingContext tableContext 
) [inherited]

Loads validity checks.

Definition at line 261 of file Validity.cpp.

bool KSpread::Sheet::loadRowFormat ( const KoXmlElement &  row,
int &  rowIndex,
OdfLoadingContext odfContext,
QHash< QString, QRegion > &  rowStyleRegions,
QHash< QString, QRegion > &  cellStyleRegions 
) [protected, inherited]

Definition at line 2847 of file Sheet.cpp.

bool KSpread::Sheet::loadSheetStyleFormat ( KoXmlElement *  style  )  [protected, inherited]

Definition at line 2247 of file Sheet.cpp.

void KSpread::Sheet::replaceMacro ( QString text,
const QString old,
const QString newS 
) [protected, inherited]

Definition at line 2327 of file Sheet.cpp.

bool KSpread::Sheet::saveOdf ( OdfSavingContext tableContext  )  [inherited]

Definition at line 3319 of file Sheet.cpp.

bool Doc::saveOdf ( SavingContext &  documentContext  )  [virtual, inherited]

Main saving method.

Definition at line 344 of file Doc.cpp.

void NamedAreaManager::saveOdf ( KoXmlWriter &  xmlWriter  )  const [inherited]

Definition at line 221 of file NamedAreaManager.cpp.

bool Map::saveOdf ( KoXmlWriter &  xmlWriter,
KoShapeSavingContext &  savingContext 
) [inherited]

Definition at line 418 of file Map.cpp.

void DatabaseManager::saveOdf ( KoXmlWriter &  xmlWriter  )  const [inherited]

Saves databases.

Definition at line 86 of file DatabaseManager.cpp.

bool Cell::saveOdf ( KoXmlWriter &  xmlwriter,
KoGenStyles &  mainStyles,
int  row,
int  column,
int &  repeated,
OdfSavingContext savingContext 
) [inherited]

Definition at line 1094 of file Cell.cpp.

bool CalculationSettings::saveOdf ( KoXmlWriter &  settingsWriter  )  const [inherited]

Definition at line 166 of file CalculationSettings.cpp.

void Cell::saveOdfAnnotation ( KoXmlWriter &  xmlwriter  )  [protected, inherited]

Definition at line 1064 of file Cell.cpp.

void KSpread::Sheet::saveOdfCells ( KoXmlWriter &  xmlWriter,
KoGenStyles &  mainStyles,
int  row,
int  maxCols,
OdfSavingContext tableContext 
) [protected, inherited]

Definition at line 3672 of file Sheet.cpp.

void KSpread::Sheet::saveOdfColRowCell ( KoXmlWriter &  xmlWriter,
KoGenStyles &  mainStyles,
int  maxCols,
int  maxRows,
OdfSavingContext tableContext 
) [protected, inherited]

Definition at line 3418 of file Sheet.cpp.

void Conditions::saveOdfConditions ( KoGenStyle &  currentCellStyle  )  const [inherited]

Saves the condtional formattings.

Definition at line 307 of file Condition.cpp.

void StyleStorage::saveOdfCreateDefaultStyles ( int &  maxCols,
int &  maxRows,
OdfSavingContext tableContext 
) const [inherited]
Returns:
the OpenDocument column/row default cell styles

Definition at line 138 of file StyleStorage.cpp.

void KSpread::Sheet::saveOdfHeaderFooter ( KoXmlWriter &  xmlWriter  )  const [inherited]

Definition at line 3057 of file Sheet.cpp.

bool Doc::saveOdfHelper ( SavingContext &  documentContext,
SaveFlag  saveFlag,
QString plainText = 0 
) [inherited]

Save the whole document, or just the selection, into OASIS format When saving the selection, also return the data as plain text and/or plain picture, which are used to insert into the KMultipleDrag drag object.

Parameters:
store the KoStore to save into
manifestWriter pointer to a koxmlwriter to add entries to the manifest
saveFlag either the whole document, or only the selected text/objects.
plainText must be set when saveFlag==SaveSelected. It returns the plain text format of the saved data, when available.

Definition at line 350 of file Doc.cpp.

void KSpread::Sheet::saveOdfPrintStyleLayout ( KoGenStyle &  style  )  const [inherited]

Definition at line 3379 of file Sheet.cpp.

void KSpread::Sheet::saveOdfSettings ( KoXmlWriter &  settingsWriter  )  const [inherited]

Definition at line 3304 of file Sheet.cpp.

void Map::saveOdfSettings ( KoXmlWriter &  settingsWriter  )  [inherited]

Definition at line 381 of file Map.cpp.

QString KSpread::Sheet::saveOdfSheetStyleName ( KoGenStyles &  mainStyles  )  [protected, inherited]

Definition at line 3397 of file Sheet.cpp.