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 ****************************************************************************/
45 #include <QtCore/QUrl>
46 #include <QtXmlPatterns/QAbstractXmlNodeModel>
47 #include <QtXmlPatterns/QAbstractXmlReceiver>
48 #include <QtXmlPatterns/QXmlNamePool>
54 class QAbstractMessageHandler;
55 class QAbstractUriResolver;
57 class QNetworkAccessManager;
60 class QXmlQueryPrivate;
61 class QXmlResultItems;
64 /* The members in the namespace QPatternistSDK are internal, not part of the public API, and
65 * unsupported. Using them leads to undefined behavior. */
66 namespace QPatternistSDK
73 class XsdSchemaParser;
74 class XsdValidatingInstanceReader;
78 class Q_XMLPATTERNS_EXPORT QXmlQuery
85 XmlSchema11IdentityConstraintSelector = 1024,
86 XmlSchema11IdentityConstraintField = 2048,
91 QXmlQuery(const QXmlQuery &other);
92 QXmlQuery(const QXmlNamePool &np);
93 QXmlQuery(QueryLanguage queryLanguage,
94 const QXmlNamePool &np = QXmlNamePool());
96 QXmlQuery &operator=(const QXmlQuery &other);
98 void setMessageHandler(QAbstractMessageHandler *messageHandler);
99 QAbstractMessageHandler *messageHandler() const;
101 void setQuery(const QString &sourceCode, const QUrl &documentURI = QUrl());
102 void setQuery(QIODevice *sourceCode, const QUrl &documentURI = QUrl());
103 void setQuery(const QUrl &queryURI, const QUrl &baseURI = QUrl());
105 QXmlNamePool namePool() const;
107 void bindVariable(const QXmlName &name, const QXmlItem &value);
108 void bindVariable(const QString &localName, const QXmlItem &value);
110 void bindVariable(const QXmlName &name, QIODevice *);
111 void bindVariable(const QString &localName, QIODevice *);
112 void bindVariable(const QXmlName &name, const QXmlQuery &query);
113 void bindVariable(const QString &localName, const QXmlQuery &query);
115 bool isValid() const;
117 void evaluateTo(QXmlResultItems *result) const;
118 bool evaluateTo(QAbstractXmlReceiver *callback) const;
119 bool evaluateTo(QStringList *target) const;
120 bool evaluateTo(QIODevice *target) const;
121 bool evaluateTo(QString *output) const;
123 void setUriResolver(const QAbstractUriResolver *resolver);
124 const QAbstractUriResolver *uriResolver() const;
126 void setFocus(const QXmlItem &item);
127 bool setFocus(const QUrl &documentURI);
128 bool setFocus(QIODevice *document);
129 bool setFocus(const QString &focus);
131 void setInitialTemplateName(const QXmlName &name);
132 void setInitialTemplateName(const QString &name);
133 QXmlName initialTemplateName() const;
135 void setNetworkAccessManager(QNetworkAccessManager *newManager);
136 QNetworkAccessManager *networkAccessManager() const;
138 QueryLanguage queryLanguage() const;
140 friend class QXmlName;
141 friend class QXmlSerializer;
142 friend class QPatternistSDK::TestCase;
143 friend class QPatternist::XsdSchemaParser;
144 friend class QPatternist::XsdValidatingInstanceReader;
145 friend class QPatternist::VariableLoader;
146 template<typename TInputType> friend bool setFocusHelper(QXmlQuery *const queryInstance,
147 const TInputType &focusValue);