Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
MWAWCell Class Reference

a structure used to define a cell and its format More...

`#include <MWAWCell.hxx>`

Inheritance diagram for MWAWCell:

## Classes
struct | CompareFormat
| a comparaison structure used to store data More...
struct | Format
| a structure uses to define the format of a cell content More...

## Public Types
enum | FormatType { F_TEXT, F_BOOLEAN, F_NUMBER, F_DATE, F_TIME, F_UNKNOWN }
| the different format of a cell's content More...
enum | NumberType { F_NUMBER_CURRENCY, F_NUMBER_DECIMAL, F_NUMBER_FRACTION, F_NUMBER_GENERIC, F_NUMBER_SCIENTIFIC, F_NUMBER_PERCENT, F_NUMBER_UNKNOWN }
| the different number format of a cell's content More...
enum | HorizontalAlignment { HALIGN_LEFT, HALIGN_RIGHT, HALIGN_CENTER, HALIGN_FULL, HALIGN_DEFAULT }
| the default horizontal alignment. More...
enum | VerticalAlignment { VALIGN_TOP, VALIGN_CENTER, VALIGN_BOTTOM, VALIGN_DEFAULT }
| the default vertical alignment. More...
enum | ExtraLine { E_None, E_Line1, E_Line2, E_Cross }
| an enum to defined potential internal line: E_Line1=TL to RB, E_Line2=BL to RT More...

## Public Member Functions
| MWAWCell ()
| constructor More...
virtual | ~MWAWCell ()
| destructor More...
void | addTo (librevenge::RVNGPropertyList &propList, shared_ptr< MWAWFontConverter > fontConverter) const
| adds to the propList More...
virtual bool | send (MWAWListenerPtr listener, MWAWTable &table)
| function called when a cell is send by MWAWTable to send a cell to a listener. More...
virtual bool | sendContent (MWAWListenerPtr listener, MWAWTable &table)
| function called when the content of a cell must be send to the listener, ie. More...
MWAWVec2i const & | position () const
| position accessor More...
void | setPosition (MWAWVec2i posi)
| set the cell positions : 0,0 -> A1, 0,1 -> A2 More...
MWAWVec2i const & | numSpannedCells () const
| returns the number of spanned cells More...
void | setNumSpannedCells (MWAWVec2i numSpanned)
| sets the number of spanned cells : MWAWVec2i(1,1) means 1 cellule More...
MWAWBox2f const & | bdBox () const
| bdbox accessor More...
void | setBdBox (MWAWBox2f box)
| set the bdbox (unit point) More...
MWAWVec2f const & | bdSize () const
| bdbox size accessor More...
void | setBdSize (MWAWVec2f sz)
| set the bdbox size(unit point) More...
Format const & | getFormat () const
| returns the cell format More...
void | setFormat (Format const &format)
| set the cell format More...
bool | isFontSet () const
| returns true if the font has been set More...
MWAWFont | getFont () const
| returns the font More...
void | setFont (MWAWFont const &font, bool isDefault=false)
| sets the fonts More...
bool | isProtected () const
| returns true if the cell is protected More...
void | setProtected (bool fl)
| sets the cell's protected flag More...
HorizontalAlignment | hAlignment () const
| returns the horizontal alignment More...
void | setHAlignment (HorizontalAlignment align)
| sets the horizontal alignment More...
VerticalAlignment | vAlignment () const
| returns the vertical alignment More...
void | setVAlignment (VerticalAlignment align)
| sets the vertical alignment More...
bool | hasBorders () const
| return true if the cell has some border More...
std::vector< MWAWBorder > const & | borders () const
| return the cell border: libmwaw::Left | ... More...
void | resetBorders ()
| reset the border More...
void | setBorders (int wh, MWAWBorder const &border)
| sets the cell border: wh=libmwaw::LeftBit|... More...
MWAWColor | backgroundColor () const
| returns the background color More...
void | setBackgroundColor (MWAWColor color)
| sets the background color More...
bool | hasExtraLine () const
| returns true if we have some extra lines More...
ExtraLine | extraLine () const
| returns the extra lines More...
MWAWBorder const & | extraLineType () const
| returns the extra line border More...
void | setExtraLine (ExtraLine extrLine, MWAWBorder const &type=MWAWBorder())
| sets the extraline More...

