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

a structure used to defined the cell format More...

`#include <WPSCell.h>`

Inheritance diagram for WPSCellFormat:

## Classes
struct | CompareFormat
| a comparaison structure used to store data More...

## Public Types
enum | HorizontalAlignment { HALIGN_LEFT, HALIGN_RIGHT, HALIGN_CENTER, HALIGN_FULL, HALIGN_DEFAULT }
| the default horizontal alignement. More...
enum | VerticalAlignment { VALIGN_TOP, VALIGN_CENTER, VALIGN_BOTTOM, VALIGN_DEFAULT }
| the default vertical alignement. More...
enum | Wrapping { WRAP_WRAP, WRAP_NO_WRAP, WRAP_DEFAULT }
| the wrapping More...
enum | FormatType { F_TEXT, F_BOOLEAN, F_NUMBER, F_DATE, F_TIME, F_UNKNOWN }
| the different types of cell's field More...

## Public Member Functions
| WPSCellFormat ()
| constructor More...
| WPSCellFormat (WPSCellFormat const &)=default
WPSCellFormat & | operator= (WPSCellFormat const &)=default
virtual | ~WPSCellFormat ()
| destructor More...
bool | hasBasicFormat () const
| returns true if this is a basic format style More...
std::string | getValueType () const
| returns a value type More...
void | addTo (librevenge::RVNGPropertyList &propList) const
| add to the propList More...
bool | getNumberingProperties (librevenge::RVNGPropertyList &propList) const
| get the number style More...
WPSFont const & | getFont () const
| returns the font More...
void | setFont (WPSFont const &font)
| sets the font More...
HorizontalAlignment | hAlignment () const
| returns the horizontal alignement More...
void | setHAlignment (HorizontalAlignment align)
| sets the horizontal alignement More...
VerticalAlignment | vAlignment () const
| returns the vertical alignement More...
void | setVAlignment (VerticalAlignment align)
| sets the vertical alignement More...
Wrapping | wrapping () const
| returns the wrapping More...
void | setWrapping (Wrapping align)
| sets the wrapping More...
int | getTextRotation () const
| returns the text rotation angle More...
void | setTextRotation (int rotation)
| sets the text rotation angle More...
FormatType | getFormat () const
| returns the format type More...
int | getSubFormat () const
| returns the subformat type More...
std::string | getDTFormat () const
| returns the date/time format ( if set) More...
void | setFormat (FormatType form, int subForm=0)
| sets the format type More...
void | setDTFormat (FormatType form, std::string const &dtFormat="")
| sets the format type More...
int | digits () const
| returns the number of digits ( for a number) More...
void | setDigits (int newDigit)
| set the number of digits ( for a number) More...
bool | isProtected () const
| returns true if the cell is protected More...
void | setProtected (bool fl)
| returns true if the cell is protected More...
bool | hasBorders () const
| return true if the cell has some border More...
std::vector< WPSBorder > const & | borders () const
| return the cell border: libwps::LeftBit | ... More...
void | resetBorders ()
| reset the border More...
void | setBorders (int wh, WPSBorder const &border)
| sets the cell border: wh=WPSBorder::LeftBit|... More...
void | setBorders (std::vector< WPSBorder > const &newBorders)
| sets the cell borders More...
WPSColor | backgroundColor () const
| returns the background color More...
void | setBackgroundColor (WPSColor const &color)
| set the background color More...
int | compare (WPSCellFormat const &cell, bool onlyNumbering=false) const
| a comparison function More...

## Static Protected Member Functions
static bool | convertDTFormat (std::string const &dtFormat, librevenge::RVNGPropertyListVector &propListVector)
| convert a DTFormat in a propertyList More...

## Protected Attributes
WPSFont | m_font
| the cell font ( used in spreadsheet code ) More...
HorizontalAlignment | m_hAlign
| the cell alignement : by default nothing More...
VerticalAlignment | m_vAlign
| the cell vertical alignement : by default nothing More...
Wrapping | m_wrapping
| the wrapping : by default nothing More...
int | m_rotation
| the text rotation More...
std::vector< WPSBorder > | m_bordersList
| the cell border WPSBorder::Pos More...
FormatType | m_format
| the cell format : by default unknown More...
int | m_subFormat
| the sub format More...
std::string | m_DTFormat
| a date/time format ( using a subset of strftime format ) More...
int | m_digits
| the number of digits More...
bool | m_protected
| cell protected More...
WPSColor | m_backgroundColor
| the backgroung color More...

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

