00001 /**************************************************************** 00002 * Vidalia is distributed under the following license: 00003 * 00004 * Copyright (C) 2006, Matt Edman, Justin Hipple 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program 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 this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 ****************************************************************/ 00021 00022 /** 00023 * \file logtreeitem.h 00024 * \version $Id: messagelog.cpp 797 2006-05-09 04:42:35Z edmanm $ 00025 * \brief Item representing a single message in the message log 00026 */ 00027 00028 #ifndef _LOGTREEITEM_H 00029 #define _LOGTREEITEM_H 00030 00031 #include <QTreeWidgetItem> 00032 #include <QDateTime> 00033 #include <QString> 00034 #include <control/logevent.h> 00035 00036 00037 class LogTreeItem : public QTreeWidgetItem 00038 { 00039 public: 00040 /** Default constructor. */ 00041 LogTreeItem(LogEvent::Severity type, QString message, 00042 QDateTime timestamp = QDateTime::currentDateTime()); 00043 00044 /** Sets the item's log time. */ 00045 void setTimestamp(QDateTime timestamp); 00046 /** Sets the item's severity and appropriate background color. */ 00047 void setSeverity(LogEvent::Severity type); 00048 /** Sets the item's message text. */ 00049 void setMessage(QString message); 00050 00051 /** Returns the timestamp for this log message. */ 00052 QDateTime timestamp() const; 00053 /** Returns the severity associated with this log item. */ 00054 LogEvent::Severity severity(); 00055 /** Returns the message associated with this log item. */ 00056 QString message(); 00057 00058 /** Returns a printable string representation of the item's contents.*/ 00059 QString toString(); 00060 }; 00061 00062 #endif 00063