6e123e3bf2fa1129daae1c77843ea9aba13f8a10
[profile/ivi/qtxmlpatterns.git] / src / xmlpatterns / type / qprimitives_p.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
7 **
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.
16 **
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.
20 **
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.
28 **
29 ** Other Usage
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.
32 **
33 **
34 **
35 **
36 **
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