Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

ie_imp_table Class Reference

#include <ie_Table.h>

List of all members.

Public Member Functions

 ie_imp_table (PD_Document *pDoc)
virtual ~ie_imp_table (void)
UT_sint32 OpenCell (void)
UT_sint32 NewRow (void)
void setCellRowNthCell (UT_sint32 row, UT_sint32 col)
ie_imp_cellgetNthCellOnRow (UT_sint32 iCell) const
void setCellX (UT_sint32 cellx)
pf_Frag_StruxgetTableSDH (void) const
void setTableSDH (pf_Frag_Strux *cellSDH)
void writeTablePropsInDoc (void)
void writeAllCellPropsInDoc (void)
void setProp (const std::string &psProp, const std::string &psVal)
void setProp (const char *szProp, const char *szVal)
std::string getPropVal (const std::string &psProp) const
std::string getPropVal (const char *szProp) const
std::string getCellPropVal (const std::string &psProp) const
void setCellProp (const std::string &psProp, const std::string &psVal)
ie_imp_cellgetCurCell (void) const
void setNthCellOnThisRow (UT_sint32 iCell)
void buildTableStructure (void)
void setAutoFit (bool bVal)
bool isAutoFit (void) const
bool isNewRow (void) const
UT_sint32 getColNumber (ie_imp_cell *pImpCell) const
ie_imp_cellgetCellAtRowColX (UT_sint32 newRow, UT_sint32 cellX) const
void CloseCell (void)
bool wasTableUsed (void) const
void setCell (ie_imp_cell *pCell)
UT_sint32 getRow (void) const
void removeExtraneousCells (void)
void removeOnThisCellRow (ie_imp_cell *pCell)
void removeCurrentRow (void)
void deleteRow (UT_sint32 row)
UT_sint32 getNumRows (void) const
void setPosOnRow (UT_sint32 posOnRow)
UT_sint32 getPosOnRow (void) const
void setCellXOnRow (UT_sint32 cellxOnRow)
UT_sint32 getCellXOnRow (void) const
void incPosOnRow (void)
void incCellXOnRow (void)
bool getVecOfCellsOnRow (UT_sint32 row, UT_GenericVector< ie_imp_cell * > *pVec) const
bool removeRow (UT_sint32 row)
void appendRow (UT_GenericVector< ie_imp_cell * > *pVecRowOfCells)

Static Public Member Functions

static bool doCellXMatch (UT_sint32 iCellX1, UT_sint32 iCellX2, bool bIsLast=false)

Private Member Functions

void _buildCellXVector (void)
void _removeAllStruxes (void)

Private Attributes

UT_sint32 m_iRowCounter
std::string m_sTableProps
bool m_bAutoFit
bool m_bNewRow
bool m_bTableUsed
UT_sint32 m_iPosOnRow
UT_sint32 m_iCellXOnRow
UT_GenericVector< ie_imp_cell * > m_vecCells
UT_NumberVector m_vecCellX
UT_NumberVector m_vecSavedX

Constructor & Destructor Documentation

ie_imp_table::ie_imp_table ( PD_Document pDoc  ) 

Class for handling import of tables. Built for RTF but might be useful elsewhere.

References UT_GenericVector< T >::clear(), m_sTableProps, m_vecCells, and m_vecCellX.

ie_imp_table::~ie_imp_table ( void   )  [virtual]

Member Function Documentation

void ie_imp_table::_buildCellXVector ( void   )  [private]
void ie_imp_table::_removeAllStruxes ( void   )  [private]

This method removes all the struxes placed in the document. It is called if the table is never actually used.

References PD_Document::deleteStruxNoUpdate(), ie_imp_cell::getCellSDH(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), m_pDoc, m_tableSDH, m_vecCells, and UT_DEBUGMSG.

Referenced by ~ie_imp_table().

void ie_imp_table::appendRow ( UT_GenericVector< ie_imp_cell * > *  pVecRowOfCells  ) 

Append the row of cells given by the vector pVecRowOfCells to the current table, adjusting hte table pointer and row in the cell classes

