/* This file is part of the KDE project Copyright (C) 2002 Matthias Hoelzer-Kluepfel Copyright (C) 2002 John Firebaugh Copyright (C) 2007 Hamish Rodda Copyright (C) 2009 Niko Sams This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KDEVPLATFORM_IBREAKPOINTCONTROLLER_H #define KDEVPLATFORM_IBREAKPOINTCONTROLLER_H #include #include #include #include "../debuggerexport.h" #include "idebugsession.h" #include "../breakpoint/breakpoint.h" class QModelIndex; namespace KDevelop { class BreakpointModel; class Breakpoint; class IDebugSession; class KDEVPLATFORMDEBUGGER_EXPORT IBreakpointController : public QObject { Q_OBJECT public: IBreakpointController(IDebugSession* parent); Breakpoint::BreakpointState breakpointState(const Breakpoint *breakpoint) const; int breakpointHitCount(const Breakpoint *breakpoint) const; QSet breakpointErrors(const Breakpoint *breakpoint) const; QString breakpointErrorText(const Breakpoint *breakpoint) const; protected: IDebugSession *debugSession() const; BreakpointModel *breakpointModel() const; void breakpointStateChanged(Breakpoint* breakpoint); void setHitCount(Breakpoint* breakpoint, int count); void error(Breakpoint* breakpoint, const QString& msg, Breakpoint::Column column); void hit(Breakpoint* breakpoint, const QString& msg = QString()); void sendMaybeAll(); virtual void sendMaybe(Breakpoint *breakpoint) = 0; QMap > m_dirty; QSet m_pending; QMap m_hitCount; QMap > m_errors; QMap m_errorText; ///< message of the last error int m_dontSendChanges; private Q_SLOTS: void breakpointChanged(KDevelop::Breakpoint* breakpoint, KDevelop::Breakpoint::Column column); void breakpointDeleted(KDevelop::Breakpoint *breakpoint); void debuggerStateChanged(KDevelop::IDebugSession::DebuggerState); }; } #endif // KDEVPLATFORM_IBREAKPOINTCONTROLLER_H