Doxygen
DocHtmlCell类 参考

Node representing a HTML table cell 更多...

#include <docparser.h>

+ 类 DocHtmlCell 继承关系图:
+ DocHtmlCell 的协作图:

Public 类型

enum  Alignment { Left, Right, Center }
 
enum  Valignment { Top, Middle, Bottom }
 
- Public 类型 继承自 DocNode
enum  Kind {
  Kind_Root = 0, Kind_Word = 1, Kind_WhiteSpace = 2, Kind_Para = 3,
  Kind_AutoList = 4, Kind_AutoListItem = 5, Kind_Symbol = 6, Kind_URL = 7,
  Kind_StyleChange = 8, Kind_SimpleSect = 9, Kind_Title = 10, Kind_SimpleList = 11,
  Kind_SimpleListItem = 12, Kind_Section = 13, Kind_Verbatim = 14, Kind_XRefItem = 15,
  Kind_HtmlList = 16, Kind_HtmlListItem = 17, Kind_HtmlDescList = 18, Kind_HtmlDescData = 19,
  Kind_HtmlDescTitle = 20, Kind_HtmlTable = 21, Kind_HtmlRow = 22, Kind_HtmlCell = 23,
  Kind_HtmlCaption = 24, Kind_LineBreak = 25, Kind_HorRuler = 26, Kind_Anchor = 27,
  Kind_IndexEntry = 28, Kind_Internal = 29, Kind_HRef = 30, Kind_Include = 31,
  Kind_IncOperator = 32, Kind_HtmlHeader = 33, Kind_Image = 34, Kind_DotFile = 35,
  Kind_Link = 36, Kind_Ref = 37, Kind_Formula = 38, Kind_SecRefItem = 39,
  Kind_SecRefList = 40, Kind_SimpleSectSep = 41, Kind_LinkedWord = 42, Kind_ParamSect = 43,
  Kind_ParamList = 44, Kind_InternalRef = 45, Kind_Copy = 46, Kind_Text = 47,
  Kind_MscFile = 48, Kind_HtmlBlockQuote = 49, Kind_VhdlFlow = 50, Kind_ParBlock = 51,
  Kind_DiaFile = 52, Kind_Emoji = 53, Kind_Sep = 54
}
 

Public 成员函数

 DocHtmlCell (DocParser &parser, DocNode *parent, const HtmlAttribList &attribs, bool isHeading)
 
bool isHeading () const
 
bool isFirst () const
 
bool isLast () const
 
Kind kind () const override
 
void markFirst (bool v=TRUE)
 
void markLast (bool v=TRUE)
 
const HtmlAttribListattribs () const
 
int parse ()
 
int parseXml ()
 
uint rowIndex () const
 
uint columnIndex () const
 
uint rowSpan () const
 
uint colSpan () const
 
Alignment alignment () const
 
Valignment valignment () const
 
- Public 成员函数 继承自 CompAccept< DocHtmlCell >
 CompAccept (DocParser &parser)
 
void accept (DocVisitor *v) override
 
const DocNodeListchildren () const
 
DocNodeListchildren ()
 
- Public 成员函数 继承自 DocNode
 DocNode (DocParser &parser)
 
virtual ~DocNode ()
 
DocNodeparent () const
 
void setParent (DocNode *parent)
 
bool isPreformatted () const
 

Private 成员函数

void setRowIndex (uint idx)
 
void setColumnIndex (uint idx)
 

Private 属性

bool m_isHeading = false
 
bool m_isFirst = false
 
bool m_isLast = false
 
HtmlAttribList m_attribs
 
uint m_rowIdx = (uint)-1
 
uint m_colIdx = (uint)-1
 

友元

class DocHtmlTable
 

额外继承的成员函数

- Protected 类型 继承自 DocNode
enum  RefType { Unknown, Anchor, Section, Table }
 
- Protected 成员函数 继承自 DocNode
void setInsidePreformatted (bool p)
 
