DBus-1-TQt  1.0
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
TQString name() const
Returns the D-Bus error name.
Definition: tqdbuserror.h:282
Target file exists but operation does not allow overwriting.
Definition: tqdbuserror.h:211
TQString message() const
Returns a string describing the error.
Definition: tqdbuserror.h:295
An operation timed out.
Definition: tqdbuserror.h:226
TQString nm
Definition: tqdbuserror.h:463
An type signature is not valid.
Definition: tqdbuserror.h:241
A method call addresses and unknown method.
Definition: tqdbuserror.h:218
bool m_dbusErrorSet
Definition: tqdbuserror.h:461
The network intended as a transport channel is not available.
Definition: tqdbuserror.h:179
A non-unique name used in a message is not known.
Definition: tqdbuserror.h:97
An timeout occured during an operation.
Definition: tqdbuserror.h:174
bool dbusErrorSet() const
Returns whether the error was caused by DBUS itself.
Definition: tqdbuserror.h:316
ErrorType
Enum of standard D-Bus error types.
Definition: tqdbuserror.h:59
An otherwise valid operation request could not be handled.
Definition: tqdbuserror.h:134
#define TQDBUS_EXPORT
Definition: tqdbusmacros.h:29
Caused by trying to connect to a malformed address.
Definition: tqdbuserror.h:124
An addressed service is neither connected nor can it be activated.
Definition: tqdbuserror.h:88
void setDBUSError(bool err) const
Definition: tqdbuserror.h:321
A file necessary for an operation is not avaiable.
Definition: tqdbuserror.h:204
An call failed to send a reply but one was expected.
Definition: tqdbuserror.h:104
Generic failure cause.
Definition: tqdbuserror.h:76
Caused by trying to use an unconnected D-Bus connection.
Definition: tqdbuserror.h:186
Class for transporting D-Bus errors.
Definition: tqdbuserror.h:40
An IO error occured during an operation.
Definition: tqdbuserror.h:114
An operation could not allocate enough memory.
Definition: tqdbuserror.h:83
Caused by security restrictions denying an operation.
Definition: tqdbuserror.h:152
Connection to a D-Bus server failed.
Definition: tqdbuserror.h:164
ErrorType type() const
Returns a type for checking of standard errors.
Definition: tqdbuserror.h:307
ErrorType errorType
Definition: tqdbuserror.h:460
Caused by invalid arguments passed to a method call.
Definition: tqdbuserror.h:197
TQT_DBusError specific value, to represent invalid error objects.
Definition: tqdbuserror.h:66
An authentification mechanism failed.
Definition: tqdbuserror.h:159
Use of a limited resource reached its limit.
Definition: tqdbuserror.h:141