## Static Public Member Functions
static std::string | getBasicCellName (MWAWVec2i const &pos)
| return the name of a cell (given row and column) : 0,0 -> A1, 0,1 -> A2... More...
static std::string | getCellName (MWAWVec2i const &pos, MWAWVec2b const &absolute)
| return the name of a cell (given row and column) : 0,0 -> [.A1], 0,1 -> [.A2] More...
static std::string | getColumnName (int col)
| return the column name More...

## Protected Attributes
MWAWVec2i | m_position
| the cell row and column : 0,0 -> A1, 0,1 -> A2 More...
MWAWVec2i | m_numberCellSpanned
| the cell spanned : by default (1,1) More...
MWAWBox2f | m_bdBox
| the cell bounding box (unit in point) More...
MWAWVec2f | m_bdSize
| the cell bounding size : unit point More...
Format | m_format
| the cell format More...
MWAWFont | m_font
| the cell font More...
bool | m_fontSet
| a flag to know if the font has been set More...
HorizontalAlignment | m_hAlign
| the cell alignment : by default nothing More...
VerticalAlignment | m_vAlign
| the vertical cell alignment : by default nothing More...
MWAWColor | m_backgroundColor
| the backgroung color More...
bool | m_protected
| cell protected More...
std::vector< MWAWBorder > | m_bordersList
| the cell border MWAWBorder::Pos More...
ExtraLine | m_extraLine
| extra line More...
MWAWBorder | m_extraLineType
| extra line type More...

## Friends
std::ostream & | operator<< (std::ostream &o, MWAWCell const &cell)
| operator<< More...

## Detailed Description

a structure used to define a cell and its format

## Member Enumeration Documentation

## ◆ ExtraLine

enum MWAWCell::ExtraLine

an enum to defined potential internal line: E_Line1=TL to RB, E_Line2=BL to RT

Enumerator
E_None |
E_Line1 |
E_Line2 |
E_Cross |

## ◆ FormatType

enum MWAWCell::FormatType

the different format of a cell's content

Enumerator
F_TEXT |
F_BOOLEAN |
F_NUMBER |
F_DATE |
F_TIME |
F_UNKNOWN |

## ◆ HorizontalAlignment

enum MWAWCell::HorizontalAlignment

the default horizontal alignment.

Note
  actually mainly used for table/spreadsheet cell, FULL is not yet implemented

Enumerator
HALIGN_LEFT |
HALIGN_RIGHT |
HALIGN_CENTER |
HALIGN_FULL |
HALIGN_DEFAULT |

## ◆ NumberType

enum MWAWCell::NumberType

the different number format of a cell's content

Enumerator
F_NUMBER_CURRENCY |
F_NUMBER_DECIMAL |
F_NUMBER_FRACTION |
F_NUMBER_GENERIC |
F_NUMBER_SCIENTIFIC |
F_NUMBER_PERCENT |
F_NUMBER_UNKNOWN |

## ◆ VerticalAlignment

enum MWAWCell::VerticalAlignment

the default vertical alignment.

Note
  actually mainly used for table/spreadsheet cell, not yet implemented

Enumerator
VALIGN_TOP |
VALIGN_CENTER |
VALIGN_BOTTOM |
VALIGN_DEFAULT |

## Constructor & Destructor Documentation

## ◆ MWAWCell()

MWAWCell::MWAWCell | ( |  | ) |
| inline

constructor

## ◆ ~MWAWCell()

virtual MWAWCell::~MWAWCell | ( |  | ) |
| inline virtual

destructor

## Member Function Documentation

## ◆ addTo()

void MWAWCell::addTo | ( | librevenge::RVNGPropertyList & | propList,
|  | shared_ptr< MWAWFontConverter > | fontConverter
| ) |  | const

adds to the propList