- Protected 属性 继承自 CompAccept< DocHtmlCell >
DocNodeList m_children
 
- Protected 属性 继承自 DocNode
DocNodem_parent = 0
 
DocParserm_parser
 

详细描述

Node representing a HTML table cell

在文件 docparser.h1316 行定义.

成员枚举类型说明

◆ Alignment

枚举值
Left 
Right 
Center 

在文件 docparser.h1320 行定义.

1320 { Left, Right, Center };

◆ Valignment

枚举值
Top 
Middle 
Bottom 

在文件 docparser.h1321 行定义.

1321 {Top, Middle, Bottom};

构造及析构函数说明

◆ DocHtmlCell()

DocHtmlCell::DocHtmlCell ( DocParser parser,
DocNode parent,
const HtmlAttribList attribs,
bool  isHeading 
)
inline

在文件 docparser.h1322 行定义.

引用了 DocNode::m_parent , 以及 DocNode::parent().

成员函数说明

◆ alignment()

DocHtmlCell::Alignment DocHtmlCell::alignment ( ) const

在文件 docparser.cpp3365 行定义.

3366 {
3367  for (const auto &attr : attribs())
3368  {
3369  QCString attrName = attr.name.lower();
3370  QCString attrValue = attr.value.lower();
3371  if (attrName=="align")
3372  {
3373  if (attrValue=="center")
3374  return Center;
3375  else if (attrValue=="right")
3376  return Right;
3377  else return Left;
3378  }
3379  else if (attrName=="class" && attrValue.startsWith("markdowntable"))
3380  {
3381  if (attrValue=="markdowntableheadcenter")
3382  return Center;
3383  else if (attrValue=="markdowntableheadright")
3384  return Right;
3385  else if (attrValue=="markdowntableheadleft")
3386  return Left;
3387  else if (attrValue=="markdowntableheadnone")
3388  return Center;
3389  else if (attrValue=="markdowntablebodycenter")
3390  return Center;
3391  else if (attrValue=="markdowntablebodyright")
3392  return Right;
3393  else if (attrValue=="markdowntablebodyleft")
3394  return Left;
3395  else if (attrValue=="markdowntablebodynone")
3396  return Left;
3397  else return Left;
3398  }
3399  }
3400  return Left;
3401 }

引用了 attribs(), Center, Left, QCString::lower(), Right , 以及 QCString::startsWith().

被这些函数引用 LatexDocVisitor::visitPre().

◆ attribs()

const HtmlAttribList& DocHtmlCell::attribs ( ) const
inline

◆ colSpan()

uint DocHtmlCell::colSpan ( ) const

在文件 docparser.cpp3353 行定义.

3354 {
3355  for (const auto &attr : attribs())
3356  {
3357  if (attr.name.lower()=="colspan")
3358  {
3359  return std::max(1u,attr.value.toUInt());
3360  }
3361  }
3362  return 1;
3363 }

引用了 attribs().

被这些函数引用 DocHtmlTable::computeTableGrid() , 以及 LatexDocVisitor::visitPre().

◆ columnIndex()

uint DocHtmlCell::columnIndex ( ) const
inline

在文件 docparser.h1334 行定义.

1334 { return m_colIdx; }

引用了 m_colIdx.

被这些函数引用 LatexDocVisitor::visitPre().

◆ isFirst()

bool DocHtmlCell::isFirst ( ) const
inline

在文件 docparser.h1325 行定义.

1325 { return m_isFirst; }

引用了 m_isFirst.

被这些函数引用 parse() , 以及 parseXml().

◆ isHeading()

◆ isLast()

bool DocHtmlCell::isLast ( ) const
inline

在文件 docparser.h1326 行定义.

1326 { return m_isLast; }

引用了 m_isLast.

被这些函数引用 LatexDocVisitor::visitPost().

◆ kind()

