summaryrefslogtreecommitdiffstats
path: root/src/modules/logview/logviewmdiwindow.h
blob: 96546e739baa55a2d13e69e80701fe83bc185c82 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#ifndef _LOGVIEWMDIWINDOW_H_
#define _LOGVIEWMDIWINDOW_H_
//
//   File : logviewmdiwindow.h
//   Creation date : Tue Apr 23 2002 18:05:59 by Juanjo �varez
//
//   This file is part of the KVirc irc client distribution
//   Copyright (C) 1999-2007 Szymon Stefanek (pragma at kvirc dot net)
//
//   This program is FREE software. You can redistribute it and/or
//   modify it under the terms of the GNU General Public License
//   as published by the Free Software Foundation; either version 2
//   of the License, or (at your opinion) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//

#include "kvi_settings.h"
#include "kvi_window.h"
#include "kvi_moduleextension.h"

#include "kvi_tal_vbox.h"
#include "kvi_tal_listview.h"
#include "kvi_pointerlist.h"
#include <tqtabwidget.h>
#include <tqdatetime.h> 

class KviTalListView;
class TQStringList;
class KviLogViewWidget;
class TQCheckBox;
class TQLineEdit;
class TQDateEdit;

class KviLogFile {

public:
	
	enum KviLogTypes {
		Channel,
		Console,
		Query,
		DccChat,
		Other
	};

	KviLogFile(const TQString& name);

	const TQString & fileName() { return m_szFilename; };
	const TQString & name() { return m_szName; };
	const TQString & network() { return m_szNetwork; };
	const TQDate   & date() { return m_date; };

	void getText(TQString & text,const TQString& logDir);

	KviLogTypes type() { return m_type; };
private:
	KviLogTypes  m_type;
	TQString      m_szFilename;
	bool         m_bCompressed;
	TQString      m_szName;
	TQString      m_szNetwork;
	TQDate        m_date;
};

class KviLogViewMDIWindow : public KviWindow , public KviModuleExtension
{
    Q_OBJECT
  TQ_OBJECT
public: 
	KviLogViewMDIWindow(KviModuleExtensionDescriptor * d,KviFrame * lpFrm);
	~KviLogViewMDIWindow();
protected:
	KviPointerList<KviLogFile> m_logList;

	KviTalListView     * m_pListView;

	// Type filter
	TQCheckBox          * m_pShowChannelsCheck;
	TQCheckBox          * m_pShowQueryesCheck;
	TQCheckBox          * m_pShowConsolesCheck;
	TQCheckBox          * m_pShowOtherCheck;
	TQCheckBox          * m_pShowDccChatCheck;

	// Content filter
	TQLineEdit          * m_pFileNameMask;
	TQLineEdit          * m_pContentsMask;

	// Date/time mask
	TQCheckBox          * m_pEnableFromFilter;
	TQCheckBox          * m_pEnableToFilter;
	TQDateEdit          * m_pFromDateEdit;
	TQDateEdit          * m_pToDateEdit;

	TQStringList        * m_pFileNames;
	TQString              m_szLogDirectory;
	TQTabWidget         * m_pTabWidget;
	KviTalVBox         * m_pIndexTab;
	TQWidget            * m_pSearchTab;
protected:
	TQStringList getFileNames();
	
	void setupItemList();
	void cacheFileList();

	virtual TQPixmap * myIconPtr();
	virtual void resizeEvent(TQResizeEvent *e);
	virtual void fillCaptionBuffers();
	virtual void die();
	virtual TQSize tqsizeHint() const;
protected slots:
	void rightButtonClicked ( KviTalListViewItem *, const TQPoint &, int );
	void itemSelected(KviTalListViewItem * it);
	void deleteCurrent();
	void applyFilter();
};

#endif //_LOGVIEWMDIWINDOW_H_