| 1 | // Copyright (C) 2020 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
| 3 | |
| 4 | #include "pagenode.h" |
| 5 | |
| 6 | #include "aggregate.h" |
| 7 | |
| 8 | QT_BEGIN_NAMESPACE |
| 9 | |
| 10 | /*! |
| 11 | \class PageNode |
| 12 | \brief A PageNode is a Node that generates a documentation page. |
| 13 | |
| 14 | Not all subclasses of Node produce documentation pages. FunctionNode, |
| 15 | PropertyNode, and EnumNode are all examples of subclasses of Node that |
| 16 | don't produce documentation pages but add documentation to a page. |
| 17 | They are always child nodes of an Aggregate, and Aggregate inherits |
| 18 | PageNode. |
| 19 | |
| 20 | Not every subclass of PageNode inherits Aggregate. ExternalPageNode, |
| 21 | ExampleNode, and CollectionNode are subclasses of PageNode that are |
| 22 | not subclasses of Aggregate. Because they are not subclasses of |
| 23 | Aggregate, they can't have children. But they still generate, or |
| 24 | link to, a documentation page. |
| 25 | */ |
| 26 | |
| 27 | /*! \fn QString PageNode::title() const |
| 28 | Returns the node's title, which is used for the page title. |
| 29 | */ |
| 30 | |
| 31 | /*! \fn QString PageNode::subtitle() const |
| 32 | Returns the node's subtitle, which may be empty. |
| 33 | */ |
| 34 | |
| 35 | /*! |
| 36 | Returns the node's full title. |
| 37 | */ |
| 38 | QString PageNode::fullTitle() const |
| 39 | { |
| 40 | return title(); |
| 41 | } |
| 42 | |
| 43 | /*! |
| 44 | Sets the node's \a title, which is used for the page title. |
| 45 | Returns true. Adds the node to the parent() nonfunction map |
| 46 | using the \a title as the key. |
| 47 | */ |
| 48 | bool PageNode::setTitle(const QString &title) |
| 49 | { |
| 50 | m_title = title; |
| 51 | parent()->addChildByTitle(child: this, title); |
| 52 | return true; |
| 53 | } |
| 54 | |
| 55 | /*! |
| 56 | \fn bool PageNode::setSubtitle(const QString &subtitle) |
| 57 | Sets the node's \a subtitle. Returns true; |
| 58 | */ |
| 59 | |
| 60 | /*! \fn PageNode::PageNode(Aggregate *parent, const QString &name) |
| 61 | This constructor sets the PageNode's \a parent and the \a name is the |
| 62 | argument of the \c {\\page} command. The node type is set to Node::Page. |
| 63 | */ |
| 64 | |
| 65 | /*! \fn PageNode::PageNode(NodeType type, Aggregate *parent, const QString &name) |
| 66 | This constructor is not called directly. It is called by the constructors of |
| 67 | subclasses of PageNode, usually Aggregate. The node type is set to \a type, |
| 68 | and the parent pointer is set to \a parent. \a name is the argument of the topic |
| 69 | command that resulted in the PageNode being created. This could be \c {\\class} |
| 70 | or \c {\\namespace}, for example. |
| 71 | */ |
| 72 | |
| 73 | /*! \fn PageNode::~PageNode() |
| 74 | The destructor is virtual, and it does nothing. |
| 75 | */ |
| 76 | |
| 77 | /*! \fn bool PageNode::isPageNode() const |
| 78 | Always returns \c true because this is a PageNode. |
| 79 | */ |
| 80 | |
| 81 | /*! \fn bool PageNode::isTextPageNode() const |
| 82 | Returns \c true if this instance of PageNode is not an Aggregate. |
| 83 | The significance of a \c true return value is that this PageNode |
| 84 | doesn't have children, because it is not an Aggregate. |
| 85 | |
| 86 | \sa Aggregate. |
| 87 | */ |
| 88 | |
| 89 | /*! \fn QString PageNode::imageFileName() const |
| 90 | If this PageNode is an ExampleNode, the image file name |
| 91 | data member is returned. Otherwise an empty string is |
| 92 | returned. |
| 93 | */ |
| 94 | |
| 95 | /*! \fn void PageNode::setImageFileName(const QString &ifn) |
| 96 | If this PageNode is an ExampleNode, the image file name |
| 97 | data member is set to \a ifn. Otherwise the function does |
| 98 | nothing. |
| 99 | */ |
| 100 | |
| 101 | /*! \fn bool PageNode::noAutoList() const |
| 102 | Returns the value of the no auto-list flag. |
| 103 | */ |
| 104 | |
| 105 | /*! \fn void PageNode::setNoAutoList(bool b) |
| 106 | Sets the no auto-list flag to \a b. |
| 107 | */ |
| 108 | |
| 109 | /*! \fn const QStringList &PageNode::groupNames() const |
| 110 | Returns a const reference to the string list containing all the group names. |
| 111 | */ |
| 112 | |
| 113 | /*! \fn void PageNode::appendGroupName(const QString &t) |
| 114 | Appends \a t to the list of group names. |
| 115 | */ |
| 116 | |
| 117 | QT_END_NAMESPACE |
| 118 | |