Proof-reading - fixed one usage of the i18n plural form (it wasn't doing before,...
[kdeadmin.git] / ksystemlog / src / lib / logLine.h
blobe0e9f8a08ce24eecf200328f2e74949f769c329d
1 /***************************************************************************
2 * KSystemLog, a system log viewer tool *
3 * Copyright (C) 2007 by Nicolas Ternisien *
4 * nicolas.ternisien@gmail.com *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20 ***************************************************************************/
22 #ifndef LOG_LINE_H
23 #define LOG_LINE_H
25 #include <QStringList>
26 #include <QDateTime>
28 #include <kurl.h>
30 #include "globals.h"
32 #include "logLevel.h"
34 class LogViewWidget;
35 class QDateTime;
36 class QStringList;
37 class LogViewWidgetItem;
39 class LogLinePrivate;
41 class LogLine {
43 public:
44 LogLine(
45 long internalId,
46 const QDateTime& dateTime,
47 const QStringList& logItems,
48 const QString& originalFile,
49 LogLevel* level,
50 LogMode* logMode
53 virtual ~LogLine();
55 bool isOlderThan(const LogLine& other) const;
56 bool isNewerThan(const LogLine& other) const;
58 bool equals(const LogLine& other) const;
60 bool isSameTime(const LogLine& other) const;
62 LogLevel* logLevel() const;
64 long internalId() const;
65 QDateTime time() const;
66 QStringList logItems() const;
67 QString sourceFileName() const;
69 LogMode* logMode() const;
71 bool itemExists() const;
73 void setLogItems(const QStringList& logItems);
74 void setLogLevel(LogLevel* level);
75 void setLogMode(LogMode* logMode);
77 void setRecent(bool recent);
78 void setItem(LogViewWidgetItem* item);
80 QString formattedText();
82 QString exportToText() const;
84 protected:
85 LogLinePrivate* const d;
87 private:
88 void initializeItem();
92 #endif