/* * Copyright 2008 Ben Boeckel * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #ifndef SIGMODR_SCRIPTWIDGET #define SIGMODR_SCRIPTWIDGET // Sigcore includes #include "../sigcore/Script.h" // Qt includes #include // Form include #include "ui_script.h" // Forward declarations namespace KTextEditor { class Editor; class Document; class View; } class KTextEdit; namespace Sigmodr { class ScriptWidget : public QWidget, private Ui::formScript { Q_OBJECT public: explicit ScriptWidget(QWidget* parent, const Sigcore::Script& value = Sigcore::Script("", "")); ~ScriptWidget(); Sigcore::Script value() const; public slots: void setValue(const Sigcore::Script& value); signals: void valueChanged(const Sigcore::Script&); protected slots: void setGui(); void on_varInterpreter_activated(); void scriptChanged(); void focused(KTextEditor::View* view); void unfocused(KTextEditor::View* view); private: Sigcore::Script m_value; KTextEdit* m_simpleEdit; KTextEditor::Editor* m_editor; KTextEditor::Document* m_document; KTextEditor::View* m_view; }; } #endif