languages/bash/bashsupport_part.h
Go to the documentation of this file.00001 /* 00002 * $Id: bashsupport_part.h,v 1.7 2003/10/05 15:49:45 faure Exp $ 00003 * Copyright (C) 2003 Ian Reinhart Geiser <geiseri@kde.org> 00004 */ 00005 00006 00007 #ifndef __KDEVPART_BASHSUPPORT_H__ 00008 #define __KDEVPART_BASHSUPPORT_H__ 00009 00010 00011 #include <qguardedptr.h> 00012 00013 #include <kprocess.h> 00014 #include <kdialogbase.h> 00015 00016 #include <codemodel.h> 00017 #include <kdevplugin.h> 00018 #include <kdevlanguagesupport.h> 00019 00020 #include <ktexteditor/editinterface.h> 00021 #include <ktexteditor/viewcursorinterface.h> 00022 #include <ktexteditor/codecompletioninterface.h> 00023 00024 //class BashSupportWidget; 00025 00026 class BashCodeCompletion : QObject 00027 { 00028 Q_OBJECT 00029 public: 00030 BashCodeCompletion(); 00031 ~BashCodeCompletion(); 00032 void setActiveEditorPart(KParts::Part*); 00033 void setVars(QStringList); 00034 QValueList<KTextEditor::CompletionEntry> getVars(const QString& textHint); 00035 00036 public slots: 00037 void cursorPositionChanged(); 00038 void completionBoxHidden(); 00039 void completionBoxAbort(); 00040 00041 private: 00042 QStringList m_vars; 00043 bool m_argWidgetShow; 00044 bool m_completionBoxShow; 00045 KTextEditor::EditInterface *m_editInterface; 00046 KTextEditor::CodeCompletionInterface *m_codeInterface; 00047 KTextEditor::ViewCursorInterface *m_cursorInterface; 00048 }; 00049 00050 class BashSupportPart : public KDevLanguageSupport 00051 { 00052 Q_OBJECT 00053 public: 00054 BashSupportPart(QObject *parent, const char *name, const QStringList &); 00055 virtual ~BashSupportPart(); 00056 00057 protected: 00058 virtual Features features(); 00059 virtual KMimeType::List mimeTypes(); 00060 00061 private slots: 00062 void slotRun(); 00063 void projectConfigWidget(KDialogBase *dlg); 00064 void projectOpened(); 00065 void projectClosed(); 00066 void savedFile(const QString &fileName); 00067 void addedFilesToProject(const QStringList &fileList); 00068 void removedFilesFromProject(const QStringList &fileList); 00069 void parse(); 00070 void slotActivePartChanged(KParts::Part *part); 00071 00072 private: 00073 void startApplication(const QString &program); 00074 QString interpreter(); 00075 void parse(const QString &fileName); 00076 void addAttribute(const QString &name, FileDom file, uint line); 00077 BashCodeCompletion *m_cc; 00078 QStringList m_vars; 00079 00080 }; 00081 00082 #endif