Kind DocHtmlCell::kind ( ) const
inlineoverridevirtual

Returns the kind of node. Provides runtime type information

实现了 DocNode.

在文件 docparser.h1327 行定义.

1327 { return Kind_HtmlCell; }

引用了 DocNode::Kind_HtmlCell.

◆ markFirst()

void DocHtmlCell::markFirst ( bool  v = TRUE)
inline

在文件 docparser.h1328 行定义.

1328 { m_isFirst=v; }

引用了 m_isFirst.

被这些函数引用 DocHtmlRow::parse() , 以及 DocHtmlRow::parseXml().

◆ markLast()

void DocHtmlCell::markLast ( bool  v = TRUE)
inline

在文件 docparser.h1329 行定义.

1329 { m_isLast=v; }

引用了 m_isLast.

被这些函数引用 DocHtmlRow::parse() , 以及 DocHtmlRow::parseXml().

◆ parse()

int DocHtmlCell::parse ( )

在文件 docparser.cpp3271 行定义.

3272 {
3273  int retval=RetVal_OK;
3274  auto ns = AutoNodeStack(m_parser,this);
3275  DBG(("DocHtmlCell::parse() start\n"));
3276 
3277  // parse one or more paragraphs
3278  bool isFirst=TRUE;
3279  DocPara *par=0;
3280  do
3281  {
3282  par = new DocPara(m_parser,this);
3283  if (isFirst) { par->markFirst(); isFirst=FALSE; }
3284  m_children.push_back(std::unique_ptr<DocPara>(par));
3285  retval=par->parse();
3286  if (retval==TK_HTMLTAG)
3287  {
3289  if (tagId==HTML_TD && m_parser.context.token->endTag) // found </td> tag
3290  {
3291  retval=TK_NEWPARA; // ignore the tag
3292  }
3293  else if (tagId==HTML_TH && m_parser.context.token->endTag) // found </th> tag
3294  {
3295  retval=TK_NEWPARA; // ignore the tag
3296  }
3297  }
3298  }
3299  while ((retval==TK_NEWPARA) || (retval==RetVal_EndParBlock));
3300  if (par) par->markLast();
3301 
3302  DBG(("DocHtmlCell::parse() end\n"));
3303  return retval;
3304 }

引用了 DocParser::context, DBG, TokenInfo::endTag, FALSE, HTML_TD, HTML_TH, Mappers::htmlTagMapper, isFirst(), CompAccept< DocHtmlCell >::m_children, DocNode::m_parser, Mapper::map(), DocPara::markFirst(), DocPara::markLast(), TokenInfo::name, DocPara::parse(), RetVal_EndParBlock, RetVal_OK, TK_HTMLTAG, TK_NEWPARA, DocParserContext::token , 以及 TRUE.

被这些函数引用 DocHtmlRow::parse().

◆ parseXml()

int DocHtmlCell::parseXml ( )

在文件 docparser.cpp3306 行定义.

3307 {
3308  int retval=RetVal_OK;
3309  auto ns = AutoNodeStack(m_parser,this);
3310  DBG(("DocHtmlCell::parseXml() start\n"));
3311 
3312  // parse one or more paragraphs
3313  bool isFirst=TRUE;
3314  DocPara *par=0;
3315  do
3316  {
3317  par = new DocPara(m_parser,this);
3318  if (isFirst) { par->markFirst(); isFirst=FALSE; }
3319  m_children.push_back(std::unique_ptr<DocPara>(par));
3320  retval=par->parse();
3321  if (retval==TK_HTMLTAG)
3322  {
3324  if (tagId==XML_ITEM && m_parser.context.token->endTag) // found </item> tag
3325  {
3326  retval=TK_NEWPARA; // ignore the tag
3327  }
3328  else if (tagId==XML_DESCRIPTION && m_parser.context.token->endTag) // found </description> tag
3329  {
3330  retval=TK_NEWPARA; // ignore the tag
3331  }
3332  }
3333  }
3334  while (retval==TK_NEWPARA);
3335  if (par) par->markLast();
3336 
3337  DBG(("DocHtmlCell::parseXml() end\n"));
3338  return retval;
3339 }

