1 /* 2 * %kadu copyright begin% 3 * Copyright 2012 Bartosz Brachaczek (b.brachaczek@gmail.com) 4 * Copyright 2012, 2013 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com) 5 * %kadu copyright end% 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License as 9 * published by the Free Software Foundation; either version 2 of 10 * the License, or (at your option) any later version. 11 * 12 * This program 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 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 #ifndef ERROR_H 22 #define ERROR_H 23 24 #include <QtCore/QString> 25 26 #include "misc/error-severity.h" 27 #include "exports.h" 28 29 /** 30 * @addtogroup Misc 31 * @{ 32 */ 33 34 /** 35 * @class Error 36 * @short Simple class describing an error. 37 * @author Rafał 'Vogel' Malinowski 38 * 39 * Erro contains severity info and error message string. 40 */ 41 class KADUAPI Error 42 { 43 ErrorSeverity Severity; 44 QString Message; 45 46 public: 47 /** 48 * @short Create new Error class. 49 * @author Rafał 'Vogel' Malinowski 50 * @param severity this error severity 51 * @param message this error message 52 */ 53 Error(ErrorSeverity severity, const QString &message); 54 55 /** 56 * @short Copy Error object. 57 * @author Rafał 'Vogel' Malinowski 58 * @param copyMe Error object to copy 59 */ 60 Error(const Error ©Me); 61 62 /** 63 * @short Copy Error object and return this object. 64 * @author Rafał 'Vogel' Malinowski 65 * @param copyMe Error object to copy 66 * @return this object 67 */ 68 Error & operator = (const Error ©Me); 69 70 /** 71 * @short Return severity of this object. 72 * @author Rafał 'Vogel' Malinowski 73 * @return severity of this object 74 */ 75 ErrorSeverity severity() const; 76 77 /** 78 * @short Return message of this object. 79 * @author Rafał 'Vogel' Malinowski 80 * @return message of this object 81 */ 82 QString message() const; 83 84 }; 85 86 /** 87 * @} 88 */ 89 90 #endif // ERROR_H 91