1 /* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar)
2 * Understanding is not required. Only obedience.
4 * This program is free software. It comes without any warranty, to
5 * the extent permitted by applicable law. You can redistribute it
6 * and/or modify it under the terms of the Do What The Fuck You Want
7 * To Public License, Version 2, as published by Sam Hocevar. See
8 * http://sam.zoy.org/wtfpl/COPYING for more details.
14 # error Please, select history module
22 ///////////////////////////////////////////////////////////////////////////////
23 class HistoryMessage
{
28 Server
, // message from server
33 HistoryMessage () { clear(); }
34 ~HistoryMessage () { clear(); }
36 virtual void clear () {
43 date
.setTimeSpec(Qt::LocalTime
);
49 QDateTime date
; // must be localtime!
56 ///////////////////////////////////////////////////////////////////////////////
57 class HistoryFileBase
{
65 virtual ~HistoryFileBase ();
67 virtual bool open (OpenMode newmode
)=0;
68 virtual bool isOpen () const=0;
69 virtual void close ()=0;
70 virtual void remove ()=0;
72 virtual int count ()=0;
74 virtual bool append (const HistoryMessage
&msg
)=0;
76 /* idx: 0..count-1; idx<0: idx += count; */
77 virtual bool read (int idx
, HistoryMessage
&msg
)=0;
82 # include "k8jshistory.h"
86 # include "k8ldbhistory.h"
90 # include "k8bhfhistory.h"