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 More...
 
virtual ~MWAWCellContent ()
 
Content content () const
 returns the content type More...
 
void setContent (Content type)
 set the content type More...
 
void setValue (double val)
 sets the double value More...
 
double value () const
 return the double value More...
 
bool isValueSet () const
 returns true if the value has been setted More...
 
void setText (std::string const val)
 sets the text value More...
 
std::string const & text () const
 returns the text value More...
 
bool hasText () const
 returns true if the text is set More...
 
bool isTextSet () const
 returns true if the text has been setted More...
 
void setFormula (std::string const val)
 sets the formula value More...
 
std::string const & formula () const
 returns the formula value More...
 
bool empty () const
 returns true if the cell has no content More...
 
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. More...
 

Static Public Member Functions

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

Protected Attributes

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

Friends

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

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 Tue Apr 30 2013 06:16:20 for libmwaw by doxygen 1.8.3.1