Loading...
Searching...
No Matches
CalcWriterInterface Class Referenceabstract

`#include <calcwriterinterface.h>`

Inheritance diagram for CalcWriterInterface:

## Public Member Functions

virtual | ~CalcWriterInterface ()
virtual void | close ()=0
virtual void | writeSheet (const QString &sheetName)=0
| open a new sheet
virtual void | writeLine ()=0
| open a new line
virtual void | writeCell (const char *cell_text)=0
| write a text cell
virtual void | writeCell (const QString &cell_text)=0
| write a text cell
virtual void | writeEmptyCell ()=0
| write an empty cell
virtual void | writeCell (std::size_t number)=0
| write an unsigned integer in a cell
virtual void | writeCell (int number)=0
| write an integer in a cell
virtual void | writeCell (float number)=0
| write a float in a cell
virtual void | writeCell (double number)=0
| write a double in a cell
virtual void | writeCellPercentage (double value)=0
| write a double as a percentage
virtual void | writeCell (bool true_or_false)=0
| write a boolean in a cell
virtual void | writeCell (const QDate &date)=0
| write a date in a cell
virtual void | writeCell (const QDateTime &datetime)=0
| write a timestamp in a cell
virtual void | writeCell (const QUrl &url_link, const QString &text)=0
| write a text cell with an URL link
virtual OdsTableCellStyleRef | getTableCellStyleRef (const OdsTableCellStyle &style)
virtual void | setTableCellStyleRef (OdsTableCellStyleRef style_ref)
void | clearTableCellStyleRef ()
virtual void | setCellAnnotation (const QString &annotation)=0
| set annotation to write in the next cell
virtual void | addColorScale (const OdsColorScale &ods_color_scale)
| apply solor scale conditional format on a cell range
virtual QString | getOdsCellCoordinate ()
| get the last written cell coordinate in ODS coordinate format get the coordinate of the last written cell or an empty string if the writer is not an OdsDocWriter
virtual void | setCurrentOdsTableSettings (const OdsTableSettings &settings)
| set ODS table settings of the current sheet (table)
virtual void | writeCellVariant (const QVariant &var)
| write a cell for a given QVariant

## Detailed Description

Definition at line 48 of file calcwriterinterface.h.

## Constructor & Destructor Documentation

## ~CalcWriterInterface()

CalcWriterInterface::~CalcWriterInterface | ( |  | ) |

virtual

Definition at line 41 of file calcwriterinterface.cpp.

{
}

## Member Function Documentation

## addColorScale()

void CalcWriterInterface::addColorScale | ( | const OdsColorScale & | ods_color_scale | ) |

virtual

apply solor scale conditional format on a cell range

Reimplemented in OdsDocWriter.

Definition at line 87 of file calcwriterinterface.cpp.

{
}

## clearTableCellStyleRef()

void CalcWriterInterface::clearTableCellStyleRef | ( |  | ) |

clear cell style definition in the stream. the default style will be applied.

Definition at line 78 of file calcwriterinterface.cpp.

{
setTableCellStyleRef(nullptr);
}
CalcWriterInterface::setTableCellStyleRef
virtual void setTableCellStyleRef(OdsTableCellStyleRef style_ref)
Definition calcwriterinterface.cpp:67

References setTableCellStyleRef().

## close()

virtual void CalcWriterInterface::close | ( |  | ) |

pure virtual

Implemented in OdsDocWriter, TsvDirectoryWriter, TsvOutputStream, and ZipTsvOutputStream.

## getOdsCellCoordinate()

QString CalcWriterInterface::getOdsCellCoordinate | ( |  | ) |

virtual

get the last written cell coordinate in ODS coordinate format get the coordinate of the last written cell or an empty string if the writer is not an OdsDocWriter

Returns
  QString with ODS cell coordinate of the form : "classeur.A5"

Reimplemented in OdsDocWriter.

Definition at line 99 of file calcwriterinterface.cpp.

{
return QString();
}

## getTableCellStyleRef()

OdsTableCellStyleRef CalcWriterInterface::getTableCellStyleRef | ( | const OdsTableCellStyle & | style | ) |

virtual

build table cell style reference with a style definition

Parameters

  style | OdsTableCellStyle

Returns
  OdsTableCellStyleRef pointer on a style reference

Reimplemented in OdsDocWriter.

Definition at line 53 of file calcwriterinterface.cpp.

{
return nullptr;
}

## setCellAnnotation()

virtual void CalcWriterInterface::setCellAnnotation | ( | const QString & | annotation | ) |

pure virtual

set annotation to write in the next cell

Parameters

  annotation | any comment on this cell

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## setCurrentOdsTableSettings()

void CalcWriterInterface::setCurrentOdsTableSettings | ( | const OdsTableSettings & | settings | ) |

virtual

set ODS table settings of the current sheet (table)

Reimplemented in OdsDocWriter.

