summaryrefslogtreecommitdiffstats
path: root/src/xmlpatterns/type/qschematype_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlpatterns/type/qschematype_p.h')
-rw-r--r--src/xmlpatterns/type/qschematype_p.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/xmlpatterns/type/qschematype_p.h b/src/xmlpatterns/type/qschematype_p.h
index 38ed9b6a49..eaac28a899 100644
--- a/src/xmlpatterns/type/qschematype_p.h
+++ b/src/xmlpatterns/type/qschematype_p.h
@@ -57,6 +57,7 @@
#include "qxmlname.h"
template<typename N, typename M> class QHash;
+template<typename N> class QList;
QT_BEGIN_HEADER
@@ -80,6 +81,7 @@ namespace QPatternist
typedef QExplicitlySharedDataPointer<SchemaType> Ptr;
typedef QHash<QXmlName, SchemaType::Ptr> Hash;
+ typedef QList<SchemaType::Ptr> List;
/**
* Schema types are divided into different categories such as
@@ -117,6 +119,18 @@ namespace QPatternist
NoDerivation = 16
};
+ /**
+ * Describes the derivation constraints that are given by the 'final' or 'block' attributes.
+ */
+ enum DerivationConstraint
+ {
+ RestrictionConstraint = 1,
+ ExtensionConstraint = 2,
+ ListConstraint = 4,
+ UnionConstraint = 8
+ };
+ Q_DECLARE_FLAGS(DerivationConstraints, DerivationConstraint)
+
SchemaType();
virtual ~SchemaType();
@@ -137,6 +151,11 @@ namespace QPatternist
virtual DerivationMethod derivationMethod() const = 0;
/**
+ * Determines what derivation constraints exists for the type.
+ */
+ virtual DerivationConstraints derivationConstraints() const = 0;
+
+ /**
* Determines whether the type is an abstract type.
*
* @note It is important a correct value is returned, since
@@ -202,7 +221,7 @@ namespace QPatternist
* @note Do not re-implement this function, but instead override category()
* and let it return an appropriate value.
*/
- bool isSimpleType() const;
+ virtual bool isSimpleType() const;
/**
* Determines whether the type is a complex type, by introspecting
@@ -211,8 +230,15 @@ namespace QPatternist
* @note Do not re-implement this function, but instead override category()
* and let it return an appropriate value.
*/
- bool isComplexType() const;
+ virtual bool isComplexType() const;
+
+ /**
+ * Returns whether the value has been defined by a schema (is not a built in type).
+ */
+ virtual bool isDefinedBySchema() const;
};
+
+ Q_DECLARE_OPERATORS_FOR_FLAGS(SchemaType::DerivationConstraints)
}
QT_END_NAMESPACE