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_CommonSequenceTypes_H
53 #define Patternist_CommonSequenceTypes_H
55 #include "qemptysequencetype_p.h"
56 #include "qnonetype_p.h"
65 * @short Provides access to singleton instances of SequenceType sub-classes.
67 * @ingroup Patternist_types
68 * @author Frans Englich <frans.englich@nokia.com>
70 class Q_AUTOTEST_EXPORT CommonSequenceTypes
74 * <tt>xs:anyAtomicType?</tt>
76 static const SequenceType::Ptr ZeroOrOneAtomicType;
79 * <tt>xs:anyAtomicType</tt>
81 static const SequenceType::Ptr ExactlyOneAtomicType;
84 * <tt>xs:anyAtomicType*</tt>
86 static const SequenceType::Ptr ZeroOrMoreAtomicTypes;
91 static const SequenceType::Ptr ExactlyOneItem;
96 static const SequenceType::Ptr ZeroOrMoreItems;
101 static const SequenceType::Ptr ZeroOrOneItem;
106 static const SequenceType::Ptr OneOrMoreItems;
109 * The empty sequence, <tt>empty-sequence()</tt>.
111 static const EmptySequenceType::Ptr Empty;
114 * The special type @c none. Used for the function <tt>fn:error()</tt>, for example.
116 static const NoneType::Ptr None;
121 static const SequenceType::Ptr ExactlyOneAnyURI;
124 * <tt>xs:boolean</tt>
126 static const SequenceType::Ptr ExactlyOneBoolean;
129 * <tt>xs:boolean?</tt>
131 static const SequenceType::Ptr ZeroOrOneBoolean;
134 * <tt>xs:untypedAtomic</tt>
136 static const SequenceType::Ptr ExactlyOneUntypedAtomic;
139 * <tt>xs:integer</tt>
141 static const SequenceType::Ptr ExactlyOneInteger;
144 * <tt>xs:integer?</tt>
146 static const SequenceType::Ptr ZeroOrOneInteger;
149 * <tt>xs:decimal?</tt>
151 static const SequenceType::Ptr ZeroOrOneDecimal;
154 * <tt>xs:integer*</tt>
156 static const SequenceType::Ptr ZeroOrMoreIntegers;
161 static const SequenceType::Ptr ExactlyOneDouble;
164 * <tt>xs:decimal</tt>
166 static const SequenceType::Ptr ExactlyOneDecimal;
171 static const SequenceType::Ptr ExactlyOneFloat;
176 static const SequenceType::Ptr ExactlyOneQName;
181 static const SequenceType::Ptr ExactlyOneString;
184 * <tt>xs:string?</tt>
186 static const SequenceType::Ptr ZeroOrOneString;
189 * <tt>xs:string*</tt>
191 static const SequenceType::Ptr ZeroOrMoreStrings;
194 * <tt>xs:NCName?</tt>
196 static const SequenceType::Ptr ZeroOrOneNCName;
201 static const SequenceType::Ptr ExactlyOneNCName;
206 static const SequenceType::Ptr ZeroOrOneQName;
209 * The artificial type in XPath 2.0 that covers @c xs:double, @c xs:float,
210 * @c xs:decimal, with cardinality zero or one.
212 * @see <a href="http://www.w3.org/TR/xpath20/#dt-numeric">XML Path Language
213 * (XPath) 2.0, definition for Numeric</a>
214 * @see <a href="http://www.w3.org/TR/xpath-functions/#func-signatures">XQuery 1.0
215 * and XPath 2.0 Functions and Operators, 1.3 Function Signatures and Descriptions</a>
216 * @see BuiltinTypes::numeric
218 static const SequenceType::Ptr ZeroOrOneNumeric;
223 static const SequenceType::Ptr ExactlyOneNumeric;
228 static const SequenceType::Ptr ZeroOrOneNode;
233 static const SequenceType::Ptr ExactlyOneNode;
238 static const SequenceType::Ptr ZeroOrMoreNodes;
243 static const SequenceType::Ptr ExactlyOneElement;
246 * <tt>processing-instruction()</tt>
248 static const SequenceType::Ptr ExactlyOneProcessingInstruction;
251 * <tt>attribute()</tt>
253 static const SequenceType::Ptr ExactlyOneAttribute;
258 static const SequenceType::Ptr ExactlyOneTextNode;
263 static const SequenceType::Ptr ZeroOrOneTextNode;
268 static const SequenceType::Ptr ExactlyOneComment;
271 * <tt>element()*</tt>
273 static const SequenceType::Ptr ZeroOrMoreElements;
276 * <tt>document-node()?</tt>
278 static const SequenceType::Ptr ZeroOrOneDocumentNode;
281 * <tt>document-node()</tt>
283 static const SequenceType::Ptr ExactlyOneDocumentNode;
286 * <tt>document-node()+</tt>
288 static const SequenceType::Ptr OneOrMoreDocumentNodes;
291 * Identifiers all values which the Effective %Boolean Value
292 * can be extracted from.
294 static const SequenceType::Ptr EBV;
297 * <tt>xs:anyURI?</tt>
299 static const SequenceType::Ptr ZeroOrOneAnyURI;
302 * <tt>xs:hexBinary</tt>
304 static const SequenceType::Ptr ExactlyOneHexBinary;
307 * <tt>xs:base64Binary</tt>
309 static const SequenceType::Ptr ExactlyOneBase64Binary;
314 static const SequenceType::Ptr ExactlyOneDate;
317 * <tt>xs:dateTime</tt>
319 static const SequenceType::Ptr ExactlyOneDateTime;
322 * <tt>xs:dayTimeDuration</tt>
324 static const SequenceType::Ptr ExactlyOneDayTimeDuration;
327 * <tt>xs:duration</tt>
329 static const SequenceType::Ptr ExactlyOneDuration;
334 static const SequenceType::Ptr ExactlyOneGDay;
339 static const SequenceType::Ptr ExactlyOneGMonth;
342 * <tt>xs:gMonthDay</tt>
344 static const SequenceType::Ptr ExactlyOneGMonthDay;
349 static const SequenceType::Ptr ExactlyOneGYear;
352 * <tt>xs:gYearMonth</tt>
354 static const SequenceType::Ptr ExactlyOneGYearMonth;
357 * <tt>xs:yearMonthDuration</tt>
359 static const SequenceType::Ptr ExactlyOneYearMonthDuration;
364 static const SequenceType::Ptr ExactlyOneTime;
369 static const SequenceType::Ptr ZeroOrOneDate;
372 * <tt>xs:dateTime?</tt>
374 static const SequenceType::Ptr ZeroOrOneDateTime;
377 * <tt>xs:dayTimeDuration?</tt>
379 static const SequenceType::Ptr ZeroOrOneDayTimeDuration;
382 * <tt>xs:duration?</tt>
384 static const SequenceType::Ptr ZeroOrOneDuration;
389 static const SequenceType::Ptr ZeroOrOneTime;
392 * <tt>xs:yearMonthDuration?</tt>
394 static const SequenceType::Ptr ZeroOrOneYearMonthDuration;
398 * The constructor is private and has no implementation,
399 * because this class is not meant to be instantiated.
401 * It should only be used via its static members.
403 inline CommonSequenceTypes();
405 Q_DISABLE_COPY(CommonSequenceTypes)