Referenced by MWAWSpreadsheetListener::openSheetCell(), MWAWTextListener::openTableCell(), MWAWPresentationListener::openTableCell(), MWAWGraphicListener::openTableCell(), MWAWSpreadsheetListener::openTableCell(), and ~MWAWCell().

## ◆ backgroundColor()

MWAWColor MWAWCell::backgroundColor | ( |  | ) | const
| inline

returns the background color

Referenced by addTo(), and BeagleWksSSParser::readCellSheet().

## ◆ bdBox()

MWAWBox2f const& MWAWCell::bdBox | ( |  | ) | const
| inline

bdbox accessor

Referenced by MWAWTableInternal::Compare::Point::getPos(), MWAWTableInternal::Compare::Point::getSize(), and MWAWTableInternal::Compare::operator()().

## ◆ bdSize()

MWAWVec2f const& MWAWCell::bdSize | ( |  | ) | const
| inline

bdbox size accessor

## ◆ borders()

std::vector<MWAWBorder> const& MWAWCell::borders | ( |  | ) | const
| inline

return the cell border: libmwaw::Left | ...

## ◆ extraLine()

ExtraLine MWAWCell::extraLine | ( |  | ) | const
| inline

returns the extra lines

Referenced by MWAWTable::sendExtraLines().

## ◆ extraLineType()

MWAWBorder const& MWAWCell::extraLineType | ( |  | ) | const
| inline

returns the extra line border

Referenced by MWAWTable::sendExtraLines().

## ◆ getBasicCellName()

std::string MWAWCell::getBasicCellName | ( | MWAWVec2i const & | pos | ) |
| static

return the name of a cell (given row and column) : 0,0 -> A1, 0,1 -> A2...

Referenced by RagTime5Spreadsheet::send(), GreatWksDBParser::sendDatabase(), BeagleWksDBParser::sendDatabase(), and setBdSize().

## ◆ getCellName()

std::string MWAWCell::getCellName | ( | MWAWVec2i const & | pos,
|  | MWAWVec2b const & | absolute
| ) |  |
| static

return the name of a cell (given row and column) : 0,0 -> [.A1], 0,1 -> [.A2]

Referenced by operator<<(), and setBdSize().

## ◆ getColumnName()

std::string MWAWCell::getColumnName | ( | int | col | ) |
| static

return the column name

Referenced by setBdSize().

## ◆ getFont()

MWAWFont MWAWCell::getFont | ( |  | ) | const
| inline

returns the font

Referenced by RagTimeSpreadsheet::send(), BeagleWksDBParser::sendDatabase(), MsWksDBParser::sendDatabase(), WingzParser::sendSpreadsheet(), BeagleWksSSParser::sendSpreadsheet(), and MsWksSSParser::sendSpreadsheet().

## ◆ getFormat()

Format const& MWAWCell::getFormat | ( |  | ) | const
| inline

returns the cell format

Referenced by MWAWSpreadsheetListener::openSheetCell(), MsWksDBParser::readDefaultValues(), GreatWksDBParser::readFormulaResult(), RagTimeSpreadsheet::readSpreadsheetCellContent(), RagTimeSpreadsheet::send(), RagTime5SpreadsheetInternal::CellValue::update(), RagTimeSpreadsheetInternal::CellFormat::update(), RagTime5StyleManager::updateCellFormat(), and BeagleWksDBParserInternal::Database::updateWithContent().

## ◆ hAlignment()

HorizontalAlignment MWAWCell::hAlignment | ( |  | ) | const
| inline

returns the horizontal alignment

Referenced by addTo().

## ◆ hasBorders()

bool MWAWCell::hasBorders | ( |  | ) | const
| inline

return true if the cell has some border

Referenced by MsWksSSParserInternal::Cell::isEmpty().

## ◆ hasExtraLine()

bool MWAWCell::hasExtraLine | ( |  | ) | const
| inline

returns true if we have some extra lines

Referenced by MWAWTable::sendExtraLines().

## ◆ isFontSet()

bool MWAWCell::isFontSet | ( |  | ) | const
| inline

returns true if the font has been set

Referenced by BeagleWksSSParser::sendSpreadsheet(), and MsWksSSParser::sendSpreadsheet().

