1 /* qdbuserror.h QDBusError object
3 * Copyright (C) 2005 Harald Fernengel <harry@kdevelop.org>
4 * Copyright (C) 2006 Trolltech AS. All rights reserved.
5 * Author: Thiago Macieira <thiago.macieira@trolltech.com>
7 * Licensed under the Academic Free License version 2.1
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software Foundation
21 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include "qdbusmacros.h"
29 #include <QtCore/qstring.h>
34 class QDBUS_EXPORT QDBusError
61 // don't use this one!
62 qKnownErrorsMax = InternalError
66 QDBusError(const DBusError *error = 0);
67 QDBusError(const QDBusMessage& msg);
68 QDBusError(KnownErrors error, const QString &message);
70 inline QString name() const { return nm; }
71 inline QString message() const { return msg; }
72 inline bool isValid() const { return !nm.isNull() && !msg.isNull(); }
74 inline bool operator==(KnownErrors error) const
75 { return code == error; }
82 inline bool operator==(QDBusError::KnownErrors p1, const QDBusError &p2)
84 inline bool operator!=(QDBusError::KnownErrors p1, const QDBusError &p2)
85 { return !(p2 == p1); }
86 inline bool operator!=(const QDBusError &p1, QDBusError::KnownErrors p2)
87 { return !(p1 == p2); }
90 QDebug operator<<(QDebug, const QDBusError &);