KDevelop API Documentation

parts/outputviews/makeitem.h

Go to the documentation of this file.
00001 /*************************************************************************** 00002 * Copyright (C) 1999-2001 by Bernd Gehrmann * 00003 * bernd@kdevelop.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 ***************************************************************************/ 00011 00012 #ifndef MakeItem_h 00013 #define MakeItem_h 00014 00015 #include <qstring.h> 00016 00017 enum EOutputLevel 00018 { 00019 // appropriate to the ID's in the button group of settingswidget.ui 00020 eVeryShort = 0 00021 ,eShort 00022 ,eFull 00023 }; 00024 00025 class MakeItem 00026 { 00027 public: 00028 enum Type { Normal, Error, Warning, Diagnostic }; 00029 MakeItem(); 00030 MakeItem( const QString& text ); 00031 virtual ~MakeItem(); 00032 00033 virtual bool append( const QString& ) { return false; } 00034 virtual Type type() { return Diagnostic; } 00035 virtual bool visible( EOutputLevel level ) { return level > eVeryShort; } 00036 virtual QString text( EOutputLevel ); 00037 virtual QString formattedText( EOutputLevel, bool bright_bg ); 00038 QString icon(); 00039 QString color( bool bright_bg ); 00040 00041 static QString br(); 00042 00043 QString m_text; 00044 }; 00045 00046 class CommandItem : public MakeItem 00047 { 00048 public: 00049 CommandItem(const QString command) 00050 : MakeItem( command ) 00051 {} 00052 00053 Type type() { return Diagnostic; } 00054 virtual bool visible( EOutputLevel ) { return true; } 00055 }; 00056 00057 class ExitStatusItem : public MakeItem 00058 { 00059 public: 00060 ExitStatusItem( bool normalExit, int exitStatus ); 00061 00062 Type type() { return m_normalExit && m_exitStatus == 0 ? Diagnostic : Error; } 00063 virtual bool visible( EOutputLevel ) { return true; } 00064 QString text( EOutputLevel level ); 00065 00066 private: 00067 bool m_normalExit; 00068 int m_exitStatus; 00069 }; 00070 00071 class DirectoryItem : public MakeItem 00072 { 00073 public: 00074 DirectoryItem( const QString& dir, const QString& text ) 00075 : MakeItem( text ) 00076 , directory( dir ) 00077 {} 00078 00079 Type type() { return Diagnostic; } 00080 00081 static void setShowDirectoryMessages( bool show ) { m_showDirectoryMessages = show; } 00082 static bool getShowDirectoryMessages() { return m_showDirectoryMessages; } 00083 00084 QString directory; 00085 00086 protected: 00087 static bool m_showDirectoryMessages; 00088 }; 00089 00090 class EnteringDirectoryItem : public DirectoryItem 00091 { 00092 public: 00093 EnteringDirectoryItem( const QString& dir, const QString& text ) 00094 : DirectoryItem( dir, text ) 00095 {} 00096 bool visible( EOutputLevel ) 00097 { 00098 return m_showDirectoryMessages; 00099 } 00100 00101 virtual QString text( EOutputLevel ); 00102 }; 00103 00104 class ExitingDirectoryItem : public DirectoryItem 00105 { 00106 public: 00107 ExitingDirectoryItem( const QString& dir, const QString& text ) 00108 : DirectoryItem( dir, text ) 00109 {} 00110 bool visible( EOutputLevel level ) 00111 { 00112 return m_showDirectoryMessages && level > eVeryShort; 00113 } 00114 00115 virtual QString text( EOutputLevel ); 00116 }; 00117 00118 namespace KTextEditor { class Cursor; class Document; } 00119 00120 class ErrorItem : public MakeItem 00121 { 00122 public: 00123 ErrorItem( const QString& fn, int ln, const QString& tx, const QString& line, bool isWarning, const QString& compiler ); 00124 virtual ~ErrorItem(); 00125 00126 virtual bool append( const QString& text ); 00127 Type type() { return m_isWarning ? Warning : Error; } 00128 virtual bool visible( EOutputLevel ) { return true; } 00129 00130 QString fileName; 00131 int lineNum; 00132 QString m_error; 00133 KTextEditor::Cursor* m_cursor; 00134 KTextEditor::Document* m_doc; 00135 bool m_isWarning; 00136 QString m_compiler; 00137 }; 00138 00139 class ActionItem : public MakeItem 00140 { 00141 public: 00142 ActionItem( const QString& action, const QString& file, const QString& tool, const QString& line ) 00143 : MakeItem( line ) 00144 , m_action( action ) 00145 , m_file( file ) 00146 , m_tool( tool ) 00147 {} 00148 00149 virtual bool visible( EOutputLevel ) { return true; } 00150 virtual QString text( EOutputLevel level ); 00151 00152 QString m_action; 00153 QString m_file; 00154 QString m_tool; 00155 }; 00156 00157 #endif
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:12 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003