diff options
Diffstat (limited to 'src/tools/qdoc/node.h')
-rw-r--r-- | src/tools/qdoc/node.h | 375 |
1 files changed, 191 insertions, 184 deletions
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 2ccd97dbd1..f852e480a6 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -48,7 +48,7 @@ class Node; class Tree; class EnumNode; class ClassNode; -class InnerNode; +class Aggregate; class ExampleNode; class TypedefNode; class QmlTypeNode; @@ -59,6 +59,7 @@ class CollectionNode; class QmlPropertyNode; typedef QList<Node*> NodeList; +typedef QList<PropertyNode*> PropNodeList; typedef QMap<QString, Node*> NodeMap; typedef QMultiMap<QString, Node*> NodeMultiMap; typedef QPair<int, int> NodeTypePair; @@ -71,7 +72,7 @@ class Node Q_DECLARE_TR_FUNCTIONS(QDoc::Node) public: - enum Type { + enum NodeType { NoType, Namespace, Class, @@ -94,8 +95,8 @@ public: LastType }; - enum SubType { - NoSubType, + enum DocSubtype { + NoSubtype, Example, HeaderFile, File, @@ -115,7 +116,7 @@ public: Obsolete, Deprecated, Preliminary, - Commendable, + Active, Internal, Intermediate }; // don't reorder this enum @@ -132,13 +133,7 @@ public: NextLink, PreviousLink, ContentsLink, - IndexLink /*, - GlossaryLink, - CopyrightLink, - ChapterLink, - SectionLink, - SubsectionLink, - AppendixLink */ + IndexLink }; enum PageType { @@ -172,24 +167,24 @@ public: Node::Genus genus() const { return (Genus) genus_; } void setGenus(Genus t) { genus_ = (unsigned char) t; } - void setAccess(Access access) { access_ = (unsigned char) access; } - void setLocation(const Location& location) { loc_ = location; } + void setAccess(Access t) { access_ = (unsigned char) t; } + void setLocation(const Location& t); void setDoc(const Doc& doc, bool replace = false); - void setStatus(Status status) { - if (status_ == (unsigned char) Obsolete && status == Deprecated) + void setStatus(Status t) { + if (status_ == (unsigned char) Obsolete && t == Deprecated) return; - status_ = (unsigned char) status; + status_ = (unsigned char) t; } - void setThreadSafeness(ThreadSafeness safeness) { safeness_ = (unsigned char) safeness; } + void setThreadSafeness(ThreadSafeness t) { safeness_ = (unsigned char) t; } void setSince(const QString &since); - void setRelates(InnerNode* pseudoParent); + void setRelates(Aggregate* pseudoParent); void setPhysicalModuleName(const QString &name) { physicalModuleName_ = name; } void setUrl(const QString& url) { url_ = url; } - void setTemplateStuff(const QString &templateStuff) { templateStuff_ = templateStuff; } + void setTemplateStuff(const QString &t) { templateStuff_ = t; } void setReconstitutedBrief(const QString &t) { reconstitutedBrief_ = t; } void setPageType(PageType t) { pageType_ = (unsigned char) t; } void setPageType(const QString& t); - void setParent(InnerNode* n) { parent_ = n; } + void setParent(Aggregate* n) { parent_ = n; } void setIndexNodeFlag() { indexNodeFlag_ = true; } virtual void setOutputFileName(const QString& ) { } @@ -197,7 +192,7 @@ public: bool isJsNode() const { return genus() == JS; } bool isCppNode() const { return genus() == CPP; } - virtual bool isInnerNode() const = 0; + virtual bool isAggregate() const = 0; virtual bool isCollectionNode() const { return false; } virtual bool isDocumentNode() const { return false; } virtual bool isGroup() const { return false; } @@ -208,11 +203,12 @@ public: virtual bool isJsType() const { return false; } virtual bool isQmlBasicType() const { return false; } virtual bool isJsBasicType() const { return false; } + virtual bool isEnumType() const { return false; } virtual bool isExample() const { return false; } virtual bool isExampleFile() const { return false; } virtual bool isHeaderFile() const { return false; } virtual bool isLeaf() const { return false; } - virtual bool isReimp() const { return false; } + virtual bool isReimplemented() const { return false; } virtual bool isFunction() const { return false; } virtual bool isNamespace() const { return false; } virtual bool isClass() const { return false; } @@ -253,19 +249,19 @@ public: virtual bool isInternal() const; virtual void setDataType(const QString& ) { } virtual void setReadOnly(bool ) { } - virtual Node* disambiguate(Type , SubType ) { return this; } + virtual Node* disambiguate(NodeType , DocSubtype ) { return this; } virtual bool wasSeen() const { return false; } virtual void appendGroupName(const QString& ) { } virtual QString element() const { return QString(); } virtual Tree* tree() const; virtual void findChildren(const QString& , NodeList& nodes) const { nodes.clear(); } bool isIndexNode() const { return indexNodeFlag_; } - Type type() const { return (Type) nodeType_; } - virtual SubType subType() const { return NoSubType; } + NodeType type() const { return (NodeType) nodeType_; } + virtual DocSubtype docSubtype() const { return NoSubtype; } bool match(const NodeTypeList& types) const; - InnerNode* parent() const { return parent_; } + Aggregate* parent() const { return parent_; } const Node* root() const; - InnerNode* relates() const { return relatesTo_; } + Aggregate* relates() const { return relatesTo_; } const QString& name() const { return name_; } QString physicalModuleName() const; QString url() const { return url_; } @@ -282,7 +278,9 @@ public: Access access() const { return (Access) access_; } bool isPrivate() const { return (Access) access_ == Private; } QString accessString() const; - const Location& location() const { return loc_; } + const Location& declLocation() const { return declLocation_; } + const Location& defLocation() const { return defLocation_; } + const Location& location() const { return (defLocation_.isEmpty() ? declLocation_ : defLocation_); } const Doc& doc() const { return doc_; } bool hasDoc() const { return !doc_.isEmpty(); } Status status() const { return (Status) status_; } @@ -301,7 +299,7 @@ public: void clearRelated() { relatesTo_ = 0; } - QString guid() const; + //QString guid() const; QString extractClassName(const QString &string) const; virtual QString qmlTypeName() const { return name_; } virtual QString qmlFullBaseName() const { return QString(); } @@ -322,7 +320,7 @@ public: virtual void setOutputSubdirectory(const QString& t) { outSubDir_ = t; } QString fullDocumentName() const; static QString cleanId(const QString &str); - QString idForNode() const; + //QString idForNode() const; static FlagValue toFlagValue(bool b); static bool fromFlagValue(FlagValue fv, bool defaultValue); @@ -333,10 +331,10 @@ public: static int incPropertyGroupCount(); static void clearPropertyGroupCount(); static void initialize(); - static Type goal(const QString& t) { return goals_.value(t); } + static NodeType goal(const QString& t) { return goals_.value(t); } protected: - Node(Type type, InnerNode* parent, const QString& name); + Node(NodeType type, Aggregate* parent, const QString& name); private: @@ -348,10 +346,11 @@ private: unsigned char status_; bool indexNodeFlag_; - InnerNode* parent_; - InnerNode* relatesTo_; + Aggregate* parent_; + Aggregate* relatesTo_; QString name_; - Location loc_; + Location declLocation_; + Location defLocation_; Doc doc_; QMap<LinkType, QPair<QString, QString> > linkMap_; QString fileNameBase_; @@ -360,39 +359,37 @@ private: QString since_; QString templateStuff_; QString reconstitutedBrief_; - mutable QString uuid_; + //mutable QString uuid_; QString outSubDir_; static QStringMap operators_; static int propertyGroupCount_; - static QMap<QString,Node::Type> goals_; + static QMap<QString,Node::NodeType> goals_; }; -class InnerNode : public Node +class Aggregate : public Node { public: - virtual ~InnerNode(); + virtual ~Aggregate(); Node* findChildNode(const QString& name, Node::Genus genus) const; - Node* findChildNode(const QString& name, Type type); + Node* findChildNode(const QString& name, NodeType type); virtual void findChildren(const QString& name, NodeList& nodes) const Q_DECL_OVERRIDE; FunctionNode* findFunctionNode(const QString& name) const; FunctionNode* findFunctionNode(const FunctionNode* clone) const; void addInclude(const QString &include); void setIncludes(const QStringList &includes); - void setOverload(FunctionNode* func, bool overlode); void normalizeOverloads(); void makeUndocumentedChildrenInternal(); void deleteChildren(); void removeFromRelated(); - virtual bool isInnerNode() const Q_DECL_OVERRIDE { return true; } + virtual bool isAggregate() const Q_DECL_OVERRIDE { return true; } virtual bool isLeaf() const Q_DECL_OVERRIDE { return false; } const EnumNode* findEnumNodeForValue(const QString &enumValue) const; const NodeList & childNodes() const { return children_; } const NodeList & relatedNodes() const { return related_; } int count() const { return children_.size(); } - int overloadNumber(const FunctionNode* func) const; NodeList overloads(const QString &funcName) const; const QStringList& includes() const { return includes_; } @@ -411,9 +408,11 @@ public: void addChild(Node* child); void removeChild(Node* child); void setOutputSubdirectory(const QString& t) Q_DECL_OVERRIDE; + const NodeMap& primaryFunctionMap() { return primaryFunctionMap_; } + const QMap<QString, NodeList>& secondaryFunctionMap() { return secondaryFunctionMap_; } protected: - InnerNode(Type type, InnerNode* parent, const QString& name); + Aggregate(NodeType type, Aggregate* parent, const QString& name); private: friend class Node; @@ -428,9 +427,9 @@ private: NodeList children_; NodeList enumChildren_; NodeList related_; - QMap<QString, Node*> childMap; - QMap<QString, Node*> primaryFunctionMap; - QMap<QString, NodeList> secondaryFunctionMap; + NodeMap childMap_; + NodeMap primaryFunctionMap_; + QMap<QString, NodeList> secondaryFunctionMap_; }; class LeafNode : public Node @@ -439,18 +438,18 @@ public: LeafNode(); virtual ~LeafNode() { } - virtual bool isInnerNode() const Q_DECL_OVERRIDE { return false; } + virtual bool isAggregate() const Q_DECL_OVERRIDE { return false; } virtual bool isLeaf() const Q_DECL_OVERRIDE { return true; } protected: - LeafNode(Type type, InnerNode* parent, const QString& name); - LeafNode(InnerNode* parent, Type type, const QString& name); + LeafNode(NodeType type, Aggregate* parent, const QString& name); + LeafNode(Aggregate* parent, NodeType type, const QString& name); }; -class NamespaceNode : public InnerNode +class NamespaceNode : public Aggregate { public: - NamespaceNode(InnerNode* parent, const QString& name); + NamespaceNode(Aggregate* parent, const QString& name); virtual ~NamespaceNode() { } virtual bool isNamespace() const Q_DECL_OVERRIDE { return true; } virtual Tree* tree() const Q_DECL_OVERRIDE { return (parent() ? parent()->tree() : tree_); } @@ -498,10 +497,10 @@ struct UsingClause QString signature_; }; -class ClassNode : public InnerNode +class ClassNode : public Aggregate { public: - ClassNode(InnerNode* parent, const QString& name); + ClassNode(Aggregate* parent, const QString& name); virtual ~ClassNode() { } virtual bool isClass() const Q_DECL_OVERRIDE { return true; } virtual bool isWrapper() const Q_DECL_OVERRIDE { return wrapper_; } @@ -544,13 +543,13 @@ private: QmlTypeNode* qmlelement; }; -class DocumentNode : public InnerNode +class DocumentNode : public Aggregate { public: - DocumentNode(InnerNode* parent, + DocumentNode(Aggregate* parent, const QString& name, - SubType subType, + DocSubtype docSubtype, PageType ptype); virtual ~DocumentNode() { } @@ -558,7 +557,7 @@ public: virtual void setTitle(const QString &title) Q_DECL_OVERRIDE; virtual void setSubTitle(const QString &subTitle) Q_DECL_OVERRIDE { subtitle_ = subTitle; } - SubType subType() const Q_DECL_OVERRIDE { return nodeSubtype_; } + DocSubtype docSubtype() const Q_DECL_OVERRIDE { return nodeSubtype_; } virtual QString title() const Q_DECL_OVERRIDE { return title_; } virtual QString fullTitle() const Q_DECL_OVERRIDE; virtual QString subTitle() const Q_DECL_OVERRIDE; @@ -566,13 +565,13 @@ public: virtual QString nameForLists() const Q_DECL_OVERRIDE { return title(); } virtual void setImageFileName(const QString& ) { } - virtual bool isHeaderFile() const Q_DECL_OVERRIDE { return (subType() == Node::HeaderFile); } - virtual bool isExample() const Q_DECL_OVERRIDE { return (subType() == Node::Example); } + virtual bool isHeaderFile() const Q_DECL_OVERRIDE { return (docSubtype() == Node::HeaderFile); } + virtual bool isExample() const Q_DECL_OVERRIDE { return (docSubtype() == Node::Example); } virtual bool isExampleFile() const Q_DECL_OVERRIDE { return (parent() && parent()->isExample()); } virtual bool isExternalPage() const Q_DECL_OVERRIDE { return nodeSubtype_ == ExternalPage; } protected: - SubType nodeSubtype_; + DocSubtype nodeSubtype_; QString title_; QString subtitle_; }; @@ -580,7 +579,7 @@ protected: class ExampleNode : public DocumentNode { public: - ExampleNode(InnerNode* parent, const QString& name) + ExampleNode(Aggregate* parent, const QString& name) : DocumentNode(parent, name, Node::Example, Node::ExamplePage) { } virtual ~ExampleNode() { } virtual QString imageFileName() const Q_DECL_OVERRIDE { return imageFileName_; } @@ -610,10 +609,10 @@ struct ImportRec { typedef QList<ImportRec> ImportList; -class QmlTypeNode : public InnerNode +class QmlTypeNode : public Aggregate { public: - QmlTypeNode(InnerNode* parent, const QString& name); + QmlTypeNode(Aggregate* parent, const QString& name); virtual ~QmlTypeNode(); virtual bool isQmlType() const Q_DECL_OVERRIDE { return genus() == Node::QML; } virtual bool isJsType() const Q_DECL_OVERRIDE { return genus() == Node::JS; } @@ -665,17 +664,17 @@ private: ImportList importList_; }; -class QmlBasicTypeNode : public InnerNode +class QmlBasicTypeNode : public Aggregate { public: - QmlBasicTypeNode(InnerNode* parent, + QmlBasicTypeNode(Aggregate* parent, const QString& name); virtual ~QmlBasicTypeNode() { } virtual bool isQmlBasicType() const Q_DECL_OVERRIDE { return (genus() == Node::QML); } virtual bool isJsBasicType() const Q_DECL_OVERRIDE { return (genus() == Node::JS); } }; -class QmlPropertyGroupNode : public InnerNode +class QmlPropertyGroupNode : public Aggregate { public: QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name); @@ -705,7 +704,7 @@ class QmlPropertyNode : public LeafNode Q_DECLARE_TR_FUNCTIONS(QDoc::QmlPropertyNode) public: - QmlPropertyNode(InnerNode *parent, + QmlPropertyNode(Aggregate *parent, const QString& name, const QString& type, bool attached); @@ -760,57 +759,58 @@ class EnumItem public: EnumItem() { } EnumItem(const QString& name, const QString& value) - : nam(name), val(value) { } + : name_(name), value_(value) { } - const QString& name() const { return nam; } - const QString& value() const { return val; } + const QString& name() const { return name_; } + const QString& value() const { return value_; } private: - QString nam; - QString val; + QString name_; + QString value_; }; class EnumNode : public LeafNode { public: - EnumNode(InnerNode* parent, const QString& name); + EnumNode(Aggregate* parent, const QString& name); virtual ~EnumNode() { } void addItem(const EnumItem& item); void setFlagsType(TypedefNode* typedeff); - bool hasItem(const QString &name) const { return names.contains(name); } + bool hasItem(const QString &name) const { return names_.contains(name); } + virtual bool isEnumType() const Q_DECL_OVERRIDE { return true; } - const QList<EnumItem>& items() const { return itms; } + const QList<EnumItem>& items() const { return items_; } Access itemAccess(const QString& name) const; - const TypedefNode* flagsType() const { return ft; } + const TypedefNode* flagsType() const { return flagsType_; } QString itemValue(const QString &name) const; private: - QList<EnumItem> itms; - QSet<QString> names; - const TypedefNode* ft; + QList<EnumItem> items_; + QSet<QString> names_; + const TypedefNode* flagsType_; }; class TypedefNode : public LeafNode { public: - TypedefNode(InnerNode* parent, const QString& name); + TypedefNode(Aggregate* parent, const QString& name); virtual ~TypedefNode() { } - const EnumNode* associatedEnum() const { return ae; } + const EnumNode* associatedEnum() const { return associatedEnum_; } private: - void setAssociatedEnum(const EnumNode* enume); + void setAssociatedEnum(const EnumNode* t); friend class EnumNode; - const EnumNode* ae; + const EnumNode* associatedEnum_; }; -inline void EnumNode::setFlagsType(TypedefNode* typedeff) +inline void EnumNode::setFlagsType(TypedefNode* t) { - ft = typedeff; - typedeff->setAssociatedEnum(this); + flagsType_ = t; + t->setAssociatedEnum(this); } @@ -826,21 +826,21 @@ public: Parameter& operator=(const Parameter& p); - void setName(const QString& name) { nam = name; } + void setName(const QString& name) { name_ = name; } - bool hasType() const { return lef.length() + rig.length() > 0; } - const QString& leftType() const { return lef; } - const QString& rightType() const { return rig; } - const QString& name() const { return nam; } - const QString& defaultValue() const { return def; } + bool hasType() const { return leftType_.length() + rightType_.length() > 0; } + const QString& leftType() const { return leftType_; } + const QString& rightType() const { return rightType_; } + const QString& name() const { return name_; } + const QString& defaultValue() const { return defaultValue_; } QString reconstruct(bool value = false) const; private: - QString lef; - QString rig; - QString nam; - QString def; + QString leftType_; + QString rightType_; + QString name_; + QString defaultValue_; }; class FunctionNode : public LeafNode @@ -855,35 +855,37 @@ public: MacroWithParams, MacroWithoutParams, Native }; - enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual }; + enum Virtualness { NonVirtual, NormalVirtual, PureVirtual }; - FunctionNode(InnerNode* parent, const QString &name); - FunctionNode(Type type, InnerNode* parent, const QString &name, bool attached); + FunctionNode(Aggregate* parent, const QString &name); + FunctionNode(NodeType type, Aggregate* parent, const QString &name, bool attached); virtual ~FunctionNode() { } - void setReturnType(const QString& returnType) { rt = returnType; } - void setParentPath(const QStringList& parentPath) { pp = parentPath; } - void setMetaness(Metaness metaness) { met = metaness; } - void setVirtualness(Virtualness virtualness); - void setConst(bool conste) { con = conste; } - void setStatic(bool statique) { sta = statique; } - void setOverload(bool overlode); - void setReimp(bool r); + void setReturnType(const QString& t) { returnType_ = t; } + void setParentPath(const QStringList& p) { parentPath_ = p; } + void setMetaness(Metaness t) { metaness_ = t; } + void setVirtualness(Virtualness v); + void setConst(bool b) { const_ = b; } + void setStatic(bool b) { static_ = b; } + unsigned char overloadNumber() const { return overloadNumber_; } + void setOverloadFlag(bool b) { overload_ = b; } + void setOverloadNumber(unsigned char n) { overloadNumber_ = n; } + void setReimplemented(bool b); void addParameter(const Parameter& parameter); inline void setParameters(const QList<Parameter>& parameters); void borrowParameterNames(const FunctionNode* source); void setReimplementedFrom(FunctionNode* from); - const QString& returnType() const { return rt; } - Metaness metaness() const { return met; } + const QString& returnType() const { return returnType_; } + Metaness metaness() const { return metaness_; } bool isMacro() const { - return met == MacroWithParams || met == MacroWithoutParams; + return metaness_ == MacroWithParams || metaness_ == MacroWithoutParams; } - Virtualness virtualness() const { return vir; } - bool isConst() const { return con; } - bool isStatic() const { return sta; } - bool isOverload() const { return ove; } - bool isReimp() const Q_DECL_OVERRIDE { return reimp; } + Virtualness virtualness() const { return virtualness_; } + bool isConst() const { return const_; } + bool isStatic() const { return static_; } + bool isOverload() const { return overload_; } + bool isReimplemented() const Q_DECL_OVERRIDE { return reimplemented_; } bool isFunction() const Q_DECL_OVERRIDE { return true; } virtual bool isQmlSignal() const Q_DECL_OVERRIDE { return (type() == Node::QmlSignal) && (genus() == Node::QML); @@ -903,17 +905,20 @@ public: virtual bool isJsMethod() const Q_DECL_OVERRIDE { return (type() == Node::QmlMethod) && (genus() == Node::JS); } - int overloadNumber() const; - const QList<Parameter>& parameters() const { return params; } - void clearParams() { params.clear(); } + const QList<Parameter>& parameters() const { return parameters_; } + void clearParams() { parameters_.clear(); } QStringList parameterNames() const; QString rawParameters(bool names = false, bool values = false) const; - const FunctionNode* reimplementedFrom() const { return rf; } - const QList<FunctionNode*> &reimplementedBy() const { return rb; } - const PropertyNode* associatedProperty() const { return ap; } - const QStringList& parentPath() const { return pp; } - - QStringList reconstructParams(bool values = false) const; + const FunctionNode* reimplementedFrom() const { return reimplementedFrom_; } + const QList<FunctionNode*> &reimplementedBy() const { return reimplementedBy_; } + const PropNodeList& associatedProperties() const { return associatedProperties_; } + const QStringList& parentPath() const { return parentPath_; } + bool hasAssociatedProperties() const { return !associatedProperties_.isEmpty(); } + bool hasOneAssociatedProperty() const { return (associatedProperties_.size() == 1); } + PropertyNode* firstAssociatedProperty() const { return associatedProperties_[0]; } + bool hasActiveAssociatedProperty() const; + + QStringList reconstructParameters(bool values = false) const; QString signature(bool values = false) const; virtual QString element() const Q_DECL_OVERRIDE { return parent()->name(); } virtual bool isAttached() const Q_DECL_OVERRIDE { return attached_; } @@ -934,25 +939,26 @@ public: void debug() const; private: - void setAssociatedProperty(PropertyNode* property); + void addAssociatedProperty(PropertyNode* property); - friend class InnerNode; + friend class Aggregate; friend class PropertyNode; - QString rt; - QStringList pp; - Metaness met; - Virtualness vir; - bool con : 1; - bool sta : 1; - bool ove : 1; - bool reimp: 1; + QString returnType_; + QStringList parentPath_; + Metaness metaness_; + Virtualness virtualness_; + bool const_ : 1; + bool static_ : 1; + bool reimplemented_: 1; bool attached_: 1; bool privateSignal_: 1; - QList<Parameter> params; - const FunctionNode* rf; - const PropertyNode* ap; - QList<FunctionNode*> rb; + bool overload_ : 1; + unsigned char overloadNumber_; + QList<Parameter> parameters_; + const FunctionNode* reimplementedFrom_; + PropNodeList associatedProperties_; + QList<FunctionNode*> reimplementedBy_; }; class PropertyNode : public LeafNode @@ -961,7 +967,7 @@ public: enum FunctionRole { Getter, Setter, Resetter, Notifier }; enum { NumFunctionRoles = Notifier + 1 }; - PropertyNode(InnerNode* parent, const QString& name); + PropertyNode(Aggregate* parent, const QString& name); virtual ~PropertyNode() { } virtual void setDataType(const QString& dataType) Q_DECL_OVERRIDE { type_ = dataType; } @@ -974,30 +980,31 @@ public: void setWritable(bool writable) { writable_ = toFlagValue(writable); } void setUser(bool user) { user_ = toFlagValue(user); } void setOverriddenFrom(const PropertyNode* baseProperty); - void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc = rdf; } - void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc = scrf; } - void setConstant() { cst = true; } - void setFinal() { fnl = true; } - void setRevision(int revision) { rev = revision; } + void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc_ = rdf; } + void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc_ = scrf; } + void setConstant() { const_ = true; } + void setFinal() { final_ = true; } + void setRevision(int revision) { revision_ = revision; } const QString &dataType() const { return type_; } QString qualifiedDataType() const; NodeList functions() const; - NodeList functions(FunctionRole role) const { return funcs[(int)role]; } + NodeList functions(FunctionRole role) const { return functions_[(int)role]; } NodeList getters() const { return functions(Getter); } NodeList setters() const { return functions(Setter); } NodeList resetters() const { return functions(Resetter); } NodeList notifiers() const { return functions(Notifier); } + FunctionRole role(const FunctionNode* fn) const; bool isStored() const { return fromFlagValue(stored_, storedDefault()); } bool isDesignable() const { return fromFlagValue(designable_, designableDefault()); } bool isScriptable() const { return fromFlagValue(scriptable_, scriptableDefault()); } - const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc; } - const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc; } + const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc_; } + const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc_; } bool isWritable() const { return fromFlagValue(writable_, writableDefault()); } bool isUser() const { return fromFlagValue(user_, userDefault()); } - bool isConstant() const { return cst; } - bool isFinal() const { return fnl; } - const PropertyNode* overriddenFrom() const { return overrides; } + bool isConstant() const { return const_; } + bool isFinal() const { return final_; } + const PropertyNode* overriddenFrom() const { return overrides_; } bool storedDefault() const { return true; } bool userDefault() const { return false; } @@ -1007,68 +1014,68 @@ public: private: QString type_; - QString runtimeDesFunc; - QString runtimeScrFunc; - NodeList funcs[NumFunctionRoles]; + QString runtimeDesFunc_; + QString runtimeScrFunc_; + NodeList functions_[NumFunctionRoles]; FlagValue stored_; FlagValue designable_; FlagValue scriptable_; FlagValue writable_; FlagValue user_; - bool cst; - bool fnl; - int rev; - const PropertyNode* overrides; + bool const_; + bool final_; + int revision_; + const PropertyNode* overrides_; }; -inline void FunctionNode::setParameters(const QList<Parameter> ¶meters) +inline void FunctionNode::setParameters(const QList<Parameter> &p) { - params = parameters; + parameters_ = p; } inline void PropertyNode::addFunction(FunctionNode* function, FunctionRole role) { - funcs[(int)role].append(function); - function->setAssociatedProperty(this); + functions_[(int)role].append(function); + function->addAssociatedProperty(this); } inline void PropertyNode::addSignal(FunctionNode* function, FunctionRole role) { - funcs[(int)role].append(function); - function->setAssociatedProperty(this); + functions_[(int)role].append(function); + function->addAssociatedProperty(this); } inline NodeList PropertyNode::functions() const { NodeList list; for (int i = 0; i < NumFunctionRoles; ++i) - list += funcs[i]; + list += functions_[i]; return list; } class VariableNode : public LeafNode { public: - VariableNode(InnerNode* parent, const QString &name); + VariableNode(Aggregate* parent, const QString &name); virtual ~VariableNode() { } - void setLeftType(const QString &leftType) { lt = leftType; } - void setRightType(const QString &rightType) { rt = rightType; } - void setStatic(bool statique) { sta = statique; } + void setLeftType(const QString &leftType) { lrftType_ = leftType; } + void setRightType(const QString &rightType) { rightType_ = rightType; } + void setStatic(bool b) { static_ = b; } - const QString &leftType() const { return lt; } - const QString &rightType() const { return rt; } - QString dataType() const { return lt + rt; } - bool isStatic() const { return sta; } + const QString &leftType() const { return lrftType_; } + const QString &rightType() const { return rightType_; } + QString dataType() const { return lrftType_ + rightType_; } + bool isStatic() const { return static_; } private: - QString lt; - QString rt; - bool sta; + QString lrftType_; + QString rightType_; + bool static_; }; -inline VariableNode::VariableNode(InnerNode* parent, const QString &name) - : LeafNode(Variable, parent, name), sta(false) +inline VariableNode::VariableNode(Aggregate* parent, const QString &name) + : LeafNode(Variable, parent, name), static_(false) { setGenus(Node::CPP); } @@ -1076,20 +1083,20 @@ inline VariableNode::VariableNode(InnerNode* parent, const QString &name) class DitaMapNode : public DocumentNode { public: - DitaMapNode(InnerNode* parent, const QString& name) + DitaMapNode(Aggregate* parent, const QString& name) : DocumentNode(parent, name, Node::Page, Node::DitaMapPage) { } virtual ~DitaMapNode() { } const DitaRefList& map() const { return doc().ditamap(); } }; -class CollectionNode : public InnerNode +class CollectionNode : public Aggregate { public: - CollectionNode(Type type, - InnerNode* parent, + CollectionNode(NodeType type, + Aggregate* parent, const QString& name, - Genus genus) : InnerNode(type, parent, name), seen_(false) + Genus genus) : Aggregate(type, parent, name), seen_(false) { setPageType(Node::OverviewPage); setGenus(genus); |