## ◆ isProtected()

bool MWAWCell::isProtected | ( |  | ) | const
| inline

returns true if the cell is protected

Referenced by addTo().

## ◆ numSpannedCells()

MWAWVec2i const& MWAWCell::numSpannedCells | ( |  | ) | const
| inline

returns the number of spanned cells

Referenced by addTo(), and operator<<().

## ◆ position()

MWAWVec2i const& MWAWCell::position | ( |  | ) | const
| inline

position accessor

Referenced by BeagleWksSSParserInternal::Spreadsheet::addFormula(), addTo(), RagTimeSpreadsheetInternal::Spreadsheet::getRightBottomPosition(), BeagleWksSSParser::readCellSheet(), RagTimeSpreadsheet::readSpreadsheetCellContent(), RagTimeSpreadsheet::readSpreadsheetCellFormat(), RagTimeSpreadsheet::readSpreadsheetCellV2(), RagTimeSpreadsheet::send(), GreatWksDBParser::sendDatabase(), BeagleWksDBParser::sendDatabase(), GreatWksSSParser::sendSpreadsheet(), WingzParser::sendSpreadsheet(), BeagleWksSSParser::sendSpreadsheet(), MsWksSSParser::sendSpreadsheet(), WingzParserInternal::Spreadsheet::update(), and BeagleWksSSParserInternal::Spreadsheet::updateWidthCols().

## ◆ resetBorders()

void MWAWCell::resetBorders | ( |  | ) |
| inline

reset the border

## ◆ send()

bool MWAWCell::send | ( | MWAWListenerPtr | listener,
|  | MWAWTable & | table
| ) |  |
| virtual

function called when a cell is send by MWAWTable to send a cell to a listener.

By default: calls openTableCell(*this), sendContent and then closeTableCell()

Referenced by ~MWAWCell().

## ◆ sendContent()

bool MWAWCell::sendContent | ( | MWAWListenerPtr | listener,
|  | MWAWTable & | table
| ) |  |
| virtual

function called when the content of a cell must be send to the listener, ie.

when MWAWTable::sendTable or MWAWTable::sendAsText is called.

Note
  default behavior: does nothing and prints an error in debug mode.

Reimplemented in WriteNowTextInternal::Cell, MacWrtProStructuresInternal::Cell, HanMacWrdKGraphInternal::TableCell, HanMacWrdJGraphInternal::TableCell, and ClarisWksTableInternal::TableCell.

Referenced by BeagleWksSSParserInternal::Chart::Chart(), send(), and ~MWAWCell().

## ◆ setBackgroundColor()

void MWAWCell::setBackgroundColor | ( | MWAWColor | color | ) |
| inline

sets the background color

Referenced by BeagleWksSSParser::readCellSheet(), WingzParser::readSpreadsheetCellList(), RagTime5Spreadsheet::send(), GreatWksSSParser::sendSpreadsheet(), ClarisWksSpreadsheet::sendSpreadsheet(), MsWksTable::sendTable(), MsWrdText::sendTable(), MarinerWrtTextInternal::Paragraph::update(), RagTimeSpreadsheetInternal::CellExtra::update(), and WriteNowTextInternal::TableData::updateCell().

## ◆ setBdBox()

void MWAWCell::setBdBox | ( | MWAWBox2f | box | ) |
| inline

set the bdbox (unit point)

Referenced by WriteNowTextInternal::TableData::updateCell().

## ◆ setBdSize()

void MWAWCell::setBdSize | ( | MWAWVec2f | sz | ) |
| inline

set the bdbox size(unit point)

## ◆ setBorders()

void MWAWCell::setBorders | ( | int | wh,
|  | MWAWBorder const & | border
| ) |  |

sets the cell border: wh=libmwaw::LeftBit|...

