DBus-1-TQt  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tqdbuserror.h
Go to the documentation of this file.
1 /* qdbuserror.h TQT_DBusError object
2  *
3  * Copyright (C) 2005 Harald Fernengel <harry@kdevelop.org>
4  * Copyright (C) 2005 Kevin Krammer <kevin.krammer@gmx.at>
5  *
6  * Licensed under the Academic Free License version 2.1
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21  * USA.
22  *
23  */
24 
25 #ifndef TQDBUSERROR_H
26 #define TQDBUSERROR_H
27 
28 #include "tqdbusmacros.h"
29 #include <tqstring.h>
30 
31 struct DBusError;
32 
41 {
42 public:
59  enum ErrorType
60  {
67 
77 
84 
89 
98 
105 
115 
125 
135 
142 
153 
160 
165 
175 
180 
187 
198 
205 
212 
219 
227 
242 
248  UserDefined
249  };
250 
254  TQT_DBusError();
255 
261  TQT_DBusError(const DBusError *error);
262 
271  TQT_DBusError(const TQString& error, const TQString& message);
272 
282  inline TQString name() const { return nm; }
283 
295  inline TQString message() const { return msg; }
296 
307  inline ErrorType type() const { return errorType; }
308 
316  inline bool dbusErrorSet() const { return m_dbusErrorSet; }
317 
321  inline void setDBUSError(bool err) const { m_dbusErrorSet = err; }
322 
331  bool isValid() const;
332 
340  static TQT_DBusError stdFailed(const TQString& message);
341 
349  static TQT_DBusError stdNoMemory(const TQString& message);
350 
358  static TQT_DBusError stdNoReply(const TQString& message);
359 
367  static TQT_DBusError stdIOError(const TQString& message);
368 
376  static TQT_DBusError stdNotSupported(const TQString& message);
377 
385  static TQT_DBusError stdLimitsExceeded(const TQString& message);
386 
394  static TQT_DBusError stdAccessDenied(const TQString& message);
395 
403  static TQT_DBusError stdAuthFailed(const TQString& message);
404 
412  static TQT_DBusError stdTimeout(const TQString& message);
413 
421  static TQT_DBusError stdInvalidArgs(const TQString& message);
422 
430  static TQT_DBusError stdFileNotFound(const TQString& message);
431 
439  static TQT_DBusError stdFileExists(const TQString& message);
440 
448  static TQT_DBusError stdUnknownMethod(const TQString& message);
449 
457  static TQT_DBusError stdInvalidSignature(const TQString& message);
458 
459 private:
461  mutable bool m_dbusErrorSet;
462 
463  TQString nm, msg;
464 
473  TQT_DBusError(ErrorType type, const TQString& message);
474 };
475 
476 #endif