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