## Detailed Description

a structure used to defined the cell format

## Member Enumeration Documentation

## ◆ FormatType

enum WPSCellFormat::FormatType

the different types of cell's field

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

## ◆ HorizontalAlignment

enum WPSCellFormat::HorizontalAlignment

the default horizontal alignement.

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

Enumerator
HALIGN_LEFT |
HALIGN_RIGHT |
HALIGN_CENTER |
HALIGN_FULL |
HALIGN_DEFAULT |

## ◆ VerticalAlignment

enum WPSCellFormat::VerticalAlignment

the default vertical alignement.

Enumerator
VALIGN_TOP |
VALIGN_CENTER |
VALIGN_BOTTOM |
VALIGN_DEFAULT |

## ◆ Wrapping

enum WPSCellFormat::Wrapping

the wrapping

Enumerator
WRAP_WRAP |
WRAP_NO_WRAP |
WRAP_DEFAULT |

## Constructor & Destructor Documentation

## ◆ WPSCellFormat() [1/2]

WPSCellFormat::WPSCellFormat | ( |  | ) |
| inline

constructor

## ◆ WPSCellFormat() [2/2]

WPSCellFormat::WPSCellFormat | ( | WPSCellFormat const & |  | ) |
| default

## ◆ ~WPSCellFormat()

WPSCellFormat::~WPSCellFormat | ( |  | ) |
| virtual

destructor

## Member Function Documentation

## ◆ addTo()

void WPSCellFormat::addTo | ( | librevenge::RVNGPropertyList & | propList | ) | const

add to the propList

Referenced by WPSCell::addTo().

## ◆ backgroundColor()

WPSColor WPSCellFormat::backgroundColor | ( |  | ) | const
| inline

returns the background color

Referenced by addTo(), and QuattroDosSpreadsheet::readCell().

## ◆ borders()

std::vector<WPSBorder> const& WPSCellFormat::borders | ( |  | ) | const
| inline

return the cell border: libwps::LeftBit | ...

Referenced by QuattroDosSpreadsheet::readCell().

## ◆ compare()

int WPSCellFormat::compare | ( | WPSCellFormat const & | cell,
|  | bool | onlyNumbering = `false`
| ) |  | const

a comparison function

Referenced by WPSCellFormat::CompareFormat::operator()(), QuattroDosSpreadsheetInternal::Style::operator==(), WKS4SpreadsheetInternal::Style::operator==(), QuattroSpreadsheetInternal::Style::operator==(), Quattro9SpreadsheetInternal::Style::operator==(), LotusSpreadsheetInternal::Style::operator==(), and LotusSpreadsheetInternal::Format123Style::operator==().

## ◆ convertDTFormat()

bool WPSCellFormat::convertDTFormat | ( | std::string const & | dtFormat,
|  | librevenge::RVNGPropertyListVector & | propListVector
| ) |  |
| static protected

convert a DTFormat in a propertyList

Referenced by getNumberingProperties().

## ◆ digits()

int WPSCellFormat::digits | ( |  | ) | const
| inline

returns the number of digits ( for a number)

Referenced by LotusSpreadsheetInternal::Format123Style::update().

## ◆ getDTFormat()

std::string WPSCellFormat::getDTFormat | ( |  | ) | const
| inline

returns the date/time format ( if set)

Referenced by operator<<(), and LotusSpreadsheetInternal::Format123Style::update().

## ◆ getFont()

WPSFont const& WPSCellFormat::getFont | ( |  | ) | const
| inline

returns the font

Referenced by WKSContentListener::openSheetCell(), QuattroDosSpreadsheet::readCell(), libwps::MultiplanParser::sendCell(), QuattroDosSpreadsheet::sendCellContent(), QuattroSpreadsheet::sendCellContent(), LotusSpreadsheet::sendCellContent(), LotusSpreadsheet::sendText(), LotusSpreadsheetInternal::ExtraStyle::update(), and Quattro9SpreadsheetInternal::Cell::updateFormat().

## ◆ getFormat()

FormatType WPSCellFormat::getFormat | ( |  | ) | const
| inline

returns the format type

Referenced by WKSContentListener::openSheetCell(), and LotusSpreadsheetInternal::Format123Style::update().

