1 /**************************************************************************** 2 ** 3 ** Copyright (C) 2015 The Qt Company Ltd. 4 ** Contact: http://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 http://www.qt.io/terms-conditions. For further 15 ** information use the contact form at http://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 2.1 or version 3 as published by the Free 20 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 21 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 22 ** following information to ensure the GNU Lesser General Public License 23 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 24 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 25 ** 26 ** As a special exception, The Qt Company gives you certain additional 27 ** rights. These rights are described in The Qt Company LGPL Exception 28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 ** 30 ** GNU General Public License Usage 31 ** Alternatively, this file may be used under the terms of the GNU 32 ** General Public License version 3.0 as published by the Free Software 33 ** Foundation and appearing in the file LICENSE.GPL included in the 34 ** packaging of this file. Please review the following information to 35 ** ensure the GNU General Public License version 3.0 requirements will be 36 ** met: http://www.gnu.org/copyleft/gpl.html. 37 ** 38 ** $QT_END_LICENSE$ 39 ** 40 ****************************************************************************/ 41 42 // 43 // W A R N I N G 44 // ------------- 45 // 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. 49 // 50 // We mean it. 51 52 #ifndef Patternist_Primitives_H 53 #define Patternist_Primitives_H 54 55 #include <QtGlobal> 56 #include <QtCore/QHash> 57 #include <QtCore/QUrl> 58 59 /** 60 * @file 61 * @short Contains enumerators and typedefs applying 62 * for Patternist on a global scale, as well as central documentation. 63 */ 64 65 /** 66 * @short Contains Patternist, an XPath 2.0, XQuery 1.0 and XSL-T 2.0 implementation. 67 * 68 * @author Frans Englich <frans.englich@nokia.com> 69 */ 70 QT_BEGIN_HEADER 71 72 QT_BEGIN_NAMESPACE 73 74 class QString; 75 76 /** 77 * @short The namespace for the internal API of QtXmlPatterns 78 * @internal 79 */ 80 namespace QPatternist 81 { 82 /** 83 * @defgroup Patternist_cppWXSTypes C++ Primitives for W3C XML Schema Number Types 84 * 85 * The implementations of W3C XML Schema's(WXS) number types, more specifically 86 * their value spaces, must in the end be represented by primitive C++ types. 87 * In addition, there is an extensive range of functions and classes that in 88 * different ways deals with data that will end up as instances of the WXS 89 * types. For this reason, a set of typedefs for these primitives exists, that 90 * are used throughout the API. This ensures consistency, reduces the amount 91 * of conversions, and potentially precision loss in conversions. 92 * 93 * @author Frans Englich <frans.englich@nokia.com> 94 */ 95 96 /** 97 * This is the native C++ scalar type holding the value space 98 * for atomic values of type xs:double. Taking this type, xsDouble, 99 * as parameter, is the most efficient way to integrate with xs:double. 100 * 101 * @ingroup Patternist_cppWXSTypes 102 */ 103 typedef qreal xsDouble; 104 105 /** 106 * This is the native C++ scalar type holding the value space 107 * for atomic values of type xs:float. Taking this type, xsFloat, 108 * as parameter, is the most efficient way to integrate with xs:float. 109 * 110 * @ingroup Patternist_cppWXSTypes 111 */ 112 typedef xsDouble xsFloat; 113 114 /** 115 * This is the native C++ scalar type holding the value space 116 * for atomic values of type xs:decimal. Taking this type, xsDecimal, 117 * as parameter, is the most efficient way to integrate with xs:decimal. 118 * 119 * @ingroup Patternist_cppWXSTypes 120 */ 121 typedef xsDouble xsDecimal; 122 123 /** 124 * This is the native C++ scalar type holding the value space 125 * for atomic values of type xs:integer. Taking this type, xsInteger, 126 * as parameter, is the most efficient way to integrate with xs:integer. 127 * 128 * @ingroup Patternist_cppWXSTypes 129 */ 130 typedef qint64 xsInteger; 131 132 /** 133 * This is the native C++ scalar type holding the value space 134 * for atomic values of type xs:integer. Taking this type, xsInteger, 135 * as parameter, is the most efficient way to integrate with xs:integer. 136 * 137 * @ingroup Patternist_cppWXSTypes 138 */ 139 typedef qint32 VariableSlotID; 140 141 typedef qint32 DayCountProperty; 142 typedef qint32 HourCountProperty; 143 typedef qint32 MinuteCountProperty; 144 typedef qint32 MonthCountProperty; 145 typedef qint32 SecondCountProperty; 146 typedef qint64 MSecondCountProperty; 147 typedef qint32 SecondProperty; 148 typedef qint32 YearProperty; 149 typedef qint8 DayProperty; 150 typedef qint8 HourProperty; 151 typedef qint8 MinuteProperty; 152 typedef qint8 MonthProperty; 153 154 /** 155 * Milliseconds. 1 equals 0.001 SecondProperty. 156 */ 157 typedef qint16 MSecondProperty; 158 159 /** 160 * The hour property of a zone offset. For example, -13 in the 161 * zone offset "-13:08". 162 */ 163 typedef qint8 ZOHourProperty; 164 165 /** 166 * The minute property of a zone offset. For example, -08 in the 167 * zone offset "-13:08". 168 */ 169 typedef qint8 ZOMinuteProperty; 170 171 /** 172 * The full zone offset in minutes. 173 */ 174 typedef qint32 ZOTotal; 175 176 typedef xsDouble PatternPriority; 177 178 /** 179 * Signifies the import precedence of a template. For instance, the first 180 * stylesheet module has 1, the first import 2, and so forth. Smaller means 181 * higher import precedence. 0 is reserved for builtin templates. 182 */ 183 typedef int ImportPrecedence; 184 185 /** 186 * @short Similar to Qt::escape(), but also escapes apostrophes and quotes, 187 * such that the result is suitable as attribute content too. 188 * 189 * Since Qt::escape() is in QtGui, using it creates a dependency on that 190 * library. This function does not. 191 * 192 * The implementation resides in qpatternistlocale.cpp. 193 * 194 * @see Qt::escape() 195 */ 196 QString Q_AUTOTEST_EXPORT escape(const QString &input); 197 } 198 199 QT_END_NAMESPACE 200 201 QT_END_HEADER 202 203 #endif 204