00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __EDELIB_EDBUSERROR_H__
00022 #define __EDELIB_EDBUSERROR_H__
00023
00024 #include "edelib-global.h"
00025
00026 struct DBusError;
00027
00028 EDELIB_NS_BEGIN
00029
00035 enum EdbusErrorType {
00036 EDBUS_ERROR_INVALID,
00037 EDBUS_ERROR_FAILED,
00038 EDBUS_ERROR_NO_MEMORY,
00039 EDBUS_ERROR_SERVICE_UNKNOWN,
00040 EDBUS_ERROR_NAME_HAS_NO_OWNER,
00041 EDBUS_ERROR_NO_REPLY,
00042 EDBUS_ERROR_IO_ERROR,
00043 EDBUS_ERROR_BAD_ADDRESS,
00044 EDBUS_ERROR_NOT_SUPPORTED,
00045 EDBUS_ERROR_LIMITS_EXCEEDED,
00046 EDBUS_ERROR_ACCESS_DENIED,
00047 EDBUS_ERROR_AUTH_FAILED,
00048 EDBUS_ERROR_NO_SERVER,
00049 EDBUS_ERROR_TIMEOUT,
00050 EDBUS_ERROR_NO_NETWORK,
00051 EDBUS_ERROR_DISCONNECTED,
00052 EDBUS_ERROR_INVALID_ARGS,
00053 EDBUS_ERROR_FILE_NOT_FOUND,
00054 EDBUS_ERROR_FILE_EXISTS,
00055 EDBUS_ERROR_UNKNOWN_METHOD,
00056 EDBUS_ERROR_TIMED_OUT,
00057 EDBUS_ERROR_INVALID_SIGNATURE,
00058 EDBUS_ERROR_USER_DEFINED
00059 };
00060
00061 struct EdbusErrorImpl;
00062
00068 class EdbusError {
00069 private:
00070 EdbusErrorImpl* impl;
00071 void dispose(void);
00072 public:
00076 EdbusError();
00077
00081 ~EdbusError();
00082
00086 EdbusError(const DBusError* err);
00087
00091 EdbusError(const EdbusError& other);
00092
00096 EdbusError& operator=(const EdbusError& other);
00097
00101 EdbusError(EdbusErrorType t, const char* msg);
00102
00106 EdbusErrorType type(void) const;
00107
00111 const char* name(void) const;
00112
00116 const char* message(void) const;
00117
00121 bool valid(void) const { return type() != EDBUS_ERROR_INVALID; }
00122 };
00123
00124 EDELIB_NS_END
00125 #endif