1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
52 #ifndef Patternist_BuiltinAtomicTypes_H
53 #define Patternist_BuiltinAtomicTypes_H
55 #include "qatomiccasterlocators_p.h"
56 #include "qatomiccomparatorlocators_p.h"
57 #include "qbuiltinatomictype_p.h"
67 * @short Implements the type @c xs:anyAtomicType.
69 * @ingroup Patternist_types
70 * @author Frans Englich <frans.englich@nokia.com>
72 class AnyAtomicType : public BuiltinAtomicType
75 typedef QExplicitlySharedDataPointer<AnyAtomicType> Ptr;
77 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
78 const SourceLocationReflection *const reflection) const;
79 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
81 const SourceLocationReflection *const reflection) const;
82 virtual QXmlName name(const NamePool::Ptr &np) const;
83 virtual QString displayName(const NamePool::Ptr &np) const;
86 * Overridden to return <tt>item()</tt>.
88 * @returns BuiltinTypes::item
90 virtual ItemType::Ptr xdtSuperType() const;
93 * Overridden to return @c xs:anySimpleType.
95 * @returns BuiltinTypes::xsAnySimpleType
97 virtual SchemaType::Ptr wxsSuperType() const;
100 * Overridden to return @c true, @c xs:anyAtomicType is abstract.
102 * @returns always @c true
104 virtual bool isAbstract() const;
107 friend class BuiltinTypes;
112 * @short Implements the type @c xs:untypedAtomic.
114 * @ingroup Patternist_types
115 * @author Frans Englich <frans.englich@nokia.com>
117 class UntypedAtomicType : public BuiltinAtomicType
120 typedef QExplicitlySharedDataPointer<UntypedAtomicType> Ptr;
122 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
123 const SourceLocationReflection *const reflection) const;
124 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
126 const SourceLocationReflection *const reflection) const;
127 virtual QXmlName name(const NamePool::Ptr &np) const;
128 virtual QString displayName(const NamePool::Ptr &np) const;
131 friend class BuiltinTypes;
136 * @short Implements the type @c xs:dateTime.
138 * @ingroup Patternist_types
139 * @author Frans Englich <frans.englich@nokia.com>
141 class DateTimeType : public BuiltinAtomicType
144 typedef QExplicitlySharedDataPointer<DateTimeType> Ptr;
146 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
147 const SourceLocationReflection *const reflection) const;
148 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
150 const SourceLocationReflection *const reflection) const;
152 virtual QXmlName name(const NamePool::Ptr &np) const;
153 virtual QString displayName(const NamePool::Ptr &np) const;
155 friend class BuiltinTypes;
160 * @short Implements the type @c xs:date.
162 * @ingroup Patternist_types
163 * @author Frans Englich <frans.englich@nokia.com>
165 class DateType : public BuiltinAtomicType
168 typedef QExplicitlySharedDataPointer<DateType> Ptr;
170 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
171 const SourceLocationReflection *const reflection) const;
172 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
174 const SourceLocationReflection *const reflection) const;
175 virtual QXmlName name(const NamePool::Ptr &np) const;
176 virtual QString displayName(const NamePool::Ptr &np) const;
179 friend class BuiltinTypes;
184 * @short Implements the type @c xs:time.
186 * @ingroup Patternist_types
187 * @author Frans Englich <frans.englich@nokia.com>
189 class SchemaTimeType : public BuiltinAtomicType
192 typedef QExplicitlySharedDataPointer<SchemaTimeType> Ptr;
194 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
195 const SourceLocationReflection *const reflection) const;
196 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
198 const SourceLocationReflection *const reflection) const;
200 virtual QXmlName name(const NamePool::Ptr &np) const;
201 virtual QString displayName(const NamePool::Ptr &np) const;
204 friend class BuiltinTypes;
209 * @short Implements the type @c xs:duration.
211 * @ingroup Patternist_types
212 * @author Frans Englich <frans.englich@nokia.com>
214 class DurationType : public BuiltinAtomicType
217 typedef QExplicitlySharedDataPointer<DurationType> Ptr;
219 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
220 const SourceLocationReflection *const reflection) const;
221 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
223 const SourceLocationReflection *const reflection) const;
224 virtual QXmlName name(const NamePool::Ptr &np) const;
225 virtual QString displayName(const NamePool::Ptr &np) const;
228 friend class BuiltinTypes;
233 * @short Implements the type @c xs:yearMonthDuration.
235 * @ingroup Patternist_types
236 * @author Frans Englich <frans.englich@nokia.com>
238 class YearMonthDurationType : public BuiltinAtomicType
241 typedef QExplicitlySharedDataPointer<YearMonthDurationType> Ptr;
243 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
244 const SourceLocationReflection *const reflection) const;
245 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
247 const SourceLocationReflection *const reflection) const;
248 virtual QXmlName name(const NamePool::Ptr &np) const;
249 virtual QString displayName(const NamePool::Ptr &np) const;
252 friend class BuiltinTypes;
253 YearMonthDurationType();
257 * @short Implements the type @c xs:dayTimeDuration.
259 * @ingroup Patternist_types
260 * @author Frans Englich <frans.englich@nokia.com>
262 class DayTimeDurationType : public BuiltinAtomicType
265 typedef QExplicitlySharedDataPointer<DayTimeDurationType> Ptr;
267 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
268 const SourceLocationReflection *const reflection) const;
269 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
271 const SourceLocationReflection *const reflection) const;
272 virtual QXmlName name(const NamePool::Ptr &np) const;
273 virtual QString displayName(const NamePool::Ptr &np) const;
276 friend class BuiltinTypes;
277 DayTimeDurationType();
281 * @short Implements the type @c xs:double.
283 * @ingroup Patternist_types
284 * @author Frans Englich <frans.englich@nokia.com>
286 class DoubleType : public BuiltinAtomicType
289 typedef QExplicitlySharedDataPointer<DoubleType> Ptr;
291 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
292 const SourceLocationReflection *const reflection) const;
293 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
295 const SourceLocationReflection *const reflection) const;
296 virtual QXmlName name(const NamePool::Ptr &np) const;
297 virtual QString displayName(const NamePool::Ptr &np) const;
300 friend class BuiltinTypes;
305 * @short Implements the type @c xs:float.
307 * @ingroup Patternist_types
308 * @author Frans Englich <frans.englich@nokia.com>
310 class FloatType : public BuiltinAtomicType
313 typedef QExplicitlySharedDataPointer<FloatType> Ptr;
315 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
316 const SourceLocationReflection *const reflection) const;
317 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
319 const SourceLocationReflection *const reflection) const;
320 virtual QXmlName name(const NamePool::Ptr &np) const;
321 virtual QString displayName(const NamePool::Ptr &np) const;
325 friend class BuiltinTypes;
329 * @short Implements the type @c xs:decimal.
331 * @ingroup Patternist_types
332 * @author Frans Englich <frans.englich@nokia.com>
334 class DecimalType : public BuiltinAtomicType
337 typedef QExplicitlySharedDataPointer<DecimalType> Ptr;
339 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
340 const SourceLocationReflection *const reflection) const;
341 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
343 const SourceLocationReflection *const reflection) const;
344 virtual QXmlName name(const NamePool::Ptr &np) const;
345 virtual QString displayName(const NamePool::Ptr &np) const;
348 friend class BuiltinTypes;
353 * @short Implements the type @c xs:integer.
355 * IntegerType instances are used for representing all different xs:integer
356 * types. The purpose of this is that xs:integer sub-types must use the
357 * class, IntegerType, in order to use the correct behavior in call
358 * dispatch situations. That is, all xs:integer sub-types must use the
359 * same AtomicComparator as xs:integer itself uses, and that is achieved
362 * @ingroup Patternist_types
363 * @author Frans Englich <frans.englich@nokia.com>
365 class IntegerType : public BuiltinAtomicType
368 typedef QExplicitlySharedDataPointer<IntegerType> Ptr;
370 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
371 const SourceLocationReflection *const reflection) const;
372 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
374 const SourceLocationReflection *const reflection) const;
375 virtual QXmlName name(const NamePool::Ptr &np) const;
376 virtual QString displayName(const NamePool::Ptr &np) const;
379 friend class BuiltinTypes;
380 IntegerType(const AtomicType::Ptr &parentType,
381 const AtomicCasterLocator::Ptr &casterLocator);
384 template<TypeOfDerivedInteger derivedType>
385 class DerivedIntegerType : public IntegerType
388 using IntegerType::accept;
390 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &v,
391 const SourceLocationReflection *const r) const
393 return v->visit(this, r);
396 virtual QXmlName name(const NamePool::Ptr &np) const
400 case TypeByte: return np->allocateQName(StandardNamespaces::xs, QLatin1String("byte"));
401 case TypeInt: return np->allocateQName(StandardNamespaces::xs, QLatin1String("int"));
402 case TypeLong: return np->allocateQName(StandardNamespaces::xs, QLatin1String("long"));
403 case TypeNegativeInteger: return np->allocateQName(StandardNamespaces::xs, QLatin1String("negativeInteger"));
404 case TypeNonNegativeInteger: return np->allocateQName(StandardNamespaces::xs, QLatin1String("nonNegativeInteger"));
405 case TypeNonPositiveInteger: return np->allocateQName(StandardNamespaces::xs, QLatin1String("nonPositiveInteger"));
406 case TypePositiveInteger: return np->allocateQName(StandardNamespaces::xs, QLatin1String("positiveInteger"));
407 case TypeShort: return np->allocateQName(StandardNamespaces::xs, QLatin1String("short"));
408 case TypeUnsignedByte: return np->allocateQName(StandardNamespaces::xs, QLatin1String("unsignedByte"));
409 case TypeUnsignedInt: return np->allocateQName(StandardNamespaces::xs, QLatin1String("unsignedInt"));
410 case TypeUnsignedLong: return np->allocateQName(StandardNamespaces::xs, QLatin1String("unsignedLong"));
411 case TypeUnsignedShort: return np->allocateQName(StandardNamespaces::xs, QLatin1String("unsignedShort"));
414 Q_ASSERT_X(false, "DerivedIntegerType::name()", "Invalid value in instantiation.");
418 virtual QString displayName(const NamePool::Ptr &np) const
420 return np->displayName(name(np));
424 friend class BuiltinTypes;
426 DerivedIntegerType(const AtomicType::Ptr &parentType,
427 const AtomicCasterLocator::Ptr &casterLoc) : IntegerType(parentType, casterLoc)
434 * @short Implements the type @c xs:gYearMonth.
436 * @ingroup Patternist_types
437 * @author Frans Englich <frans.englich@nokia.com>
439 class GYearMonthType : public BuiltinAtomicType
442 typedef QExplicitlySharedDataPointer<GYearMonthType> Ptr;
444 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
445 const SourceLocationReflection *const reflection) const;
446 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
448 const SourceLocationReflection *const reflection) const;
449 virtual QXmlName name(const NamePool::Ptr &np) const;
450 virtual QString displayName(const NamePool::Ptr &np) const;
453 friend class BuiltinTypes;
458 * @short Implements the type @c xs:gYear.
460 * @ingroup Patternist_types
461 * @author Frans Englich <frans.englich@nokia.com>
463 class GYearType : public BuiltinAtomicType
466 typedef QExplicitlySharedDataPointer<GYearType> Ptr;
468 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
469 const SourceLocationReflection *const reflection) const;
470 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
472 const SourceLocationReflection *const reflection) const;
473 virtual QXmlName name(const NamePool::Ptr &np) const;
474 virtual QString displayName(const NamePool::Ptr &np) const;
477 friend class BuiltinTypes;
482 * @short Implements the type @c xs:gMonthDay.
484 * @ingroup Patternist_types
485 * @author Frans Englich <frans.englich@nokia.com>
487 class GMonthDayType : public BuiltinAtomicType
490 typedef QExplicitlySharedDataPointer<GMonthDayType> Ptr;
492 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
493 const SourceLocationReflection *const reflection) const;
494 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
496 const SourceLocationReflection *const reflection) const;
497 virtual QXmlName name(const NamePool::Ptr &np) const;
498 virtual QString displayName(const NamePool::Ptr &np) const;
501 friend class BuiltinTypes;
506 * @short Implements the type @c xs:gDay.
508 * @ingroup Patternist_types
509 * @author Frans Englich <frans.englich@nokia.com>
511 class GDayType : public BuiltinAtomicType
514 typedef QExplicitlySharedDataPointer<GDayType> Ptr;
516 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
517 const SourceLocationReflection *const reflection) const;
518 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
520 const SourceLocationReflection *const reflection) const;
521 virtual QXmlName name(const NamePool::Ptr &np) const;
522 virtual QString displayName(const NamePool::Ptr &np) const;
525 friend class BuiltinTypes;
530 * @short Implements the type @c xs:gMonth.
532 * @ingroup Patternist_types
533 * @author Frans Englich <frans.englich@nokia.com>
535 class GMonthType : public BuiltinAtomicType
538 typedef QExplicitlySharedDataPointer<GMonthType> Ptr;
540 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
541 const SourceLocationReflection *const reflection) const;
542 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
544 const SourceLocationReflection *const reflection) const;
545 virtual QXmlName name(const NamePool::Ptr &np) const;
546 virtual QString displayName(const NamePool::Ptr &np) const;
549 friend class BuiltinTypes;
554 * @short Implements the type @c xs:boolean.
556 * @ingroup Patternist_types
557 * @author Frans Englich <frans.englich@nokia.com>
559 class BooleanType : public BuiltinAtomicType
562 typedef QExplicitlySharedDataPointer<BooleanType> Ptr;
564 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
565 const SourceLocationReflection *const reflection) const;
566 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
568 const SourceLocationReflection *const reflection) const;
569 virtual QXmlName name(const NamePool::Ptr &np) const;
570 virtual QString displayName(const NamePool::Ptr &np) const;
573 friend class BuiltinTypes;
578 * @short Implements the type @c xs:base64Binary.
580 * @ingroup Patternist_types
581 * @author Frans Englich <frans.englich@nokia.com>
583 class Base64BinaryType : public BuiltinAtomicType
586 typedef QExplicitlySharedDataPointer<Base64BinaryType> Ptr;
588 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
589 const SourceLocationReflection *const reflection) const;
590 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
592 const SourceLocationReflection *const reflection) const;
593 virtual QXmlName name(const NamePool::Ptr &np) const;
594 virtual QString displayName(const NamePool::Ptr &np) const;
597 friend class BuiltinTypes;
602 * @short Implements the type @c xs:hexBinary.
604 * @ingroup Patternist_types
605 * @author Frans Englich <frans.englich@nokia.com>
607 class HexBinaryType : public BuiltinAtomicType
610 typedef QExplicitlySharedDataPointer<HexBinaryType> Ptr;
612 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
613 const SourceLocationReflection *const reflection) const;
614 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
616 const SourceLocationReflection *const reflection) const;
617 virtual QXmlName name(const NamePool::Ptr &np) const;
618 virtual QString displayName(const NamePool::Ptr &np) const;
621 friend class BuiltinTypes;
626 * @short Implements the type @c xs:anyURI.
628 * @ingroup Patternist_types
629 * @author Frans Englich <frans.englich@nokia.com>
631 class AnyURIType : public BuiltinAtomicType
634 typedef QExplicitlySharedDataPointer<AnyURIType> Ptr;
636 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
637 const SourceLocationReflection *const reflection) const;
638 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
640 const SourceLocationReflection *const reflection) const;
641 virtual QXmlName name(const NamePool::Ptr &np) const;
642 virtual QString displayName(const NamePool::Ptr &np) const;
645 friend class BuiltinTypes;
650 * @short Implements the type @c xs:QName.
652 * @ingroup Patternist_types
653 * @author Frans Englich <frans.englich@nokia.com>
655 class QNameType : public BuiltinAtomicType
658 typedef QExplicitlySharedDataPointer<QNameType> Ptr;
660 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
661 const SourceLocationReflection *const reflection) const;
662 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
664 const SourceLocationReflection *const reflection) const;
665 virtual QXmlName name(const NamePool::Ptr &np) const;
666 virtual QString displayName(const NamePool::Ptr &np) const;
669 friend class BuiltinTypes;
674 * Represents the xs:string type and all derived types of
675 * xs:string, such as xs:token.
677 * StringType instances are used for representing all different string
678 * types. The purpose of this is that xs:string sub-types must use the
679 * class, StringType, in order to use the correct behavior in call
680 * dispatch situations. That is, all xs:string sub-types must use the
681 * same AtomicComparator as xs:string itself uses, and that is achieved
684 * @ingroup Patternist_types
685 * @author Frans Englich <frans.englich@nokia.com>
687 class StringType : public BuiltinAtomicType
690 typedef QExplicitlySharedDataPointer<StringType> Ptr;
692 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
693 const SourceLocationReflection *const reflection) const;
694 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
696 const SourceLocationReflection *const reflection) const;
697 virtual QXmlName name(const NamePool::Ptr &np) const;
698 virtual QString displayName(const NamePool::Ptr &np) const;
701 friend class BuiltinTypes;
702 StringType(const AtomicType::Ptr &parentType,
703 const AtomicCasterLocator::Ptr &casterLoc);
706 template<TypeOfDerivedString derivedType>
707 class DerivedStringType : public StringType
710 using StringType::accept;
712 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &v,
713 const SourceLocationReflection *const r) const
715 return v->visit(this, r);
718 virtual QXmlName name(const NamePool::Ptr &np) const
722 case TypeString: return np->allocateQName(StandardNamespaces::xs, QLatin1String("string"));
723 case TypeNormalizedString: return np->allocateQName(StandardNamespaces::xs, QLatin1String("normalizedString"));
724 case TypeToken: return np->allocateQName(StandardNamespaces::xs, QLatin1String("token"));
725 case TypeLanguage: return np->allocateQName(StandardNamespaces::xs, QLatin1String("language"));
726 case TypeNMTOKEN: return np->allocateQName(StandardNamespaces::xs, QLatin1String("NMTOKEN"));
727 case TypeName: return np->allocateQName(StandardNamespaces::xs, QLatin1String("Name"));
728 case TypeNCName: return np->allocateQName(StandardNamespaces::xs, QLatin1String("NCName"));
729 case TypeID: return np->allocateQName(StandardNamespaces::xs, QLatin1String("ID"));
730 case TypeIDREF: return np->allocateQName(StandardNamespaces::xs, QLatin1String("IDREF"));
731 case TypeENTITY: return np->allocateQName(StandardNamespaces::xs, QLatin1String("ENTITY"));
734 Q_ASSERT_X(false, "DerivedStringType::name()", "Invalid value in instantiation.");
738 virtual QString displayName(const NamePool::Ptr &np) const
740 return np->displayName(name(np));
744 friend class BuiltinTypes;
746 DerivedStringType(const AtomicType::Ptr &parentType,
747 const AtomicCasterLocator::Ptr &casterLoc) : StringType(parentType, casterLoc)
754 * @short Implements the type @c xs:NOTATION.
756 * @ingroup Patternist_types
757 * @author Frans Englich <frans.englich@nokia.com>
759 class NOTATIONType : public BuiltinAtomicType
762 typedef QExplicitlySharedDataPointer<NOTATIONType> Ptr;
764 virtual AtomicTypeVisitorResult::Ptr accept(const AtomicTypeVisitor::Ptr &visitor,
765 const SourceLocationReflection *const reflection) const;
766 virtual AtomicTypeVisitorResult::Ptr accept(const ParameterizedAtomicTypeVisitor::Ptr &visitor,
768 const SourceLocationReflection *const reflection) const;
769 virtual QXmlName name(const NamePool::Ptr &np) const;
770 virtual QString displayName(const NamePool::Ptr &np) const;
773 * Overridden to return @c true, xs:NOTATION is abstract.
775 * @returns always @c true
777 virtual bool isAbstract() const;
780 friend class BuiltinTypes;