Referenced by GreatWksSSParser::readCell(), MsWksSSParser::readCell(), BeagleWksSSParser::readCellSheet(), WingzParser::readSpreadsheetCellList(), RagTimeSpreadsheet::readSpreadsheetCellV2(), resetBorders(), RagTime5Spreadsheet::send(), ClarisWksSpreadsheet::sendSpreadsheet(), MsWksTable::sendTable(), FullWrtText::sendTable(), MsWrdText::sendTable(), MarinerWrtTextInternal::Paragraph::update(), RagTimeSpreadsheetInternal::CellBorder::update(), and WriteNowTextInternal::TableData::updateCell().

## ◆ setExtraLine()

void MWAWCell::setExtraLine | ( | ExtraLine | extrLine,
|  | MWAWBorder const & | type = `MWAWBorder()`
| ) |  |
| inline

sets the extraline

## ◆ setFont()

void MWAWCell::setFont | ( | MWAWFont const & | font,
|  | bool | isDefault = `false`
| ) |  |
| inline

sets the fonts

Referenced by MsWksSSParser::readCell(), BeagleWksSSParser::readCellSheet(), MsWksDBParser::readFieldTypes(), MsWksDBParser::readFieldTypesV2(), BeagleWksDBParser::readFormat(), RagTimeSpreadsheet::readSpreadsheetCellFormat(), WingzParser::readSpreadsheetCellList(), RagTimeSpreadsheet::readSpreadsheetCellV2(), RagTime5Spreadsheet::send(), GreatWksSSParser::sendSpreadsheet(), and ClarisWksSpreadsheet::sendSpreadsheet().

## ◆ setFormat()

void MWAWCell::setFormat | ( | Format const & | format | ) |
| inline

set the cell format

Referenced by GreatWksSSParser::readCell(), MsWksSSParser::readCell(), BeagleWksSSParser::readCellSheet(), GreatWksDBParser::readFieldRecords(), MsWksDBParser::readFieldTypes(), MsWksDBParser::readFieldTypesV2(), BeagleWksDBParser::readFormat(), GreatWksDBParser::readFormulaResult(), GreatWksDBParser::readRowRecords(), RagTimeSpreadsheet::readSpreadsheetCellContent(), WingzParser::readSpreadsheetCellList(), RagTimeSpreadsheet::readSpreadsheetCellV2(), ClarisWksDatabase::sendDatabase(), ClarisWksSpreadsheet::sendSpreadsheet(), RagTime5SpreadsheetInternal::CellValue::update(), RagTimeSpreadsheetInternal::CellFormat::update(), and RagTime5StyleManager::updateCellFormat().

## ◆ setHAlignment()

void MWAWCell::setHAlignment | ( | HorizontalAlignment | align | ) |
| inline

sets the horizontal alignment

Referenced by GreatWksSSParser::readCell(), MsWksSSParser::readCell(), BeagleWksSSParser::readCellSheet(), MsWksDBParser::readFieldTypes(), MsWksDBParser::readFieldTypesV2(), BeagleWksDBParser::readFormat(), WingzParser::readSpreadsheetCellList(), RagTimeSpreadsheet::readSpreadsheetCellV2(), RagTime5Spreadsheet::send(), ClarisWksDatabase::sendDatabase(), ClarisWksSpreadsheet::sendSpreadsheet(), and RagTimeSpreadsheetInternal::CellFormat::update().

## ◆ setNumSpannedCells()

void MWAWCell::setNumSpannedCells | ( | MWAWVec2i | numSpanned | ) |
| inline

sets the number of spanned cells : MWAWVec2i(1,1) means 1 cellule

Referenced by RagTime5Spreadsheet::send().

## ◆ setPosition()

void MWAWCell::setPosition | ( | MWAWVec2i | posi | ) |
| inline

set the cell positions : 0,0 -> A1, 0,1 -> A2

Referenced by BeagleWksSSParserInternal::Cell::Cell(), BeagleWksDBParserInternal::Cell::Cell(), GreatWksSSParser::readCell(), MsWksSSParser::readCell(), RagTimeSpreadsheet::readSpreadsheetCellsV2(), RagTimeSpreadsheet::readSpreadsheetComplexStructure(), RagTime5Spreadsheet::send(), GreatWksDBParser::sendDatabase(), ClarisWksDatabase::sendDatabase(), ClarisWksSpreadsheet::sendSpreadsheet(), ClarisWksSpreadsheet::sendSpreadsheetAsTable(), MsWksTable::sendTable(), MarinerWrtText::sendTable(), FullWrtText::sendTable(), MsWrdText::sendTable(), WriterPlsParser::sendWindow(), and BeagleWksDBParserInternal::Database::updateWithContent().

