| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtXmlPatterns module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | // |
| 41 | // W A R N I N G |
| 42 | // ------------- |
| 43 | // |
| 44 | // This file is not part of the Qt API. It exists purely as an |
| 45 | // implementation detail. This header file may change from version to |
| 46 | // version without notice, or even be removed. |
| 47 | // |
| 48 | // We mean it. |
| 49 | |
| 50 | #ifndef Patternist_CommonSequenceTypes_H |
| 51 | #define Patternist_CommonSequenceTypes_H |
| 52 | |
| 53 | #include <private/qemptysequencetype_p.h> |
| 54 | #include <private/qnonetype_p.h> |
| 55 | |
| 56 | QT_BEGIN_NAMESPACE |
| 57 | |
| 58 | namespace QPatternist |
| 59 | { |
| 60 | /** |
| 61 | * @short Provides access to singleton instances of SequenceType sub-classes. |
| 62 | * |
| 63 | * @ingroup Patternist_types |
| 64 | * @author Frans Englich <frans.englich@nokia.com> |
| 65 | */ |
| 66 | class Q_AUTOTEST_EXPORT CommonSequenceTypes |
| 67 | { |
| 68 | public: |
| 69 | /** |
| 70 | * <tt>xs:anyAtomicType?</tt> |
| 71 | */ |
| 72 | static const SequenceType::Ptr ZeroOrOneAtomicType; |
| 73 | |
| 74 | /** |
| 75 | * <tt>xs:anyAtomicType</tt> |
| 76 | */ |
| 77 | static const SequenceType::Ptr ExactlyOneAtomicType; |
| 78 | |
| 79 | /** |
| 80 | * <tt>xs:anyAtomicType*</tt> |
| 81 | */ |
| 82 | static const SequenceType::Ptr ZeroOrMoreAtomicTypes; |
| 83 | |
| 84 | /** |
| 85 | * <tt>item()</tt> |
| 86 | */ |
| 87 | static const SequenceType::Ptr ExactlyOneItem; |
| 88 | |
| 89 | /** |
| 90 | * <tt>item()*</tt> |
| 91 | */ |
| 92 | static const SequenceType::Ptr ZeroOrMoreItems; |
| 93 | |
| 94 | /** |
| 95 | * <tt>item()?</tt> |
| 96 | */ |
| 97 | static const SequenceType::Ptr ZeroOrOneItem; |
| 98 | |
| 99 | /** |
| 100 | * <tt>item()+</tt> |
| 101 | */ |
| 102 | static const SequenceType::Ptr OneOrMoreItems; |
| 103 | |
| 104 | /** |
| 105 | * The empty sequence, <tt>empty-sequence()</tt>. |
| 106 | */ |
| 107 | static const EmptySequenceType::Ptr Empty; |
| 108 | |
| 109 | /** |
| 110 | * The special type @c none. Used for the function <tt>fn:error()</tt>, for example. |
| 111 | */ |
| 112 | static const NoneType::Ptr None; |
| 113 | |
| 114 | /** |
| 115 | * <tt>xs:anyURI</tt> |
| 116 | */ |
| 117 | static const SequenceType::Ptr ExactlyOneAnyURI; |
| 118 | |
| 119 | /** |
| 120 | * <tt>xs:boolean</tt> |
| 121 | */ |
| 122 | static const SequenceType::Ptr ExactlyOneBoolean; |
| 123 | |
| 124 | /** |
| 125 | * <tt>xs:boolean?</tt> |
| 126 | */ |
| 127 | static const SequenceType::Ptr ZeroOrOneBoolean; |
| 128 | |
| 129 | /** |
| 130 | * <tt>xs:untypedAtomic</tt> |
| 131 | */ |
| 132 | static const SequenceType::Ptr ExactlyOneUntypedAtomic; |
| 133 | |
| 134 | /** |
| 135 | * <tt>xs:integer</tt> |
| 136 | */ |
| 137 | static const SequenceType::Ptr ExactlyOneInteger; |
| 138 | |
| 139 | /** |
| 140 | * <tt>xs:integer?</tt> |
| 141 | */ |
| 142 | static const SequenceType::Ptr ZeroOrOneInteger; |
| 143 | |
| 144 | /** |
| 145 | * <tt>xs:decimal?</tt> |
| 146 | */ |
| 147 | static const SequenceType::Ptr ZeroOrOneDecimal; |
| 148 | |
| 149 | /** |
| 150 | * <tt>xs:integer*</tt> |
| 151 | */ |
| 152 | static const SequenceType::Ptr ZeroOrMoreIntegers; |
| 153 | |
| 154 | /** |
| 155 | * <tt>xs:double</tt> |
| 156 | */ |
| 157 | static const SequenceType::Ptr ExactlyOneDouble; |
| 158 | |
| 159 | /** |
| 160 | * <tt>xs:decimal</tt> |
| 161 | */ |
| 162 | static const SequenceType::Ptr ExactlyOneDecimal; |
| 163 | |
| 164 | /** |
| 165 | * <tt>xs:float</tt> |
| 166 | */ |
| 167 | static const SequenceType::Ptr ExactlyOneFloat; |
| 168 | |
| 169 | /** |
| 170 | * <tt>xs:QName</tt> |
| 171 | */ |
| 172 | static const SequenceType::Ptr ExactlyOneQName; |
| 173 | |
| 174 | /** |
| 175 | * <tt>xs:string</tt> |
| 176 | */ |
| 177 | static const SequenceType::Ptr ExactlyOneString; |
| 178 | |
| 179 | /** |
| 180 | * <tt>xs:string?</tt> |
| 181 | */ |
| 182 | static const SequenceType::Ptr ZeroOrOneString; |
| 183 | |
| 184 | /** |
| 185 | * <tt>xs:string*</tt> |
| 186 | */ |
| 187 | static const SequenceType::Ptr ZeroOrMoreStrings; |
| 188 | |
| 189 | /** |
| 190 | * <tt>xs:NCName?</tt> |
| 191 | */ |
| 192 | static const SequenceType::Ptr ZeroOrOneNCName; |
| 193 | |
| 194 | /** |
| 195 | * <tt>xs:NCName</tt> |
| 196 | */ |
| 197 | static const SequenceType::Ptr ExactlyOneNCName; |
| 198 | |
| 199 | /** |
| 200 | * <tt>xs:QName?</tt> |
| 201 | */ |
| 202 | static const SequenceType::Ptr ZeroOrOneQName; |
| 203 | |
| 204 | /** |
| 205 | * The artificial type in XPath 2.0 that covers @c xs:double, @c xs:float, |
| 206 | * @c xs:decimal, with cardinality zero or one. |
| 207 | * |
| 208 | * @see <a href="http://www.w3.org/TR/xpath20/#dt-numeric">XML Path Language |
| 209 | * (XPath) 2.0, definition for Numeric</a> |
| 210 | * @see <a href="http://www.w3.org/TR/xpath-functions/#func-signatures">XQuery 1.0 |
| 211 | * and XPath 2.0 Functions and Operators, 1.3 Function Signatures and Descriptions</a> |
| 212 | * @see BuiltinTypes::numeric |
| 213 | */ |
| 214 | static const SequenceType::Ptr ZeroOrOneNumeric; |
| 215 | |
| 216 | /** |
| 217 | * @c numeric |
| 218 | */ |
| 219 | static const SequenceType::Ptr ExactlyOneNumeric; |
| 220 | |
| 221 | /** |
| 222 | * <tt>node()?</tt> |
| 223 | */ |
| 224 | static const SequenceType::Ptr ZeroOrOneNode; |
| 225 | |
| 226 | /** |
| 227 | * <tt>node()</tt> |
| 228 | */ |
| 229 | static const SequenceType::Ptr ExactlyOneNode; |
| 230 | |
| 231 | /** |
| 232 | * <tt>node()*</tt> |
| 233 | */ |
| 234 | static const SequenceType::Ptr ZeroOrMoreNodes; |
| 235 | |
| 236 | /** |
| 237 | * <tt>element()</tt> |
| 238 | */ |
| 239 | static const SequenceType::Ptr ExactlyOneElement; |
| 240 | |
| 241 | /** |
| 242 | * <tt>processing-instruction()</tt> |
| 243 | */ |
| 244 | static const SequenceType::Ptr ExactlyOneProcessingInstruction; |
| 245 | |
| 246 | /** |
| 247 | * <tt>attribute()</tt> |
| 248 | */ |
| 249 | static const SequenceType::Ptr ExactlyOneAttribute; |
| 250 | |
| 251 | /** |
| 252 | * <tt>text()</tt> |
| 253 | */ |
| 254 | static const SequenceType::Ptr ExactlyOneTextNode; |
| 255 | |
| 256 | /** |
| 257 | * <tt>text()?</tt> |
| 258 | */ |
| 259 | static const SequenceType::Ptr ZeroOrOneTextNode; |
| 260 | |
| 261 | /** |
| 262 | * <tt>comment()</tt> |
| 263 | */ |
| 264 | static const SequenceType::Ptr ; |
| 265 | |
| 266 | /** |
| 267 | * <tt>element()*</tt> |
| 268 | */ |
| 269 | static const SequenceType::Ptr ZeroOrMoreElements; |
| 270 | |
| 271 | /** |
| 272 | * <tt>document-node()?</tt> |
| 273 | */ |
| 274 | static const SequenceType::Ptr ZeroOrOneDocumentNode; |
| 275 | |
| 276 | /** |
| 277 | * <tt>document-node()</tt> |
| 278 | */ |
| 279 | static const SequenceType::Ptr ExactlyOneDocumentNode; |
| 280 | |
| 281 | /** |
| 282 | * <tt>document-node()+</tt> |
| 283 | */ |
| 284 | static const SequenceType::Ptr OneOrMoreDocumentNodes; |
| 285 | |
| 286 | /** |
| 287 | * Identifiers all values which the Effective %Boolean Value |
| 288 | * can be extracted from. |
| 289 | */ |
| 290 | static const SequenceType::Ptr EBV; |
| 291 | |
| 292 | /** |
| 293 | * <tt>xs:anyURI?</tt> |
| 294 | */ |
| 295 | static const SequenceType::Ptr ZeroOrOneAnyURI; |
| 296 | |
| 297 | /** |
| 298 | * <tt>xs:hexBinary</tt> |
| 299 | */ |
| 300 | static const SequenceType::Ptr ExactlyOneHexBinary; |
| 301 | |
| 302 | /** |
| 303 | * <tt>xs:base64Binary</tt> |
| 304 | */ |
| 305 | static const SequenceType::Ptr ExactlyOneBase64Binary; |
| 306 | |
| 307 | /** |
| 308 | * <tt>xs:date</tt> |
| 309 | */ |
| 310 | static const SequenceType::Ptr ExactlyOneDate; |
| 311 | |
| 312 | /** |
| 313 | * <tt>xs:dateTime</tt> |
| 314 | */ |
| 315 | static const SequenceType::Ptr ExactlyOneDateTime; |
| 316 | |
| 317 | /** |
| 318 | * <tt>xs:dayTimeDuration</tt> |
| 319 | */ |
| 320 | static const SequenceType::Ptr ExactlyOneDayTimeDuration; |
| 321 | |
| 322 | /** |
| 323 | * <tt>xs:duration</tt> |
| 324 | */ |
| 325 | static const SequenceType::Ptr ExactlyOneDuration; |
| 326 | |
| 327 | /** |
| 328 | * <tt>xs:gDay</tt> |
| 329 | */ |
| 330 | static const SequenceType::Ptr ExactlyOneGDay; |
| 331 | |
| 332 | /** |
| 333 | * <tt>xs:gMonth</tt> |
| 334 | */ |
| 335 | static const SequenceType::Ptr ExactlyOneGMonth; |
| 336 | |
| 337 | /** |
| 338 | * <tt>xs:gMonthDay</tt> |
| 339 | */ |
| 340 | static const SequenceType::Ptr ExactlyOneGMonthDay; |
| 341 | |
| 342 | /** |
| 343 | * <tt>xs:gYear</tt> |
| 344 | */ |
| 345 | static const SequenceType::Ptr ExactlyOneGYear; |
| 346 | |
| 347 | /** |
| 348 | * <tt>xs:gYearMonth</tt> |
| 349 | */ |
| 350 | static const SequenceType::Ptr ExactlyOneGYearMonth; |
| 351 | |
| 352 | /** |
| 353 | * <tt>xs:yearMonthDuration</tt> |
| 354 | */ |
| 355 | static const SequenceType::Ptr ExactlyOneYearMonthDuration; |
| 356 | |
| 357 | /** |
| 358 | * <tt>xs:time</tt> |
| 359 | */ |
| 360 | static const SequenceType::Ptr ExactlyOneTime; |
| 361 | |
| 362 | /** |
| 363 | * <tt>xs:time?</tt> |
| 364 | */ |
| 365 | static const SequenceType::Ptr ZeroOrOneDate; |
| 366 | |
| 367 | /** |
| 368 | * <tt>xs:dateTime?</tt> |
| 369 | */ |
| 370 | static const SequenceType::Ptr ZeroOrOneDateTime; |
| 371 | |
| 372 | /** |
| 373 | * <tt>xs:dayTimeDuration?</tt> |
| 374 | */ |
| 375 | static const SequenceType::Ptr ZeroOrOneDayTimeDuration; |
| 376 | |
| 377 | /** |
| 378 | * <tt>xs:duration?</tt> |
| 379 | */ |
| 380 | static const SequenceType::Ptr ZeroOrOneDuration; |
| 381 | |
| 382 | /** |
| 383 | * <tt>xs:time?</tt> |
| 384 | */ |
| 385 | static const SequenceType::Ptr ZeroOrOneTime; |
| 386 | |
| 387 | /** |
| 388 | * <tt>xs:yearMonthDuration?</tt> |
| 389 | */ |
| 390 | static const SequenceType::Ptr ZeroOrOneYearMonthDuration; |
| 391 | |
| 392 | private: |
| 393 | /** |
| 394 | * The constructor is private and has no implementation, |
| 395 | * because this class is not meant to be instantiated. |
| 396 | * |
| 397 | * It should only be used via its static members. |
| 398 | */ |
| 399 | inline CommonSequenceTypes(); |
| 400 | |
| 401 | Q_DISABLE_COPY(CommonSequenceTypes) |
| 402 | }; |
| 403 | } |
| 404 | |
| 405 | QT_END_NAMESPACE |
| 406 | |
| 407 | #endif |
| 408 | |
| 409 | |