kmail Library API Documentation

KMail::FilterLog Class Reference

KMail Filter Log Collector. More...

#include <filterlog.h>

Inheritance diagram for KMail::FilterLog:

Inheritance graph
[legend]
Collaboration diagram for KMail::FilterLog:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ContentType {
  meta = 1, patternDesc = 2, ruleResult = 4, patternResult = 8,
  appliedAction = 16
}

Signals

void logEntryAdded (QString)
void logShrinked ()
void logStateChanged ()

Public Member Functions

bool isLogging ()
void setLogging (bool active)
void setMaxLogSize (long size=-1)
long getMaxLogSize ()
void setContentTypeEnabled (ContentType contentType, bool b)
bool isContentTypeEnabled (ContentType contentType)
void add (QString logEntry, ContentType contentType)
void addSeparator ()
void clear ()
const QStringList & getLogEntries ()
void dump ()
bool saveToFile (QString fileName)
virtual ~FilterLog ()

Static Public Member Functions

FilterLog * instance ()
QString & recode (QString s)

Protected Member Functions

 FilterLog ()
void checkLogSize ()

Protected Attributes

QStringList mLogEntries
bool mLogging
long mMaxLogSize
long mCurrentLogSize
int mAllowedTypes

Detailed Description

KMail Filter Log Collector.

Author:
Andreas Gungl <a.gungl@gmx.de>
The filter log helps to collect log information about the filter process in KMail. It's implemented as singleton, so it's easy to direct pieces of information to a unique instance. It's possible to activate / deactivate logging. All collected log information can get thrown away, the next added log entry is the first one until another clearing. A signal is emitted whenever a new logentry is added, when the log was cleared or any log state was changed.

Definition at line 52 of file filterlog.h.


Member Enumeration Documentation

enum KMail::FilterLog::ContentType
 

log data types

Definition at line 61 of file filterlog.h.


Constructor & Destructor Documentation

FilterLog::~FilterLog (   )  [virtual]
 

destructor

Definition at line 60 of file filterlog.cpp.

FilterLog::FilterLog (   )  [protected]
 

Non-public constructor needed by the singleton implementation.

Definition at line 46 of file filterlog.cpp.

References mAllowedTypes, mLogging, and mMaxLogSize.

Referenced by instance().


Member Function Documentation

FilterLog * FilterLog::instance (   )  [static]
 

access to the singleton instance

Definition at line 64 of file filterlog.cpp.

References FilterLog().

Referenced by KMail::FilterLogDialog::FilterLogDialog().

bool KMail::FilterLog::isLogging (   )  [inline]
 

check the logging state

Definition at line 72 of file filterlog.h.

Referenced by add().

void KMail::FilterLog::setLogging (  bool  active  )  [inline]
 

set the logging state

Definition at line 74 of file filterlog.h.

void FilterLog::setMaxLogSize (  long  size = -1  ) 
 

control the size of the log

Definition at line 88 of file filterlog.cpp.

References mMaxLogSize.

void KMail::FilterLog::setContentTypeEnabled (  ContentType  contentType,
bool  b
)  [inline]
 

add/remove a content type to the set of logged ones

Definition at line 87 of file filterlog.h.

bool KMail::FilterLog::isContentTypeEnabled (  ContentType  contentType  )  [inline]
 

check a content type for inclusion in the set of logged ones

Definition at line 97 of file filterlog.h.

void FilterLog::add (  QString  logEntry,
ContentType  contentType
) 
 

add a log entry

Definition at line 71 of file filterlog.cpp.

References isLogging(), mAllowedTypes, and mLogEntries.

void KMail::FilterLog::addSeparator (   )  [inline]
 

add a separating line in the log

Definition at line 106 of file filterlog.h.

void KMail::FilterLog::clear (   )  [inline]
 

discard collected log data

Definition at line 108 of file filterlog.h.

const QStringList& KMail::FilterLog::getLogEntries (   )  [inline]
 

get access to the log entries

Definition at line 117 of file filterlog.h.

Referenced by KMail::FilterLogDialog::FilterLogDialog().

void FilterLog::dump (   ) 
 

dump the log - for testing purposes

Definition at line 101 of file filterlog.cpp.

References mLogEntries.

bool FilterLog::saveToFile (  QString  fileName  ) 
 

save the log to a file - returns true if okay

Definition at line 143 of file filterlog.cpp.

References mLogEntries.


Member Data Documentation

QStringList KMail::FilterLog::mLogEntries [protected]
 

The list contains the single log pieces.

Definition at line 138 of file filterlog.h.

Referenced by add(), dump(), and saveToFile().

bool KMail::FilterLog::mLogging [protected]
 

the log status

Definition at line 141 of file filterlog.h.

Referenced by FilterLog().

long KMail::FilterLog::mMaxLogSize [protected]
 

max size for kept log items, when reached the last recently added items are discarded -1 means unlimited

Definition at line 146 of file filterlog.h.

Referenced by FilterLog(), and setMaxLogSize().

int KMail::FilterLog::mAllowedTypes [protected]
 

types currently allowed to be legged

Definition at line 150 of file filterlog.h.

Referenced by add(), and FilterLog().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kmail Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 22:44:37 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003