引用了 DocParser::context, DBG, TokenInfo::endTag, FALSE, Mappers::htmlTagMapper, isFirst(), CompAccept< DocHtmlCell >::m_children, DocNode::m_parser, Mapper::map(), DocPara::markFirst(), DocPara::markLast(), TokenInfo::name, DocPara::parse(), RetVal_OK, TK_HTMLTAG, TK_NEWPARA, DocParserContext::token, TRUE, XML_DESCRIPTION , 以及 XML_ITEM.

被这些函数引用 DocHtmlRow::parseXml().

◆ rowIndex()

uint DocHtmlCell::rowIndex ( ) const
inline

在文件 docparser.h1333 行定义.

1333 { return m_rowIdx; }

引用了 m_rowIdx.

◆ rowSpan()

uint DocHtmlCell::rowSpan ( ) const

在文件 docparser.cpp3341 行定义.

3342 {
3343  for (const auto &attr : attribs())
3344  {
3345  if (attr.name.lower()=="rowspan")
3346  {
3347  return attr.value.toUInt();
3348  }
3349  }
3350  return 0;
3351 }

引用了 attribs().

被这些函数引用 DocHtmlTable::computeTableGrid() , 以及 LatexDocVisitor::visitPre().

◆ setColumnIndex()

void DocHtmlCell::setColumnIndex ( uint  idx)
inlineprivate

在文件 docparser.h1342 行定义.

1342 { m_colIdx = idx; }

引用了 m_colIdx.

被这些函数引用 DocHtmlTable::computeTableGrid().

◆ setRowIndex()

void DocHtmlCell::setRowIndex ( uint  idx)
inlineprivate

在文件 docparser.h1341 行定义.

1341 { m_rowIdx = idx; }

引用了 m_rowIdx.

被这些函数引用 DocHtmlTable::computeTableGrid().

◆ valignment()

DocHtmlCell::Valignment DocHtmlCell::valignment ( ) const

在文件 docparser.cpp3403 行定义.

3404 {
3405  for (const auto &attr : attribs())
3406  {
3407  QCString attrName = attr.name.lower();
3408  QCString attrValue = attr.value.lower();
3409  if (attrName=="valign")
3410  {
3411  if (attrValue=="top")
3412  return Top;
3413  else if (attrValue=="bottom")
3414  return Bottom;
3415  else if (attrValue=="middle")
3416  return Middle;
3417  else return Middle;
3418  }
3419  }
3420  return Middle;
3421 }

引用了 attribs(), Bottom, QCString::lower(), Middle , 以及 Top.

被这些函数引用 LatexDocVisitor::visitPre().

友元及相关函数文档

◆ DocHtmlTable

friend class DocHtmlTable
friend

在文件 docparser.h1318 行定义.

类成员变量说明

◆ m_attribs

HtmlAttribList DocHtmlCell::m_attribs
private

在文件 docparser.h1346 行定义.

被这些函数引用 attribs().

◆ m_colIdx

uint DocHtmlCell::m_colIdx = (uint)-1
private

在文件 docparser.h1348 行定义.

被这些函数引用 columnIndex() , 以及 setColumnIndex().

◆ m_isFirst

bool DocHtmlCell::m_isFirst = false
private

在文件 docparser.h1344 行定义.

被这些函数引用 isFirst() , 以及 markFirst().

◆ m_isHeading

bool DocHtmlCell::m_isHeading = false
private

在文件 docparser.h1343 行定义.

被这些函数引用 isHeading().

◆ m_isLast

bool DocHtmlCell::m_isLast = false
private

在文件 docparser.h1345 行定义.

被这些函数引用 isLast() , 以及 markLast().

