00001 /* 00002 Copyright © 2010 jonathan Courtois 00003 00004 This file is part of QExtend. 00005 00006 QExtend is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 any later version. 00010 00011 QExtend is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with QExtend. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #ifndef QEXTEND_GUI_LOGGER_HPP 00021 #define QEXTEND_GUI_LOGGER_HPP 00022 00023 #include <QtGui/QTextBrowser> 00024 #include <QtGui/QListWidget> 00025 #include <QExtend/Core/Logger> 00026 00027 namespace QExtend 00028 { 00029 00030 00032 00034 00041 class QEXTEND_EXPORT LogTextBrowser : public ILog 00042 { 00043 Q_OBJECT 00044 private: 00045 ExtendPtr<QTextBrowser> m_textBrowser; 00048 public: 00049 00050 00052 00053 00055 00062 LogTextBrowser(QTextBrowser *textBrowser); 00063 00064 public Q_SLOTS: 00065 00066 00068 00069 00071 void writeLog(LoggerType type, QString message, QString location); 00072 00073 00075 00076 00078 void cleanLog(); 00079 }; 00080 00081 00083 00085 00092 class QEXTEND_EXPORT LogListWidget : public ILog 00093 { 00094 Q_OBJECT 00095 private: 00096 QList<QColor> m_typesColors; 00098 ExtendPtr<QListWidget> m_listWidget; 00101 public: 00102 00103 00105 00106 00108 00115 LogListWidget(QListWidget *listWidget); 00116 00117 00119 00120 00122 00131 void setTypeColor(LoggerType type, QColor color); 00132 00133 00135 00136 00138 00147 QColor getTypeColor(LoggerType type); 00148 00149 public Q_SLOTS: 00150 00151 00153 00154 00156 void writeLog(LoggerType type, QString message, QString location); 00157 00158 00160 00161 00163 void cleanLog(); 00164 }; 00165 00166 } // QExtend namespace 00167 00168 #endif // QEXTEND_GUI_LOGGER_HPP
© 2000-2024 - www.developpez.com