DumontEXE 0.0.1
QxtLog.h
00001 
00002 #ifndef _QXTLOG_H_
00003 #define _QXTLOG_H_
00004 
00005 #include <QPointer>
00006 #include <ui_qxtlog.h>
00007 
00008 class QxtLogWindow;
00009 class QTextEdit;
00010 
00011 /*!
00012 ** \brief Log Manager
00013 **
00014 ** Only one log manager is allowed to exist in the system.
00015 **
00016 */
00017 class QxtLog
00018 : 
00019   public QObject
00020 {
00021   Q_OBJECT
00022   public:
00023 
00024     QxtLog( int argc, char **argv, QObject * parent = NULL );
00025 
00026     virtual ~QxtLog();
00027 
00028     /*!
00029     ** \brief Return a reference to the global log pointer
00030     **
00031     */
00032     static QxtLog * instance(void)
00033     {
00034       return( s_instance );
00035     }
00036 
00037   public slots:
00038 
00039     virtual void save( const QString & fileName );
00040     virtual void debug( const QString & msg );
00041     virtual void warning( const QString & msg );
00042     virtual void critical( const QString & msg );
00043     virtual void fatal( const QString & msg );
00044 
00045     virtual QxtLogWindow * window(void);
00046 
00047   protected:
00048 
00049   private:
00050 
00051     /*!
00052     ** \brief Qt message trap
00053     **
00054     ** This function traps messages sent by qDebug, qWarning, qCritical, qFatal
00055     **  and processes them through the logging engine.  It is static and private
00056     **  because nothing should have access to it besides the logger.
00057     **
00058     */
00059     static void messageTrap( QtMsgType type, const char *msg );
00060 
00061     /*
00062     ** This is a static reference to the logger.
00063     **
00064     */
00065     static QPointer<QxtLog> s_instance;
00066 
00067     static QPointer<QxtLogWindow> s_window;
00068 
00069 };
00070 
00071 
00072 #define qxtLog QxtLog::instance()
00073 
00074 
00075 class QxtLogWindow:
00076   public  QMainWindow,
00077   private Ui::QxtLogWindow
00078 {
00079   Q_OBJECT
00080   public:
00081 
00082     QxtLogWindow( QWidget * parent = NULL );
00083     ~QxtLogWindow();
00084 
00085 
00086   public slots:
00087 
00088     virtual void on_actLogSave_triggered();
00089 
00090     virtual void save( const QString & fileName );
00091     virtual void show(void);
00092     virtual QTextEdit * textField(void);
00093 
00094   signals:
00095 
00096   protected:
00097 
00098   private:
00099 
00100 };
00101 
00102 
00103 #endif // #ifndef QXTLOG_H
00104 
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com