◆ m_rowIdx

uint DocHtmlCell::m_rowIdx = (uint)-1
private

在文件 docparser.h1347 行定义.

被这些函数引用 rowIndex() , 以及 setRowIndex().


该类的文档由以下文件生成:
DocHtmlCell::m_isLast
bool m_isLast
Definition: docparser.h:1345
TokenInfo::endTag
bool endTag
Definition: doctokenizer.h:100
DocHtmlCell::m_attribs
HtmlAttribList m_attribs
Definition: docparser.h:1346
DocPara
Node representing a paragraph in the documentation tree
Definition: docparser.h:1178
DocHtmlCell::m_colIdx
uint m_colIdx
Definition: docparser.h:1348
DocParserContext::token
TokenInfo * token
Definition: docparser.cpp:129
DocParser::context
DocParserContext context
Definition: docparser.cpp:175
CompAccept< DocHtmlCell >
DocHtmlCell::isFirst
bool isFirst() const
Definition: docparser.h:1325
TokenInfo::name
QCString name
Definition: doctokenizer.h:74
RetVal_OK
@ RetVal_OK
Command starting with \
Definition: doctokenizer.h:59
DocPara::markFirst
void markFirst(bool v=TRUE)
Definition: docparser.h:1186
DocHtmlCell::m_isFirst
bool m_isFirst
Definition: docparser.h:1344
DocNode::Kind_HtmlCell
@ Kind_HtmlCell
Definition: docparser.h:123
DocHtmlCell::Middle
@ Middle
Definition: docparser.h:1321
DocHtmlCell::Top
@ Top
Definition: docparser.h:1321
DocHtmlCell::m_rowIdx
uint m_rowIdx
Definition: docparser.h:1347
Mappers::htmlTagMapper
static Mapper * htmlTagMapper
Definition: cmdmapper.h:235
DocHtmlCell::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:1330
DocHtmlCell::m_isHeading
bool m_isHeading
Definition: docparser.h:1343
DocHtmlCell::Right
@ Right
Definition: docparser.h:1320
DocNode::m_parser
DocParser & m_parser
Definition: docparser.h:184
QCString::lower
QCString lower() const
Definition: qcstring.h:232
HTML_TD
@ HTML_TD
Definition: cmdmapper.h:161
TRUE
#define TRUE
Definition: qcstring.h:36
DocPara::markLast
void markLast(bool v=TRUE)
Definition: docparser.h:1187
XML_ITEM
@ XML_ITEM
Definition: cmdmapper.h:198
DocPara::parse
int parse()
Definition: docparser.cpp:6579
RetVal_EndParBlock
@ RetVal_EndParBlock
Definition: doctokenizer.h:82
DocHtmlCell::Left
@ Left
Definition: docparser.h:1320
XML_DESCRIPTION
@ XML_DESCRIPTION
Definition: cmdmapper.h:194
DocHtmlCell::isHeading
bool isHeading() const
Definition: docparser.h:1324
TK_HTMLTAG
@ TK_HTMLTAG
Command starting with @
Definition: doctokenizer.h:52
QCString::startsWith
bool startsWith(const char *s) const
Definition: qcstring.h:408
DocHtmlCell::Bottom
@ Bottom
Definition: docparser.h:1321
AutoNodeStack
Definition: docparser.cpp:186
Mapper::map
int map(const QCString &n)
Definition: cmdmapper.cpp:237
TK_NEWPARA
@ TK_NEWPARA
Definition: doctokenizer.h:54
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DBG
#define DBG(x)
Definition: docparser.cpp:58
DocHtmlCell::Center
@ Center
Definition: docparser.h:1320
CompAccept< DocHtmlCell >::m_children
DocNodeList m_children
Definition: docparser.h:211
HTML_TH
@ HTML_TH
Definition: cmdmapper.h:162
DocNode::m_parent
DocNode * m_parent
Definition: docparser.h:182
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108