File indexing completed on 2024-04-28 04:37:35

0001 /*
0002     SPDX-FileCopyrightText: 2016 Aetf <aetf@unlimitedcodeworks.xyz>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #ifndef TESTVARIABLECONTROLLER_H
0008 #define TESTVARIABLECONTROLLER_H
0009 
0010 #include "testsexport.h"
0011 
0012 #include <debugger/interfaces/ivariablecontroller.h>
0013 
0014 namespace KDevelop {
0015 /**
0016  * Dummy VariableController that does nothing.
0017  */
0018 class KDEVPLATFORMTESTS_EXPORT TestVariableController
0019     : public IVariableController
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     explicit TestVariableController(IDebugSession* parent);
0025 
0026     Variable* createVariable(TreeModel* model, TreeItem* parent,
0027                              const QString& expression,
0028                              const QString& display = {}) override;
0029 
0030     KTextEditor::Range expressionRangeUnderCursor(KTextEditor::Document* doc,
0031                                                   const KTextEditor::Cursor& cursor) override;
0032 
0033     void addWatch(Variable* variable) override;
0034     void addWatchpoint(Variable* variable) override;
0035 
0036     /**
0037      * Number of times update() has been called since creation.
0038      */
0039     int updatedTimes() const;
0040 
0041 protected:
0042     void update() override;
0043 
0044 private:
0045     int m_updatedTimes;
0046 };
0047 } // end of namespace KDevelop
0048 #endif // TESTVARIABLECONTROLLER_H