![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2002 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: msgHandler.h,v $ $Revision: 1.16 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00012 #ifndef DtMsgHandler_H 00013 #define DtMsgHandler_H 00014 00015 #include "ngutil/ngutilDefines.h" 00017 #include "ngutil/msgItem.h" 00018 00020 #include <QtCore/QObject> 00021 #include <QtCore/QString> 00022 #include <QtCore/QStringList> 00023 #include <QtCore/QHash> 00024 00025 00026 00035 class DT_DLL_ngutil DtMsgHandler : public QObject 00036 { 00037 Q_OBJECT 00038 public: 00039 DtMsgHandler(); 00040 virtual ~DtMsgHandler(); 00041 00044 static void setDump( bool b ); 00045 00047 static void setOutputFile( const QString & filename, bool clear = false ); 00048 00050 static DtMsgHandler * defaultInstance(); 00051 static void cleanupDefaultInstance(); 00052 00054 static void generalMsg(const QString & msg, 00055 const QString & source ); 00056 static void debug ( const QString & msg ); 00057 static void info ( const QString & msg ); 00058 static void verbose(const QString & msg ); 00059 static void warn ( const QString & msg ); 00060 static void config( const QString & msg ); 00061 static void error ( const QString & msg ); 00062 static void status( const QString & msg ); 00063 00066 static void info ( const char* cformat,...); 00067 static void warn ( const char* cformat,...); 00068 00069 public slots: 00070 static void allowByDefault(bool); 00071 static void addSource( const QString& source ); 00072 static void removeSource( const QString& source ); 00073 00074 signals: 00075 void msgItem( const DtMsgItem & ); 00076 00077 protected: 00078 static void printMsg( const QString & msg ); 00079 static void vargprint(char * updateBuff, const char * cformat, ...); 00080 00081 protected: 00082 static bool myIsDump; 00083 static QString sOutputFile; 00084 static DtMsgHandler * sDefaultInstance; 00085 00086 static bool sAllowDefault; 00087 static QHash<QString, QString> sSourceCollection; 00088 static char myBuff[2048]; 00089 00090 }; 00091 00092 #endif //! DtMsgHandler_H 00093