## ◆ setProtected()

void MWAWCell::setProtected | ( | bool | fl | ) |
| inline

sets the cell's protected flag

Referenced by GreatWksSSParser::readCell(), MsWksSSParser::readCell(), and RagTimeSpreadsheetInternal::CellFormat::update().

## ◆ setVAlignment()

void MWAWCell::setVAlignment | ( | VerticalAlignment | align | ) |
| inline

sets the vertical alignment

Referenced by RagTime5Spreadsheet::send(), and ClarisWksSpreadsheet::sendSpreadsheetAsTable().

## ◆ vAlignment()

VerticalAlignment MWAWCell::vAlignment | ( |  | ) | const
| inline

returns the vertical alignment

Referenced by addTo().

## Friends And Related Function Documentation

## ◆ operator<<

std::ostream& operator<< | ( | std::ostream & | o,
|  | MWAWCell const & | cell
| ) |  |
| friend

operator<<

## Member Data Documentation

## ◆ m_backgroundColor

MWAWColor MWAWCell::m_backgroundColor
| protected

the backgroung color

Referenced by backgroundColor(), operator<<(), and setBackgroundColor().

## ◆ m_bdBox

MWAWBox2f MWAWCell::m_bdBox
| protected

the cell bounding box (unit in point)

Referenced by bdBox(), operator<<(), and setBdBox().

## ◆ m_bdSize

MWAWVec2f MWAWCell::m_bdSize
| protected

the cell bounding size : unit point

Referenced by bdSize(), operator<<(), and setBdSize().

## ◆ m_bordersList

std::vector<MWAWBorder> MWAWCell::m_bordersList
| protected

the cell border MWAWBorder::Pos

Referenced by addTo(), borders(), hasBorders(), operator<<(), resetBorders(), and setBorders().

## ◆ m_extraLine

ExtraLine MWAWCell::m_extraLine
| protected

extra line

Referenced by extraLine(), hasExtraLine(), operator<<(), and setExtraLine().

## ◆ m_extraLineType

MWAWBorder MWAWCell::m_extraLineType
| protected

extra line type

Referenced by extraLineType(), hasExtraLine(), operator<<(), and setExtraLine().

## ◆ m_font

MWAWFont MWAWCell::m_font
| protected

the cell font

Referenced by addTo(), getFont(), and setFont().

## ◆ m_fontSet

bool MWAWCell::m_fontSet
| protected

a flag to know if the font has been set

Referenced by addTo(), isFontSet(), operator<<(), and setFont().

## ◆ m_format

Format MWAWCell::m_format
| protected

the cell format

Referenced by operator<<().

## ◆ m_hAlign

HorizontalAlignment MWAWCell::m_hAlign
| protected

the cell alignment : by default nothing

Referenced by hAlignment(), operator<<(), and setHAlignment().

## ◆ m_numberCellSpanned

MWAWVec2i MWAWCell::m_numberCellSpanned
| protected

the cell spanned : by default (1,1)

Referenced by numSpannedCells(), and setNumSpannedCells().

## ◆ m_position

MWAWVec2i MWAWCell::m_position
| protected

the cell row and column : 0,0 -> A1, 0,1 -> A2

Referenced by MWAWCellContent::FormulaInstruction::FormulaInstruction(), MWAWCellContent::FormulaInstruction::getPropertyList(), operator<<(), position(), and setPosition().

## ◆ m_protected

bool MWAWCell::m_protected
| protected

cell protected

Referenced by isProtected(), operator<<(), and setProtected().

## ◆ m_vAlign

VerticalAlignment MWAWCell::m_vAlign
| protected

the vertical cell alignment : by default nothing

Referenced by operator<<(), setVAlignment(), and vAlignment().

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

- MWAWCell.hxx
- MWAWCell.cxx