kmobiletools
errorhandler.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KMOBILETOOLSERRORHANDLER_H
00021 #define KMOBILETOOLSERRORHANDLER_H
00022
00023 #include <QtCore/QStack>
00024 #include <QtCore/QString>
00025 #include <QtCore/QObject>
00026
00027 #include <libkmobiletools/errortypes/baseerror.h>
00028 #include "kmobiletools_export.h"
00029
00030 namespace KMobileTools {
00031
00042 class ErrorHandlerPrivate;
00043 class KMOBILETOOLS_EXPORT ErrorHandler : public QObject {
00044 Q_OBJECT
00045
00046 friend class ErrorHandlerInstance;
00047 public:
00053 static ErrorHandler* instance();
00054
00060 void addError( const BaseError* error );
00061
00067 int errorCount() const;
00068
00074 QStack<const BaseError*> errorStack();
00075
00076 ~ErrorHandler();
00077
00078 Q_SIGNALS:
00079 void errorOccurred( const QString& message, BaseError::Priority );
00080
00081 private:
00082 ErrorHandler();
00083 ErrorHandlerPrivate* const d;
00084
00090 void writeToLog( const BaseError* error );
00091 void displayError( const BaseError* error );
00092 };
00093
00094 }
00095
00096 #endif