MWAWCellContent Class Reference

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

#include <MWAWCell.hxx>

Public Types

enum  Content {
  C_NONE, C_TEXT, C_NUMBER, C_FORMULA,
  C_UNKNOWN
}
 the different types of cell's field More...

Public Member Functions

 MWAWCellContent ()
 the constructor
virtual ~MWAWCellContent ()
Content content () const
 returns the content type
void setContent (Content type)
 set the content type
void setValue (double val)
 sets the double value
double value () const
 return the double value
bool isValueSet () const
 returns true if the value has been setted
void setText (std::string const &val)
 sets the text value
std::string const & text () const
 returns the text value
bool hasText () const
 returns true if the text is set
bool isTextSet () const
 returns true if the text has been setted
void setFormula (std::string const &val)
 sets the formula value
std::string const & formula () const
 returns the formula value
bool empty () const
 returns true if the cell has no content
bool getDataCellProperty (MWAWCellFormat::Format format, WPXPropertyList &property, std::string &text) const
 If the content is a data cell, filled property and returns in text, a string which can be used as text.

Static Public Member Functions

static bool double2Date (double val, int &Y, int &M, int &D)
 conversion beetween double days since 1900 and date
static bool double2Time (double val, int &H, int &M, int &S)
 conversion beetween double: second since 0:00 and time

Protected Attributes

Content m_contentType
 the content type ( by default unknown )
double m_value
 the cell value
bool m_valueSet
 true if the value has been set
std::string m_textValue
 the cell string
bool m_textValueSet
 true if the text value has been set
std::string m_formulaValue
 the formula string

Friends

std::ostream & operator<< (std::ostream &o, MWAWCellContent const &cell)
 operator<<

Detailed Description

a structure used to defined the cell content

Member Enumeration Documentation

the different types of cell's field

Enumerator:
C_NONE 
C_TEXT 
C_NUMBER 
C_FORMULA 
C_UNKNOWN 

Constructor & Destructor Documentation

MWAWCellContent::MWAWCellContent ( )
inline

the constructor

virtual MWAWCellContent::~MWAWCellContent ( )
inlinevirtual

Member Function Documentation

Content MWAWCellContent::content ( ) const
inline

returns the content type

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

bool MWAWCellContent::double2Date ( double  val,
int &  Y,
int &  M,
int &  D 
)
static

conversion beetween double days since 1900 and date

Referenced by getDataCellProperty().

bool MWAWCellContent::double2Time ( double  val,
int &  H,
int &  M,
int &  S 
)
static

conversion beetween double: second since 0:00 and time

Referenced by getDataCellProperty().

bool MWAWCellContent::empty ( ) const
inline

returns true if the cell has no content

std::string const& MWAWCellContent::formula ( ) const
inline

returns the formula value

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

bool MWAWCellContent::getDataCellProperty ( MWAWCellFormat::Format  format,
WPXPropertyList &  property,
std::string &  text 
) const

If the content is a data cell, filled property and returns in text, a string which can be used as text.

Note
- if not, property and text will be empty.
  • if ok, adds in property office:value-type, office:[|date-|time-]value and table:formula if neeed
bool MWAWCellContent::hasText ( ) const
inline

returns true if the text is set

bool MWAWCellContent::isTextSet ( ) const
inline

returns true if the text has been setted

Referenced by operator<<().

bool MWAWCellContent::isValueSet ( ) const
inline

returns true if the value has been setted

Referenced by empty(), getDataCellProperty(), and operator<<().

void MWAWCellContent::setContent ( Content  type)
inline

set the content type

void MWAWCellContent::setFormula ( std::string const &  val)
inline

sets the formula value

void MWAWCellContent::setText ( std::string const &  val)
inline

sets the text value

void MWAWCellContent::setValue ( double  val)
inline

sets the double value

std::string const& MWAWCellContent::text ( ) const
inline

returns the text value

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

double MWAWCellContent::value ( ) const
inline

return the double value

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

Friends And Related Function Documentation

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

operator<<

Member Data Documentation

Content MWAWCellContent::m_contentType
protected

the content type ( by default unknown )

Referenced by content(), empty(), and setContent().

std::string MWAWCellContent::m_formulaValue
protected

the formula string

Referenced by empty(), formula(), and setFormula().

std::string MWAWCellContent::m_textValue
protected

the cell string

Referenced by empty(), hasText(), setText(), and text().

bool MWAWCellContent::m_textValueSet
protected

true if the text value has been set

Referenced by isTextSet(), and setText().

double MWAWCellContent::m_value
protected

the cell value

Referenced by setValue(), and value().

bool MWAWCellContent::m_valueSet
protected

true if the value has been set

Referenced by isValueSet(), and setValue().


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

Generated on Wed May 22 2013 18:12:45 for libmwaw by doxygen 1.8.1.2