## ◆ getNumberingProperties()

bool WPSCellFormat::getNumberingProperties | ( | librevenge::RVNGPropertyList & | propList | ) | const

get the number style

Referenced by WKSContentListener::openSheetCell().

## ◆ getSubFormat()

int WPSCellFormat::getSubFormat | ( |  | ) | const
| inline

returns the subformat type

Referenced by LotusSpreadsheetInternal::Format123Style::update().

## ◆ getTextRotation()

int WPSCellFormat::getTextRotation | ( |  | ) | const
| inline

returns the text rotation angle

## ◆ getValueType()

std::string WPSCellFormat::getValueType | ( |  | ) | const

returns a value type

Referenced by WKSContentListener::openSheetCell().

## ◆ hAlignment()

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

returns the horizontal alignement

## ◆ hasBasicFormat()

bool WPSCellFormat::hasBasicFormat | ( |  | ) | const
| inline

returns true if this is a basic format style

Referenced by WKSContentListener::openSheetCell().

## ◆ hasBorders()

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

return true if the cell has some border

Referenced by QuattroDosSpreadsheet::readCell().

## ◆ isProtected()

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

returns true if the cell is protected

## ◆ operator=()

WPSCellFormat& WPSCellFormat::operator= | ( | WPSCellFormat const & |  | ) |
| default

## ◆ resetBorders()

void WPSCellFormat::resetBorders | ( |  | ) |
| inline

reset the border

## ◆ setBackgroundColor()

void WPSCellFormat::setBackgroundColor | ( | WPSColor const & | color | ) |
| inline

set the background color

Referenced by LotusSpreadsheetInternal::ExtraStyle::update(), and LotusStyleManager::updateCellStyle().

## ◆ setBorders() [1/2]

void WPSCellFormat::setBorders | ( | int | wh,
|  | WPSBorder const & | border
| ) |  |

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

Referenced by LotusSpreadsheetInternal::ExtraStyle::update(), LotusSpreadsheetInternal::Extra123Style::update(), and LotusStyleManager::updateCellStyle().

## ◆ setBorders() [2/2]

void WPSCellFormat::setBorders | ( | std::vector< WPSBorder > const & | newBorders | ) |
| inline

sets the cell borders

## ◆ setDigits()

void WPSCellFormat::setDigits | ( | int | newDigit | ) |
| inline

set the number of digits ( for a number)

Referenced by LotusSpreadsheet::readCellsFormat801(), LotusSpreadsheet::readRowFormat(), libwps::MultiplanParser::sendCell(), QuattroSpreadsheet::updateCellWithUserFormat(), Quattro9SpreadsheetInternal::Cell::updateFormat(), QuattroSpreadsheetInternal::Cell::updateFormat(), and QuattroDosSpreadsheetInternal::Cell::updateFormat().

## ◆ setDTFormat()

void WPSCellFormat::setDTFormat | ( | FormatType | form,
|  | std::string const & | dtFormat = `""`
| ) |  |
| inline

sets the format type

Referenced by LotusSpreadsheet::readCellsFormat801(), LotusSpreadsheet::readRowFormat(), libwps::MultiplanParser::sendCell(), QuattroSpreadsheet::updateCellWithUserFormat(), Quattro9SpreadsheetInternal::Cell::updateFormat(), QuattroSpreadsheetInternal::Cell::updateFormat(), and QuattroDosSpreadsheetInternal::Cell::updateFormat().

## ◆ setFont()

void WPSCellFormat::setFont | ( | WPSFont const & | font | ) |
| inline

sets the font

Referenced by LotusSpreadsheet::readRowFormat(), libwps::MultiplanParser::sendCell(), Quattro9Spreadsheet::sendCellContent(), LotusSpreadsheet::sendRowContent(), LotusSpreadsheetInternal::ExtraStyle::update(), LotusStyleManager::updateCellStyle(), and Quattro9SpreadsheetInternal::Cell::updateFormat().

## ◆ setFormat()

void WPSCellFormat::setFormat | ( | FormatType | form,
|  | int | subForm = `0`
| ) |  |
| inline

sets the format type

