STOFFTable Class Reference

a class used to recreate the table structure using cell informations, .... More...

#include <STOFFTable.hxx>

Inheritance diagram for STOFFTable:
StarObjectSpreadsheetInternal::Table

Public Types

enum  DataSet {
  CellPositionBit =1, BoxBit =2, SizeBit =4, TableDimBit =8,
  TablePosToCellBit =0x10
}
 an enum used to indicate what the list of entries which are filled More...
 
enum  Alignment { Paragraph, Left, Center, Right }
 an enum do define the table alignment. More...
 

Public Member Functions

 STOFFTable (uint32_t givenData=BoxBit)
 the constructor More...
 
virtual ~STOFFTable ()
 the destructor More...
 
void add (shared_ptr< STOFFCell > cell)
 add a new cells More...
 
bool mergeBorders () const
 returns true if we need to merge borders More...
 
bool setMergeBorders (bool val)
 sets the merge borders' value More...
 
void setAlignment (Alignment align, float leftMargin=0, float rightMargin=0)
 defines the current alignment More...
 
int numCells () const
 returns the number of cell More...
 
std::vector< float > const & getRowsSize () const
 returns the row size if defined (in point) More...
 
void setRowsSize (std::vector< float > const &rSize)
 define the row size (in point) More...
 
std::vector< float > const & getColsSize () const
 returns the columns size if defined (in point) More...
 
void setColsSize (std::vector< float > const &cSize)
 define the columns size (in point) More...
 
shared_ptr< STOFFCellget (int id)
 returns the i^th cell More...
 
bool updateTable ()
 try to build the table structures More...
 
bool sendTable (STOFFListenerPtr listener)
 try to send the table More...
 
bool sendAsText (STOFFListenerPtr listener)
 try to send the table as basic text More...
 
void addTablePropertiesTo (librevenge::RVNGPropertyList &propList) const
 adds the table properties to propList More...
 

Protected Member Functions

int getCellIdPos (int col, int row) const
 convert a cell position in a posToCellId's position More...
 
bool buildStructures ()
 create the correspondance list, ... More...
 
bool buildDims ()
 compute the rows and the cells size More...
 
bool buildPosToCellId ()
 a function which fills to posToCellId vector using the cell position More...
 

Protected Attributes

uint32_t m_givenData
 a int to indicate what data are given in entries More...
 
uint32_t m_setData
 a int to indicate what data are been reconstruct More...
 
bool m_mergeBorders
 do we need to merge cell borders ( default yes) More...
 
std::vector< shared_ptr
< STOFFCell > > 
m_cellsList
 the list of cells More...
 
size_t m_numRows
 the number of rows ( set by buildPosToCellId ) More...
 
size_t m_numCols
 the number of cols ( set by buildPosToCellId ) More...
 
std::vector< float > m_rowsSize
 the final row size (in point) More...
 
std::vector< float > m_colsSize
 the final col size (in point) More...
 
Alignment m_alignment
 the table alignment More...
 
float m_leftMargin
 the left margin in point More...
 
float m_rightMargin
 the right margin in point More...
 
std::vector< int > m_posToCellId
 a vector used to store an id corresponding to each cell More...
 

Detailed Description

a class used to recreate the table structure using cell informations, ....

Member Enumeration Documentation

an enum do define the table alignment.

Note
Paragraph means using the default alignment, left page alignment and use left margin
Enumerator
Paragraph 
Left 
Center 
Right 

an enum used to indicate what the list of entries which are filled

Enumerator
CellPositionBit 
BoxBit 
SizeBit 
TableDimBit 
TablePosToCellBit 

Constructor & Destructor Documentation

STOFFTable::STOFFTable ( uint32_t  givenData = BoxBit)
inlineexplicit

the constructor

STOFFTable::~STOFFTable ( )
virtual

the destructor

Member Function Documentation

void STOFFTable::add ( shared_ptr< STOFFCell cell)
inline

add a new cells

void STOFFTable::addTablePropertiesTo ( librevenge::RVNGPropertyList &  propList) const
bool STOFFTable::buildDims ( )
protected

