Doxygen
Loading...
Searching...
No Matches
DocImage Class Reference

Node representing an image. More...

#include <src/docnode.h>

+ Inheritance diagram for DocImage:
+ Collaboration diagram for DocImage:

Classes

struct  Private
 

Public Types

enum  Type {
  Html , Latex , Rtf , DocBook ,
  Xml
}
 

Public Member Functions

 DocImage (DocParser *parser, DocNodeVariant *parent, const HtmlAttribList &attribs, const QCString &name, Type t, const QCString &url=QCString(), bool inlineImage=TRUE)
 
Type type () const
 
QCString name () const
 
bool hasCaption () const
 
QCString width () const
 
QCString height () const
 
QCString relPath () const
 
QCString url () const
 
bool isInlineImage () const
 
bool isSVG () const
 
const HtmlAttribListattribs () const
 
void parse ()
 
- Public Member Functions inherited from DocCompoundNode
 DocCompoundNode (DocParser *parser, DocNodeVariant *parent)
 
DocNodeListchildren ()
 
const DocNodeListchildren () const
 
- Public Member Functions inherited from DocNode
 DocNode (DocParser *parser, DocNodeVariant *parent)
 
 ~DocNode ()=default
 
DocNodeVariantparent ()
 
const DocNodeVariantparent () const
 
DocNodeVariantthisVariant ()
 
const DocNodeVariantthisVariant () const
 
void setThisVariant (DocNodeVariant *thisVariant)
 
DocParserparser ()
 
const DocParserparser () const
 
void setParent (DocNodeVariant *parent)
 
bool isPreformatted () const
 

Private Attributes

std::unique_ptr< Privatep
 

Additional Inherited Members

- Protected Types inherited from DocNode
enum  RefType { Unknown , Anchor , Section , Table }
 
- Protected Member Functions inherited from DocNode
void setInsidePreformatted (bool p)
 

Detailed Description

Node representing an image.

Definition at line 621 of file docnode.h.

Member Enumeration Documentation

◆ Type

Enumerator
Html 
Latex 
Rtf 
DocBook 
Xml 

Definition at line 624 of file docnode.h.

624{ Html, Latex, Rtf, DocBook, Xml };
@ DocBook
Definition docnode.h:624

Constructor & Destructor Documentation

◆ DocImage()

DocImage::DocImage ( DocParser * parser,
DocNodeVariant * parent,
const HtmlAttribList & attribs,
const QCString & name,
Type t,
const QCString & url = QCString(),
bool inlineImage = TRUE )

Definition at line 1242 of file docnode.cpp.

1243 :
1244 DocCompoundNode(parser,parent), p(std::make_unique<Private>(attribs, name, t, parser->context.relPath, url, inlineImage))
1245{
1246}
DocCompoundNode(DocParser *parser, DocNodeVariant *parent)
Definition docnode.h:140
const HtmlAttribList & attribs() const
Definition docnode.h:636
QCString name() const
Definition docnode.h:628
QCString url() const
Definition docnode.h:633
std::unique_ptr< Private > p
Definition docnode.h:655
DocParser * parser()
Definition docnode.h:97
DocNodeVariant * parent()
Definition docnode.h:89

References attribs(), DocCompoundNode::DocCompoundNode(), name(), p, DocNode::parent(), DocNode::parser(), relPath(), and url().

Member Function Documentation

◆ attribs()

const HtmlAttribList & DocImage::attribs ( ) const
inline

Definition at line 636 of file docnode.h.

636{ return p->attribs; }

References p.

Referenced by DocImage(), HtmlDocVisitor::operator()(), and XmlDocVisitor::operator()().

◆ hasCaption()

bool DocImage::hasCaption ( ) const
inline

Definition at line 629 of file docnode.h.

629{ return !children().empty(); }
DocNodeList & children()
Definition docnode.h:142
bool empty() const
checks whether the container is empty
Definition growvector.h:140

References DocCompoundNode::children(), and GrowVector< T >::empty().

Referenced by DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), and RTFDocVisitor::operator()().

◆ height()

QCString DocImage::height ( ) const
inline

◆ isInlineImage()

bool DocImage::isInlineImage ( ) const
inline

◆ isSVG()

bool DocImage::isSVG ( ) const

Definition at line 1248 of file docnode.cpp.

1249{
1250 QCString locName = p->url.isEmpty() ? p->name : p->url;
1251 int len = static_cast<int>(locName.length());
1252 int fnd = locName.find('?'); // ignore part from ? until end
1253 if (fnd==-1) fnd=len;
1254 return fnd>=4 && locName.mid(fnd-4,4)==".svg";
1255}
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226

References QCString::find(), QCString::length(), QCString::mid(), and p.

Referenced by HtmlDocVisitor::operator()().

◆ name()

◆ parse()

void DocImage::parse ( )

Definition at line 1257 of file docnode.cpp.

1258{
1260}
DocNodeVariant * thisVariant()
Definition docnode.h:92
void defaultHandleTitleAndSize(const CommandType cmd, DocNodeVariant *parent, DocNodeList &children, QCString &width, QCString &height)

References DocCompoundNode::children(), CMD_IMAGE, DocParser::defaultHandleTitleAndSize(), p, DocNode::parser(), and DocNode::thisVariant().

◆ relPath()

QCString DocImage::relPath ( ) const
inline

Definition at line 632 of file docnode.h.

632{ return p->relPath; }

References p.

Referenced by DocImage(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), and XmlDocVisitor::operator()().

◆ type()

◆ url()

QCString DocImage::url ( ) const
inline

Definition at line 633 of file docnode.h.

633{ return p->url; }

References p.

Referenced by DocImage(), HtmlDocVisitor::operator()(), and XmlDocVisitor::operator()().

◆ width()

Member Data Documentation

◆ p

std::unique_ptr<Private> DocImage::p
private

Definition at line 655 of file docnode.h.

Referenced by attribs(), DocImage(), height(), isInlineImage(), isSVG(), name(), parse(), relPath(), type(), url(), and width().


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