Referenced by LotusSpreadsheet::readCellsFormat801(), LotusSpreadsheet::readRowFormat(), libwps::MultiplanParser::sendCell(), QuattroSpreadsheet::updateCellWithUserFormat(), Quattro9SpreadsheetInternal::Cell::updateFormat(), QuattroSpreadsheetInternal::Cell::updateFormat(), and QuattroDosSpreadsheetInternal::Cell::updateFormat().

## ◆ setHAlignment()

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

sets the horizontal alignement

Referenced by LotusSpreadsheet::readRowFormat(), libwps::MultiplanParser::sendCell(), LotusSpreadsheet::sendCellContent(), and LotusStyleManager::updateCellStyle().

## ◆ setProtected()

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

returns true if the cell is protected

Referenced by libwps::MultiplanParser::sendCell().

## ◆ setTextRotation()

void WPSCellFormat::setTextRotation | ( | int | rotation | ) |
| inline

sets the text rotation angle

Referenced by LotusStyleManager::updateCellStyle().

## ◆ setVAlignment()

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

sets the vertical alignement

Referenced by LotusStyleManager::updateCellStyle().

## ◆ setWrapping()

void WPSCellFormat::setWrapping | ( | Wrapping | align | ) |
| inline

sets the wrapping

Referenced by LotusStyleManager::updateCellStyle().

## ◆ vAlignment()

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

returns the vertical alignement

Referenced by addTo().

## ◆ wrapping()

Wrapping WPSCellFormat::wrapping | ( |  | ) | const
| inline

returns the wrapping

Referenced by addTo().

## Friends And Related Function Documentation

## ◆ operator<<

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

operator<<

## Member Data Documentation

## ◆ m_backgroundColor

WPSColor WPSCellFormat::m_backgroundColor
| protected

the backgroung color

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

## ◆ m_bordersList

std::vector<WPSBorder> WPSCellFormat::m_bordersList
| protected

the cell border WPSBorder::Pos

Referenced by addTo(), borders(), WPS8TableInternal::Cell::Cell(), compare(), hasBorders(), operator<<(), resetBorders(), and setBorders().

## ◆ m_digits

int WPSCellFormat::m_digits
| protected

the number of digits

Referenced by compare(), digits(), getNumberingProperties(), operator<<(), WKS4SpreadsheetInternal::Style::operator==(), and setDigits().

## ◆ m_DTFormat

std::string WPSCellFormat::m_DTFormat
| protected

a date/time format ( using a subset of strftime format )

Referenced by compare(), getDTFormat(), getNumberingProperties(), and setDTFormat().

## ◆ m_font

WPSFont WPSCellFormat::m_font
| protected

the cell font ( used in spreadsheet code )

Referenced by getFont(), operator<<(), setFont(), LotusSpreadsheetInternal::Style::Style(), QuattroSpreadsheetInternal::Cell::updateFormat(), and QuattroDosSpreadsheetInternal::Cell::updateFormat().

## ◆ m_format

FormatType WPSCellFormat::m_format
| protected

the cell format : by default unknown

Referenced by compare(), getFormat(), getNumberingProperties(), getValueType(), hasBasicFormat(), operator<<(), WKS4SpreadsheetInternal::Style::operator==(), setDTFormat(), and setFormat().

## ◆ m_hAlign

HorizontalAlignment WPSCellFormat::m_hAlign
| protected

the cell alignement : by default nothing

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

## ◆ m_protected

bool WPSCellFormat::m_protected
| protected

cell protected

Referenced by addTo(), compare(), isProtected(), operator<<(), WKS4SpreadsheetInternal::Style::operator==(), and setProtected().

## ◆ m_rotation

int WPSCellFormat::m_rotation
| protected

the text rotation

Referenced by addTo(), compare(), getTextRotation(), operator<<(), and setTextRotation().

## ◆ m_subFormat

int WPSCellFormat::m_subFormat
| protected

the sub format

Referenced by compare(), getNumberingProperties(), getSubFormat(), getValueType(), operator<<(), WKS4SpreadsheetInternal::Style::operator==(), setDTFormat(), and setFormat().

## ◆ m_vAlign

VerticalAlignment WPSCellFormat::m_vAlign
| protected

the cell vertical alignement : by default nothing

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

## ◆ m_wrapping

Wrapping WPSCellFormat::m_wrapping
| protected

the wrapping : by default nothing

Referenced by compare(), operator<<(), setWrapping(), and wrapping().

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

- WPSCell.h
- WPSCell.cpp