References UT_GenericVector< T >::addItem(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), m_iRowCounter, m_vecCells, ie_imp_cell::setImpTable(), and ie_imp_cell::setRow().

Referenced by ie_imp_table_control::NewRow().

void ie_imp_table::buildTableStructure ( void   ) 
void ie_imp_table::CloseCell ( void   ) 
void ie_imp_table::deleteRow ( UT_sint32  row  ) 
bool ie_imp_table::doCellXMatch ( UT_sint32  iCellX1,
UT_sint32  iCellX2,
bool  bIsLast = false 
) [static]
ie_imp_cell * ie_imp_table::getCellAtRowColX ( UT_sint32  newRow,
UT_sint32  cellX 
) const
std::string ie_imp_table::getCellPropVal ( const std::string &  psProp  )  const

Return the value of a property of the current cell. This should be deleted when you've finished with it.

References ie_imp_cell::getPropVal(), m_pCurImpCell, and UT_return_val_if_fail.

UT_sint32 ie_imp_table::getCellXOnRow ( void   )  const [inline]
UT_sint32 ie_imp_table::getColNumber ( ie_imp_cell pImpCell  )  const
ie_imp_cell * ie_imp_table::getCurCell ( void   )  const

Return a pointer to the current cell

References m_pCurImpCell.

Referenced by IE_Imp_RTF::getCell().

ie_imp_cell * ie_imp_table::getNthCellOnRow ( UT_sint32  iCell  )  const

This method scans the vector of cell looking for the nth cell on the current row Return null if cell is not present.

References UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), ie_imp_cell::getRow(), m_iRowCounter, and m_vecCells.

Referenced by IE_Imp_RTF::HandleCell(), IE_Imp_RTF::HandleCellX(), and NewRow().

UT_sint32 ie_imp_table::getNumRows ( void   )  const
UT_sint32 ie_imp_table::getPosOnRow ( void   )  const [inline]
std::string ie_imp_table::getPropVal ( const char *  szProp  )  const

Return the value of a property of this table. This should be deleted when you've finished with it.

References m_sTableProps, and UT_std_string_getPropVal().

std::string ie_imp_table::getPropVal ( const std::string &  psProp  )  const

Return the value of a property of this table. This should be deleted when you've finished with it.

References m_sTableProps, and UT_std_string_getPropVal().

Referenced by writeTablePropsInDoc().

UT_sint32 ie_imp_table::getRow ( void   )  const [inline]
pf_Frag_Strux * ie_imp_table::getTableSDH ( void   )  const

Return this tables SDH

References m_tableSDH.

bool ie_imp_table::getVecOfCellsOnRow ( UT_sint32  row,
UT_GenericVector< ie_imp_cell * > *  pVec 
) const
void ie_imp_table::incCellXOnRow ( void   )  [inline]

Referenced by IE_Imp_RTF::HandleCellX().

void ie_imp_table::incPosOnRow ( void   )  [inline]

Referenced by IE_Imp_RTF::HandleCell().

bool ie_imp_table::isAutoFit ( void   )  const [inline]
bool ie_imp_table::isNewRow ( void   )  const [inline]
UT_sint32 ie_imp_table::NewRow ( void   ) 

Start a new row.

