bug 781409 - remove nsITableLayout r=roc,davidb

This commit is contained in:
Trevor Saunders
2012-08-08 09:05:17 -04:00
parent b6b2cd47a2
commit 3f8f49e192
25 changed files with 302 additions and 614 deletions

View File

@@ -8,8 +8,8 @@
#include "mozilla/Attributes.h"
#include "nscore.h"
#include "nsContainerFrame.h"
#include "nsCellMap.h"
#include "nsBlockFrame.h"
#include "nsITableLayout.h"
#include "nsTableFrame.h"
class nsTableCaptionFrame : public nsBlockFrame
@@ -51,12 +51,14 @@ protected:
* the nsTableOuterFrame contains 0 or one caption frame, and a nsTableFrame
* pseudo-frame (referred to as the "inner frame').
*/
class nsTableOuterFrame : public nsContainerFrame, public nsITableLayout
class nsTableOuterFrame : public nsContainerFrame
{
public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
NS_DECL_QUERYFRAME_TARGET(nsTableOuterFrame)
/** instantiate a new instance of nsTableRowFrame.
* @param aPresShell the pres shell for this frame
*
@@ -130,21 +132,82 @@ public:
virtual nsIFrame* GetParentStyleContextFrame() const MOZ_OVERRIDE;
/*---------------- nsITableLayout methods ------------------------*/
/**
* Return the content for the cell at the given row and column.
*/
nsIContent* GetCellAt(uint32_t aRowIdx, uint32_t aColIdx) const;
/** @see nsITableFrame::GetCellDataAt */
NS_IMETHOD GetCellDataAt(int32_t aRowIndex, int32_t aColIndex,
nsIDOMElement* &aCell, //out params
int32_t& aStartRowIndex, int32_t& aStartColIndex,
int32_t& aRowSpan, int32_t& aColSpan,
int32_t& aActualRowSpan, int32_t& aActualColSpan,
bool& aIsSelected);
/**
* Return the number of rows in the table.
*/
int32_t GetRowCount() const
{
return InnerTableFrame()->GetRowCount();
}
/** @see nsITableFrame::GetTableSize */
NS_IMETHOD GetTableSize(int32_t& aRowCount, int32_t& aColCount) MOZ_OVERRIDE;
/**
* Return the number of columns in the table.
*/
int32_t GetColCount() const
{
return InnerTableFrame()->GetColCount();
}
NS_IMETHOD GetIndexByRowAndColumn(int32_t aRow, int32_t aColumn, int32_t *aIndex) MOZ_OVERRIDE;
NS_IMETHOD GetRowAndColumnByIndex(int32_t aIndex, int32_t *aRow, int32_t *aColumn) MOZ_OVERRIDE;
/**
* Return the index of the cell at the given row and column.
*/
int32_t GetIndexByRowAndColumn(int32_t aRowIdx, int32_t aColIdx) const
{
nsTableCellMap* cellMap = InnerTableFrame()->GetCellMap();
if (!cellMap)
return -1;
return cellMap->GetIndexByRowAndColumn(aRowIdx, aColIdx);
}
/**
* Get the row and column indices for the cell at the given index.
*/
void GetRowAndColumnByIndex(int32_t aCellIdx, int32_t* aRowIdx,
int32_t* aColIdx) const
{
*aRowIdx = *aColIdx = 0;
nsTableCellMap* cellMap = InnerTableFrame()->GetCellMap();
if (cellMap) {
cellMap->GetRowAndColumnByIndex(aCellIdx, aRowIdx, aColIdx);
}
}
/**
* return the frame for the cell at the given row and column.
*/
nsTableCellFrame* GetCellFrameAt(uint32_t aRowIdx, uint32_t aColIdx) const
{
nsTableCellMap* map = InnerTableFrame()->GetCellMap();
if (!map) {
return nullptr;
}
return map->GetCellInfoAt(aRowIdx, aColIdx);
}
/**
* Return the col span of the cell at the given row and column indices.
*/
uint32_t GetEffectiveColSpanAt(uint32_t aRowIdx, uint32_t aColIdx) const
{
nsTableCellMap* map = InnerTableFrame()->GetCellMap();
return map->GetEffectiveColSpan(aRowIdx, aColIdx);
}
/**
* Return the effective row span of the cell at the given row and column.
*/
uint32_t GetEffectiveRowSpanAt(uint32_t aRowIdx, uint32_t aColIdx) const
{
nsTableCellMap* map = InnerTableFrame()->GetCellMap();
return map->GetEffectiveRowSpan(aRowIdx, aColIdx);
}
protected: