edelib: edelib/EdbusError.h Source File

edelib 0.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

EdbusError.h
1 /*
2 * $Id: EdbusError.h 2839 2009-09-28 11:36:20Z karijes $
3 *
4 * D-BUS stuff
5 * Copyright (c) 2008 edelib authors
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef __EDELIB_EDBUSERROR_H__
22 #define __EDELIB_EDBUSERROR_H__
23
24 #include "edelib-global.h"
25
26 struct DBusError;
27
28 EDELIB_NS_BEGIN
29
35 enum EdbusErrorType {
36 EDBUS_ERROR_INVALID,
37 EDBUS_ERROR_FAILED,
38 EDBUS_ERROR_NO_MEMORY,
39 EDBUS_ERROR_SERVICE_UNKNOWN,
40 EDBUS_ERROR_NAME_HAS_NO_OWNER,
41 EDBUS_ERROR_NO_REPLY,
42 EDBUS_ERROR_IO_ERROR,
43 EDBUS_ERROR_BAD_ADDRESS,
44 EDBUS_ERROR_NOT_SUPPORTED,
45 EDBUS_ERROR_LIMITS_EXCEEDED,
46 EDBUS_ERROR_ACCESS_DENIED,
47 EDBUS_ERROR_AUTH_FAILED,
48 EDBUS_ERROR_NO_SERVER,
49 EDBUS_ERROR_TIMEOUT,
50 EDBUS_ERROR_NO_NETWORK,
51 EDBUS_ERROR_DISCONNECTED,
52 EDBUS_ERROR_INVALID_ARGS,
53 EDBUS_ERROR_FILE_NOT_FOUND,
54 EDBUS_ERROR_FILE_EXISTS,
55 EDBUS_ERROR_UNKNOWN_METHOD,
56 EDBUS_ERROR_TIMED_OUT,
57 EDBUS_ERROR_INVALID_SIGNATURE,
58 EDBUS_ERROR_USER_DEFINED
59 };
60
61 struct EdbusErrorImpl;
62
68 class EdbusError {
69 private:
70 EdbusErrorImpl* impl;
71 void dispose(void);
72 public:
76 EdbusError();
77
81 ~EdbusError();
82
86 EdbusError(const DBusError* err);
87
91 EdbusError(const EdbusError& other);
92
96 EdbusError& operator=(const EdbusError& other);
97
101 EdbusError(EdbusErrorType t, const char* msg);
102
106 EdbusErrorType type(void) const;
107
111 const char* name(void) const;
112
116 const char* message(void) const;
117
121 bool valid(void) const { return type() != EDBUS_ERROR_INVALID; }
122 };
123
124 EDELIB_NS_END
125 #endif