1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** 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_Primitives_H
53 #define Patternist_Primitives_H
56 #include <QtCore/QHash>
57 #include <QtCore/QUrl>
61 * @short Contains enumerators and typedefs applying
62 * for Patternist on a global scale, as well as central documentation.
66 * @short Contains Patternist, an XPath 2.0, XQuery 1.0 and XSL-T 2.0 implementation.
68 * @author Frans Englich <frans.englich@nokia.com>
77 * @short The namespace for the internal API of QtXmlPatterns
83 * @defgroup Patternist_cppWXSTypes C++ Primitives for W3C XML Schema Number Types
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.
93 * @author Frans Englich <frans.englich@nokia.com>
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.
101 * @ingroup Patternist_cppWXSTypes
103 typedef qreal xsDouble;
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.
110 * @ingroup Patternist_cppWXSTypes
112 typedef xsDouble xsFloat;
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.
119 * @ingroup Patternist_cppWXSTypes
121 typedef xsDouble xsDecimal;
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.
128 * @ingroup Patternist_cppWXSTypes
130 typedef qint64 xsInteger;
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.
137 * @ingroup Patternist_cppWXSTypes
139 typedef qint32 VariableSlotID;
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;
155 * Milliseconds. 1 equals 0.001 SecondProperty.
157 typedef qint16 MSecondProperty;
160 * The hour property of a zone offset. For example, -13 in the
161 * zone offset "-13:08".
163 typedef qint8 ZOHourProperty;
166 * The minute property of a zone offset. For example, -08 in the
167 * zone offset "-13:08".
169 typedef qint8 ZOMinuteProperty;
172 * The full zone offset in minutes.
174 typedef qint32 ZOTotal;
176 typedef xsDouble PatternPriority;
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.
183 typedef int ImportPrecedence;
186 * @short Similar to Qt::escape(), but also escapes apostrophes and quotes,
187 * such that the result is suitable as attribute content too.
189 * Since Qt::escape() is in QtGui, using it creates a dependency on that
190 * library. This function does not.
192 * The implementation resides in qpatternistlocale.cpp.
196 QString Q_AUTOTEST_EXPORT escape(const QString &input);