Qt 4.8
qreportcontext_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
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 Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/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 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
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_ReportContext_H
53 #define Patternist_ReportContext_H
54 
55 #include <QSharedData>
56 #include <QAbstractUriResolver>
57 #include <QSourceLocation>
58 
59 #include "qnamepool_p.h"
60 #include "qxmlname.h"
61 
63 
65 
67 class QSourceLocation;
68 class QString;
69 
70 namespace QPatternist
71 {
72  class SourceLocationReflection;
73 
102  {
103  public:
105 
110 
117  inline ReportContext() {}
118 
119  virtual ~ReportContext();
120 
153  {
158 
165 
172 
178 
188 
195 
200 
205 
213 
219 
225 
233 
239 
244 
249 
256 
263 
269 
275 
281 
286 
292 
297 
304 
311 
318 
327 
332 
337 
343 
349 
355 
361 
368 
375 
384 
389 
396 
402 
408 
415 
420 
425 
433 
441 
448 
454 
461 
468 
479 
486 
491 
496 
501 
507 
512 
519 
525 
532 
539 
547 
552 
557 
564 
570 
577 
583 
589 
595 
603 
609 
616 
624 
632 
638 
645 
650 
655 
662 
668 
675 
680 
685 
692 
699 
706 
713 
720 
727 
733 
740 
747 
755 
760 
765 
770 
775 
780 
785 
790 
795 
800 
805 
810 
815 
820 
825 
830 
835 
840 
845 
850 
855 
860 
865 
870 
875 
881 
886 
892 
897 
902 
907 
912 
917 
922 
927 
932 
938 
946 
954 
961 
968 
974 
982 
990 
997 
1003 
1010 
1016 
1023 
1029 
1035 
1043 
1051 
1059 
1067 
1074 
1079 
1086 
1092 
1098 
1106 
1111 
1117 
1122 
1129 
1135 
1143 
1152 
1160 
1167 
1175 
1181 
1188 
1194 
1201 
1208 
1216 
1222 
1228 
1236 
1243 
1251 
1258 
1266 
1274 
1284 
1291 
1298 
1306 
1314 
1321 
1328 
1336 
1346 
1354 
1360 
1367 
1373 
1381 
1387 
1402 
1409 
1415 
1421 
1428 
1434 
1440 
1448 
1454 
1461 
1468 
1476 
1486 
1495 
1502 
1511 
1518 
1526 
1537 
1543 
1554 
1562 
1570 
1577 
1583 
1589 
1596 
1602 
1609 
1615 
1621 
1627 
1635 
1643 
1649 
1656 
1663 
1674 
1681 
1689 
1700 
1711 
1722 
1730 
1740 
1748 
1755 
1767 
1774 
1782 
1788 
1798 
1804 
1811 
1822 
1833 
1841 
1848 
1856 
1864 
1873 
1882 
1889 
1900 
1906 
1915 
1923 
1930 
1938 
1945 
1952 
1959 
1968 
1975 
1982 
1989 
1996 
2005 
2012 
2020 
2029 
2036 
2044 
2055 
2066 
2078 
2091 
2099 
2109 
2117 
2129 
2139 
2152 
2160 
2166 
2175 
2182 
2190 
2198 
2209 
2216 
2227 
2236 
2243 
2254 
2265 
2274 
2285 
2291 
2297 
2305 
2318 
2326 
2335 
2342  XTDE1665
2343 
2344  };
2345 
2357  void warning(const QString &message, const QSourceLocation &sourceLocation = QSourceLocation());
2358 
2372  void error(const QString &message,
2373  const ReportContext::ErrorCode errorCode,
2374  const QSourceLocation &sourceLocation);
2375 
2381  void error(const QString &message,
2382  const ReportContext::ErrorCode errorCode,
2383  const SourceLocationReflection *const reflection);
2384 
2389  void error(const QString &message,
2390  const QXmlName qName,
2391  const SourceLocationReflection *const r);
2392 
2398  virtual QAbstractMessageHandler *messageHandler() const = 0;
2399 
2400  virtual NamePool::Ptr namePool() const = 0;
2401 
2410  static QString codeToString(const ReportContext::ErrorCode errorCode);
2411 
2417  static QString codeFromURI(const QString &typeURI,
2418  QString &uri);
2419 
2423  virtual QSourceLocation locationFor(const SourceLocationReflection *const reflection) const = 0;
2424 
2428  QUrl resolveURI(const QUrl &relative,
2429  const QUrl &baseURI) const;
2430 
2439  virtual const QAbstractUriResolver *uriResolver() const = 0;
2440 
2441  private:
2442  void createError(const QString &description,
2443  const QtMsgType type,
2444  const QUrl &id,
2445  const QSourceLocation &sourceLocation) const;
2446  static inline QString finalizeDescription(const QString &desc);
2447  QSourceLocation lookupSourceLocation(const SourceLocationReflection *const ref) const;
2448 
2450  };
2451 
2457  typedef bool Exception;
2458 }
2459 
2461 
2463 
2464 #endif
bool Exception
This is the class type that is being thrown when a query error occur.
int type
Definition: qmetatype.cpp:239
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
#define error(msg)
QExplicitlySharedDataPointer< ReportContext > Ptr
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object...
Definition: qshareddata.h:136
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
QtMsgType
This enum describes the messages that can be sent to a message handler (QtMsgHandler).
Definition: qglobal.h:1881
The QAbstractUriResolver class is a callback interface for resolving Uniform Resource Identifiers...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The namespace for the internal API of QtXmlPatterns.
The QSourceLocation class identifies a location in a resource by URI, line, and column.
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Definition: qxmlname.h:58
The QAbstractMessageHandler class provides a callback interface for handling messages.
The QSharedData class is a base class for shared data objects.
Definition: qshareddata.h:56
static void messageHandler(QtMsgType type, const char *msg)
Definition: qtestlog.cpp:121
ReportContext()
Default constructors.
#define Q_AUTOTEST_EXPORT
Definition: qglobal.h:1510
QHash< const SourceLocationReflection *, QSourceLocation > LocationHash
A callback for reporting errors.
#define QT_END_HEADER
Definition: qglobal.h:137
Base class for all instances that represents something at a certain location.