Line data Source code
1 : // Snap Websites Servers -- handle messages for QXmlQuery
2 : // Copyright (c) 2014-2019 Made to Order Software Corp. All Rights Reserved
3 : //
4 : // This program is free software; you can redistribute it and/or modify
5 : // it under the terms of the GNU General Public License as published by
6 : // the Free Software Foundation; either version 2 of the License, or
7 : // (at your option) any later version.
8 : //
9 : // This program is distributed in the hope that it will be useful,
10 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 : // GNU General Public License for more details.
13 : //
14 : // You should have received a copy of the GNU General Public License
15 : // along with this program; if not, write to the Free Software
16 : // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 : #pragma once
18 :
19 : #include <QAbstractMessageHandler>
20 :
21 : namespace snap
22 : {
23 :
24 0 : class QMessageHandler : public QAbstractMessageHandler
25 : {
26 : public:
27 : QMessageHandler(QObject * parent_object = nullptr);
28 :
29 0 : void set_xsl(QString const & xsl) { f_xsl = xsl; }
30 0 : void set_doc(QString const & doc) { f_doc = doc; }
31 : QtMsgType get_error_type() const { return f_error_type; }
32 : QString const & get_error_description() const { return f_error_description; }
33 0 : bool had_msg() const { return f_had_msg; }
34 0 : bool has_entities() const { return f_has_entities; }
35 :
36 : protected:
37 : virtual void handleMessage(QtMsgType type, QString const & description, QUrl const & identifier, QSourceLocation const & sourceLocation);
38 :
39 : private:
40 : QString f_xsl = QString();
41 : QString f_doc = QString();
42 : QString f_error_description = QString();
43 : QtMsgType f_error_type = QtDebugMsg;
44 : bool f_had_msg = false;
45 : bool f_has_entities = false;
46 : };
47 :
48 : } // namespace snap
49 : // vim: ts=4 sw=4 et
|