Definition at line 107 of file calcwriterinterface.cpp.

{
}

## setTableCellStyleRef()

void CalcWriterInterface::setTableCellStyleRef | ( | OdsTableCellStyleRef | style_ref | ) |

virtual

set the cell table style. This is applied to in the stream to following cells. This ends by using an other style reference or by using setTableCellStyleRef function

Parameters

  style_ref | OdsTableCellStyleRef

Reimplemented in OdsDocWriter.

Definition at line 67 of file calcwriterinterface.cpp.

{
}

Referenced by clearTableCellStyleRef().

## writeCell() [1/10]

virtual void CalcWriterInterface::writeCell | ( | bool | true_or_false | ) |

pure virtual

write a boolean in a cell

Parameters

  true_or_false | boolean to write

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeCell() [2/10]

virtual void CalcWriterInterface::writeCell | ( | const char * | cell_text | ) |

pure virtual

write a text cell

Parameters

  cell_text | cell text

Implemented in OdsDocWriter, and TsvDirectoryWriter.

Referenced by writeCellVariant().

## writeCell() [3/10]

virtual void CalcWriterInterface::writeCell | ( | const QDate & | date | ) |

pure virtual

write a date in a cell

Parameters

  date | date to write

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeCell() [4/10]

virtual void CalcWriterInterface::writeCell | ( | const QDateTime & | datetime | ) |

pure virtual

write a timestamp in a cell

Parameters

  datetime | timestamp to write

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeCell() [5/10]

virtual void CalcWriterInterface::writeCell | ( | const QString & | cell_text | ) |

pure virtual

write a text cell

Parameters

  cell_text | cell text

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeCell() [6/10]

virtual void CalcWriterInterface::writeCell | ( | const QUrl & | url_link,
|  | const QString & | text )

pure virtual

write a text cell with an URL link

Parameters

  url_link | URL link
  text | text to write

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeCell() [7/10]

virtual void CalcWriterInterface::writeCell | ( | double | number | ) |

pure virtual

write a double in a cell

Parameters

  number | double to write

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeCell() [8/10]

virtual void CalcWriterInterface::writeCell | ( | float | number | ) |

pure virtual

write a float in a cell

Parameters

  number | float to write

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeCell() [9/10]

virtual void CalcWriterInterface::writeCell | ( | int | number | ) |

pure virtual

write an integer in a cell

Parameters

  number | integer to write

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeCell() [10/10]

virtual void CalcWriterInterface::writeCell | ( | std::size_t | number | ) |

pure virtual

write an unsigned integer in a cell

Parameters

  number | integer to write

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeCellPercentage()

virtual void CalcWriterInterface::writeCellPercentage | ( | double | value | ) |

pure virtual

write a double as a percentage

Parameters

  number | double to write must be a ratio (0.5 == 50%)

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeCellVariant()

void CalcWriterInterface::writeCellVariant | ( | const QVariant & | var | ) |

virtual

write a cell for a given QVariant

Parameters

  QVariant | variable to write

Definition at line 117 of file calcwriterinterface.cpp.

{
int type = var.metaType().id();
switch(type)
{
case QMetaType::Void:
writeEmptyCell();
break;
case QMetaType::Bool:
writeCell(var.toBool());
break;
case QMetaType::Double:
case QMetaType::Float:
writeCell(var.toDouble());
break;
case QMetaType::Int:
writeCell(var.toInt());
break;
case QMetaType::QDate:
writeCell(var.toDate());
break;
case QMetaType::QDateTime:
writeCell(var.toDateTime());
break;
case QMetaType::QString:
writeCell(var.toString());
break;
case QMetaType::QUrl:
writeCell(var.toUrl(), var.toUrl().toString());
break;
default:
writeCell(var.toString());
}
}
CalcWriterInterface::writeEmptyCell
virtual void writeEmptyCell()=0
write an empty cell
CalcWriterInterface::writeCell
virtual void writeCell(const char *cell_text)=0
write a text cell

References writeCell(), and writeEmptyCell().

## writeEmptyCell()

virtual void CalcWriterInterface::writeEmptyCell | ( |  | ) |

pure virtual

write an empty cell

Implemented in OdsDocWriter, and TsvDirectoryWriter.

Referenced by writeCellVariant().

## writeLine()

virtual void CalcWriterInterface::writeLine | ( |  | ) |

pure virtual

open a new line

Implemented in OdsDocWriter, and TsvDirectoryWriter.

## writeSheet()

virtual void CalcWriterInterface::writeSheet | ( | const QString & | sheetName | ) |

pure virtual

open a new sheet

Parameters

  sheetName | the sheet name

Implemented in OdsDocWriter, TsvDirectoryWriter, TsvOutputStream, and ZipTsvOutputStream.

The documentation for this class was generated from the following files:

- odsstream/calcwriterinterface.h
- odsstream/calcwriterinterface.cpp