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)
void setCellX (UT_sint32 cellx)
pf_Frag_StruxgetTableSDH (void)
void setTableSDH (pf_Frag_Strux *cellSDH)
void writeTablePropsInDoc (void)
void writeAllCellPropsInDoc (void)
void setProp (const UT_String &psProp, const UT_String &psVal)
void setProp (const char *szProp, const char *szVal)
UT_String getPropVal (const UT_String &psProp)
UT_String getPropVal (const char *szProp)
UT_String getCellPropVal (const UT_String &psProp)
void setCellProp (const UT_String &psProp, const UT_String &psVal)
ie_imp_cellgetCurCell (void)
void setNthCellOnThisRow (UT_sint32 iCell)
void buildTableStructure (void)
void setAutoFit (bool bVal)
bool isAutoFit (void)
bool isNewRow (void)
UT_sint32 getColNumber (ie_imp_cell *pImpCell)
ie_imp_cellgetCellAtRowColX (UT_sint32 newRow, UT_sint32 cellX)
void CloseCell (void)
bool wasTableUsed (void)
void setCell (ie_imp_cell *pCell)
UT_sint32 getRow (void)
void removeExtraneousCells (void)
void removeOnThisCellRow (ie_imp_cell *pCell)
void removeCurrentRow (void)
void deleteRow (UT_sint32 row)
UT_sint32 getNumRows (void)
void setPosOnRow (UT_sint32 posOnRow)
UT_sint32 getPosOnRow (void)
void setCellXOnRow (UT_sint32 cellxOnRow)
UT_sint32 getCellXOnRow (void)
void incPosOnRow (void)
void incCellXOnRow (void)
bool getVecOfCellsOnRow (UT_sint32 row, UT_GenericVector< ie_imp_cell * > *pVec)
bool removeRow (UT_sint32 row)
void appendRow (UT_GenericVector< ie_imp_cell * > *pVecRowOfCells)
bool doCellXMatch (UT_sint32 iCellX1, UT_sint32 iCellX2, bool bIsLast=false)

Private Member Functions

void _buildCellXVector (void)
void _removeAllStruxes (void)

Private Attributes

PD_Documentm_pDoc
pf_Frag_Struxm_tableSDH
ie_imp_cellm_pCurImpCell
UT_sint32 m_iRowCounter
UT_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(), UT_String::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 
)
ie_imp_cell * ie_imp_table::getCellAtRowColX ( UT_sint32  newRow,
UT_sint32  cellX 
)
UT_String ie_imp_table::getCellPropVal ( const UT_String psProp  ) 

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   )  [inline]
UT_sint32 ie_imp_table::getColNumber ( ie_imp_cell pImpCell  ) 
ie_imp_cell * ie_imp_table::getCurCell ( void   ) 

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  ) 

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   ) 
UT_sint32 ie_imp_table::getPosOnRow ( void   )  [inline]
UT_String ie_imp_table::getPropVal ( const char *  szProp  ) 

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

References m_sTableProps, and UT_String_getPropVal().

UT_String ie_imp_table::getPropVal ( const UT_String psProp  ) 

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

References m_sTableProps, and UT_String_getPropVal().

Referenced by writeTablePropsInDoc().

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

Return this tables SDH

References m_tableSDH.

bool ie_imp_table::getVecOfCellsOnRow ( UT_sint32  row,
UT_GenericVector< ie_imp_cell * > *  pVec 
)
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   )  [inline]
bool ie_imp_table::isNewRow ( void   )  [inline]
UT_sint32 ie_imp_table::NewRow ( void   ) 

Start a new row.

Returns:
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 UT_String psProp,
const UT_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 UT_String psProp,
const UT_String psVal 
)

Set a property in the table properties string.

References m_sTableProps, and UT_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_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   )  [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().


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