summaryrefslogtreecommitdiffstats
path: root/ksirc/logfile.h
blob: 1a34372872e774c552a34799e4982b07b14bf616 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* This file is part of the KDE project
   Copyright (C) 2001 Simon Hausmann <[email protected]>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the Artistic License.
*/
#ifndef __logfile_h__
#define __logfile_h__

#include <tqobject.h>

class QFile;

class LogFile : public QObject
{
public:
    LogFile( const TQString &channel, const TQString &server );
    virtual ~LogFile();

    void open();

    void closeLog();

    void log( const TQString &message );

protected:
    virtual void timerEvent( TQTimerEvent * );

private:
    TQString m_channel;
    TQString m_server;

    TQFile *m_file;

    int m_flushTimerId;

    TQString makeLogFileName( const TQString &channel, const TQString &server, int suffix = -1 );
};

#endif