languages/java/javasupport_events.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2003 by Roberto Raggi * 00003 * roberto@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 __javasupport_events_h 00013 #define __javasupport_events_h 00014 00015 #include "driver.h" 00016 #include "kdevdeepcopy.h" 00017 00018 #include <qevent.h> 00019 #include <qvaluelist.h> 00020 00021 #if QT_VERSION < 0x030100 00022 #include <kdevmutex.h> 00023 #else 00024 #include <qmutex.h> 00025 #endif 00026 00027 enum 00028 { 00029 Event_FileParsed = QEvent::User + 1000 00030 }; 00031 00032 class FileParsedEvent: public QCustomEvent 00033 { 00034 public: 00035 FileParsedEvent( const QString& fileName, const QValueList<Problem>& problems ) 00036 : QCustomEvent(Event_FileParsed), m_fileName( deepCopy(fileName) ) 00037 { 00038 // the members are deep copies 00039 QValueListConstIterator<Problem> it = problems.begin(); 00040 while (it != problems.end()) { 00041 Problem p = *it; 00042 m_problems.append(Problem(deepCopy(p.text()), p.line(), p.column(), p.level())); 00043 ++it; 00044 } 00045 } 00046 00047 QString fileName() const { return m_fileName; } 00048 QValueList<Problem> problems() const { return m_problems; } 00049 00050 private: 00051 QString m_fileName; 00052 QValueList<Problem> m_problems; 00053 00054 private: 00055 FileParsedEvent( const FileParsedEvent& source ); 00056 void operator = ( const FileParsedEvent& source ); 00057 }; 00058 00059 00060 #endif // __javasupport_events_h