compute the rows and the cells size

Referenced by updateTable().

bool STOFFTable::buildPosToCellId ( )
protected

a function which fills to posToCellId vector using the cell position

Referenced by updateTable().

bool STOFFTable::buildStructures ( )
protected

create the correspondance list, ...

Referenced by updateTable().

shared_ptr< STOFFCell > STOFFTable::get ( int  id)

returns the i^th cell

int STOFFTable::getCellIdPos ( int  col,
int  row 
) const
inlineprotected

convert a cell position in a posToCellId's position

Referenced by buildDims(), buildPosToCellId(), and sendTable().

std::vector<float> const& STOFFTable::getColsSize ( ) const
inline

returns the columns size if defined (in point)

std::vector<float> const& STOFFTable::getRowsSize ( ) const
inline

returns the row size if defined (in point)

bool STOFFTable::mergeBorders ( ) const
inline

returns true if we need to merge borders

Referenced by addTablePropertiesTo().

int STOFFTable::numCells ( ) const
inline

returns the number of cell

bool STOFFTable::sendAsText ( STOFFListenerPtr  listener)

try to send the table as basic text

bool STOFFTable::sendTable ( STOFFListenerPtr  listener)

try to send the table

Note: either send the table ( and returns true ) or do nothing.

Referenced by STOFFGraphicListener::insertTable(), and STOFFSpreadsheetListener::insertTable().

void STOFFTable::setAlignment ( Alignment  align,
float  leftMargin = 0,
float  rightMargin = 0 
)
inline

defines the current alignment

Note
: leftMargin,rightMargin are given in Points
void STOFFTable::setColsSize ( std::vector< float > const &  cSize)
inline

define the columns size (in point)

Referenced by StarTable::send().

bool STOFFTable::setMergeBorders ( bool  val)
inline

sets the merge borders' value

void STOFFTable::setRowsSize ( std::vector< float > const &  rSize)
inline

define the row size (in point)

bool STOFFTable::updateTable ( )

try to build the table structures

Referenced by sendTable().

Member Data Documentation

Alignment STOFFTable::m_alignment
protected

the table alignment

Referenced by addTablePropertiesTo(), and setAlignment().

std::vector<shared_ptr<STOFFCell> > STOFFTable::m_cellsList
protected
std::vector<float> STOFFTable::m_colsSize
protected
uint32_t STOFFTable::m_givenData
protected

a int to indicate what data are given in entries

Referenced by updateTable().

float STOFFTable::m_leftMargin
protected

the left margin in point

Referenced by addTablePropertiesTo(), and setAlignment().

bool STOFFTable::m_mergeBorders
protected

do we need to merge cell borders ( default yes)

Referenced by mergeBorders(), and setMergeBorders().

size_t STOFFTable::m_numCols
protected

the number of cols ( set by buildPosToCellId )

Referenced by buildDims(), buildPosToCellId(), getCellIdPos(), sendTable(), and updateTable().

size_t STOFFTable::m_numRows
protected

the number of rows ( set by buildPosToCellId )

Referenced by buildDims(), buildPosToCellId(), getCellIdPos(), sendTable(), and updateTable().

std::vector<int> STOFFTable::m_posToCellId
protected

a vector used to store an id corresponding to each cell

Referenced by buildDims(), buildPosToCellId(), and sendTable().

float STOFFTable::m_rightMargin
protected

the right margin in point

Referenced by addTablePropertiesTo(), and setAlignment().

std::vector<float> STOFFTable::m_rowsSize
protected

the final row size (in point)

Referenced by buildDims(), buildPosToCellId(), buildStructures(), getRowsSize(), sendTable(), and setRowsSize().

uint32_t STOFFTable::m_setData
protected

a int to indicate what data are been reconstruct

Referenced by buildDims(), buildPosToCellId(), buildStructures(), and updateTable().


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

Generated on Tue Aug 30 2016 20:45:07 for libstaroffice by doxygen 1.8.8