problemreporter.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 version 2, License as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00016 Boston, MA 02111-1307, USA. 00017 */ 00018 00019 #ifndef PROBLEMSREPORTER_H 00020 #define PROBLEMSREPORTER_H 00021 00022 #include <klistview.h> 00023 #include <qguardedptr.h> 00024 00025 class CppSupportPart; 00026 class QTimer; 00027 class QTabBar; 00028 class QWidgetStack; 00029 class QGridLayout; 00030 class QLineEdit; 00031 class KDialogBase; 00032 class Problem; 00033 class KURL; 00034 00035 namespace KParts{ 00036 class Part; 00037 } 00038 00039 namespace KTextEditor{ 00040 class MarkInterface; 00041 class Document; 00042 } 00043 00044 class ProblemReporter: public QWidget{ 00045 Q_OBJECT 00046 public: 00047 ProblemReporter( CppSupportPart* part, QWidget* parent=0, const char* name=0 ); 00048 virtual ~ProblemReporter(); 00049 00050 void removeAllProblems( const QString& filename ); 00051 void reportProblem( const QString& fileName, const Problem& p ); 00052 00053 public slots: 00054 void reparse(); 00055 void configure(); 00056 void configWidget( KDialogBase* ); 00057 00058 private slots: 00059 void slotPartAdded( KParts::Part* ); 00060 void slotPartRemoved( KParts::Part* ); 00061 void slotActivePartChanged( KParts::Part* ); 00062 void slotTextChanged(); 00063 void slotSelected( QListViewItem* ); 00064 void slotFileParsed( const QString& fileName ); 00065 void slotTabSelected( int tabindex ); 00066 void slotFilter(); 00067 void closedFile(const KURL &fileName); 00068 00069 private: 00070 QString levelToString( int level ) const; 00071 int levelToMarkType( int level ) const; 00072 void InitListView(KListView* listview); 00073 void removeAllItems( QListView* listview, const QString& filename ); 00074 void filterList(KListView* listview, const QString& level); 00075 void updateCurrentWith(QListView* listview, const QString& level, const QString& filename); 00076 void initCurrentList(); 00077 00078 private: 00079 QGridLayout* m_gridLayout; 00080 QTabBar* m_tabBar; 00081 QWidgetStack* m_widgetStack; 00082 KListView* m_currentList; 00083 KListView* m_errorList; 00084 KListView* m_fixmeList; 00085 KListView* m_warningList; 00086 KListView* m_todoList; 00087 KListView* m_filteredList; 00088 QLineEdit* m_filterEdit; 00089 00090 CppSupportPart* m_cppSupport; 00091 QGuardedPtr<KTextEditor::Document> m_document; 00092 KTextEditor::MarkInterface* m_markIface; 00093 QTimer* m_timer; 00094 QString m_fileName; 00095 int m_active; 00096 int m_delay; 00097 int m_canParseFile; 00098 }; 00099 00100 #endif