summaryrefslogtreecommitdiffstats
path: root/languages/bash/bashsupport_part.h
blob: a05e93f9679e20af3e1bfef0439043a3be2cec3a (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
/*
 *  Copyright (C) 2003 Ian Reinhart Geiser <geiseri@kde.org>
 */


#ifndef __KDEVPART_BASHSUPPORT_H__
#define __KDEVPART_BASHSUPPORT_H__


#include <tqguardedptr.h>

#include <kprocess.h>
#include <kdialogbase.h>

#include <codemodel.h>
#include <kdevplugin.h>
#include <kdevlanguagesupport.h>

#include <ktexteditor/editinterface.h>
#include <ktexteditor/viewcursorinterface.h>
#include <ktexteditor/codecompletioninterface.h>

//class BashSupportWidget;

class BashCodeCompletion : TQObject
{
	Q_OBJECT
  TQ_OBJECT
	public:
		BashCodeCompletion();
		~BashCodeCompletion();
		void setActiveEditorPart(KParts::Part*);
		void setVars(TQStringList);
		TQValueList<KTextEditor::CompletionEntry> getVars(const TQString& textHint);

	public slots:
		void cursorPositionChanged();
		void completionBoxHidden();
		void completionBoxAbort();

	private:
		TQStringList m_vars;
		bool m_argWidgetShow;
		bool m_completionBoxShow;
		KTextEditor::EditInterface *m_editInterface;
		KTextEditor::CodeCompletionInterface *m_codeInterface;
		KTextEditor::ViewCursorInterface *m_cursorInterface;
};

class BashSupportPart : public KDevLanguageSupport
{
	Q_OBJECT
  TQ_OBJECT
	public:
		BashSupportPart(TQObject *parent, const char *name, const TQStringList &);
		virtual ~BashSupportPart();

	protected:
		virtual Features features();
		virtual KMimeType::List mimeTypes();

	private slots:
		void slotRun();
		void projectConfigWidget(KDialogBase *dlg);
		void projectOpened();
		void projectClosed();
		void savedFile(const KURL &fileName);
		void addedFilesToProject(const TQStringList &fileList);
		void removedFilesFromProject(const TQStringList &fileList);
		void parse();
		void slotActivePartChanged(KParts::Part *part);

	private:
		void startApplication(const TQString &program);
		TQString interpreter();
		void parse(const TQString &fileName);
		void addAttribute(const TQString &name, FileDom file, uint line);
		BashCodeCompletion *m_cc;
		TQStringList m_vars;

};

#endif