This returns -1 on error.
0 on Normal.
+1 if the row should be the first row of a new Table. (This is decided is the number cellx valus inthe row don't match.)

References _buildCellXVector(), UT_GenericVector< T >::clear(), ie_imp_cell::copyCell(), doCellXMatch(), ie_imp_cell::getCellX(), UT_GenericVector< T >::getItemCount(), getNthCellOnRow(), UT_GenericVector< T >::getNthItem(), getVecOfCellsOnRow(), m_bNewRow, m_iCellXOnRow, m_iPosOnRow, m_iRowCounter, m_pCurImpCell, m_vecCellX, and UT_DEBUGMSG.

Referenced by ie_imp_table_control::NewRow().

UT_sint32 ie_imp_table::OpenCell ( void   ) 
void ie_imp_table::removeCurrentRow ( void   ) 

This method removes the current row.

References deleteRow(), m_iRowCounter, and UT_DEBUGMSG.

Referenced by IE_Imp_RTF::HandleRow().

void ie_imp_table::removeExtraneousCells ( void   ) 
void ie_imp_table::removeOnThisCellRow ( ie_imp_cell pImpCell  ) 

This method removes all cells on the same row as this. Can happen if a document inserts a well defined row but puts in no 's

References deleteRow(), ie_imp_cell::getLeft(), ie_imp_cell::getRow(), ie_imp_cell::getTop(), and UT_DEBUGMSG.

bool ie_imp_table::removeRow ( UT_sint32  row  ) 

Remove all the cells in row identified by row from the table vector of cells. Do not delete the cell classes, they will be usde later.

References UT_GenericVector< T >::deleteNthItem(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), ie_imp_cell::getRow(), m_vecCells, and xxx_UT_DEBUGMSG.

Referenced by ie_imp_table_control::NewRow().

void ie_imp_table::setAutoFit ( bool  bVal  )  [inline]
void ie_imp_table::setCell ( ie_imp_cell pCell  )  [inline]

Referenced by IE_Imp_RTF::HandleCellX().

void ie_imp_table::setCellProp ( const std::string &  psProp,
const std::string &  psVal 

Set a property in the current cell properties string.

References m_pCurImpCell, ie_imp_cell::setProp(), and UT_return_if_fail.

void ie_imp_table::setCellRowNthCell ( UT_sint32  row,
UT_sint32  col 

Set the current cell to that at row row and at position col past the first cell on this row.

References UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), ie_imp_cell::getRow(), m_pCurImpCell, m_vecCells, UT_ASSERT_HARMLESS, and xxx_UT_DEBUGMSG.

Referenced by setNthCellOnThisRow().

void ie_imp_table::setCellX ( UT_sint32  cellx  ) 

Set this cell to have the cellx value given.

References m_pCurImpCell, ie_imp_cell::setCellX(), and UT_return_if_fail.

Referenced by IE_Imp_RTF::HandleCellX().

void ie_imp_table::setCellXOnRow ( UT_sint32  cellxOnRow  )  [inline]
void ie_imp_table::setNthCellOnThisRow ( UT_sint32  iCell  ) 

set the current cell to the nth (iCell) location on the current row.

References m_iRowCounter, and setCellRowNthCell().

Referenced by IE_Imp_RTF::HandleCell().

void ie_imp_table::setPosOnRow ( UT_sint32  posOnRow  )  [inline]

Referenced by IE_Imp_RTF::HandleCell().

void ie_imp_table::setProp ( const std::string &  psProp,
const std::string &  psVal 

Set a property in the table properties string.

References m_sTableProps, and UT_std_string_setProperty().

Referenced by IE_Imp_RTF::TranslateKeywordID(), and writeTablePropsInDoc().

void ie_imp_table::setProp ( const char *  szProp,
const char *  szVal 

Set a property in the table properties string.

References m_sTableProps, and UT_std_string_setProperty().

void ie_imp_table::setTableSDH ( pf_Frag_Strux sdh  ) 

Set the SDH for this table

References m_tableSDH, and xxx_UT_DEBUGMSG.

Referenced by ie_imp_table_control::NewRow(), and IE_Imp_RTF::OpenTable().

bool ie_imp_table::wasTableUsed ( void   )  const [inline]
void ie_imp_table::writeAllCellPropsInDoc ( void   ) 
void ie_imp_table::writeTablePropsInDoc ( void   ) 

Member Data Documentation

bool ie_imp_table::m_bAutoFit [private]

Referenced by writeTablePropsInDoc().

bool ie_imp_table::m_bNewRow [private]

Referenced by deleteRow(), NewRow(), and OpenCell().

Referenced by CloseCell(), deleteRow(), and ~ie_imp_table().

Referenced by deleteRow(), and NewRow().

Referenced by deleteRow(), and NewRow().

std::string ie_imp_table::m_sTableProps [private]

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