summaryrefslogtreecommitdiffstats
path: root/kate/make/plugin_katemake.h
blob: ac06b7366dfda1c9ef309f5be190da00a692bbd7 (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
#ifndef _KATEMAKE_H
#define _KATEMAKE_H
/* plugin_katemake.h                    Kate Plugin
**
** Copyright (C) 2003 by Adriaan de Groot
**
** This is the hader for the Make plugin.
**
** This code was mostly copied from the GPL'ed xmlcheck plugin
** by Daniel Naber.
*/

/*
** 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 option) 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 in a file called COPYING; if not, write to
** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
** MA 02110-1301, USA.
*/

// #define TQT_NO_CAST_ASCII	(1)
// #define TQT_NO_ASCII_CAST	(1)

class TQRegExp;

#include <tqlistview.h>
#include <tqstring.h>

#include <kate/plugin.h>
#include <kate/application.h>
#include <kate/view.h>
#include <kate/document.h>
#include <kate/documentmanager.h>
#include <kate/mainwindow.h>
#include <kate/viewmanager.h>

#include <kdockwidget.h>
#include <kiconloader.h>
#include <kprocess.h>
#include <tdetempfile.h>

class PluginKateMakeView : public TQListView, public KXMLGUIClient
{
  TQ_OBJECT
  

  public:
	PluginKateMakeView(TQWidget *parent,
		Kate::MainWindow *mainwin,
		const char* name);
	virtual ~PluginKateMakeView();

	Kate::MainWindow *win;

  public slots:
	void slotClicked(TQListViewItem *item);
	void slotNext();
	void slotPrev();

	bool slotValidate();
	void slotProcExited(TDEProcess*);
	void slotReceivedProcStderr(TDEProcess*, char*, int);

	void slotConfigure();

protected:
	void processLine(const TQString &);
	
  private:
	TDEProcess *m_proc;
	
	TQString output_line;
	TQString doc_name;
	TQString document_dir;
	TQString source_prefix,build_prefix;
	
	TQRegExp *filenameDetector;
	
	TQListViewItem *running_indicator;
	bool found_error;
};


class PluginKateMake : public Kate::Plugin, Kate::PluginViewInterface
{
  TQ_OBJECT
  

  public:
	PluginKateMake( TQObject* parent = 0, const char* name = 0, const TQStringList& = TQStringList() );
	virtual ~PluginKateMake();

	void addView (Kate::MainWindow *win);
	void removeView (Kate::MainWindow *win);

  private:
	TQPtrList<PluginKateMakeView> m_views;
};

#endif