00001 /*************************************************************************** 00002 File : Note.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen 00006 Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net 00007 Description : Notes window class 00008 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * (at your option) any later version. * 00017 * * 00018 * This program is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU General Public License * 00024 * along with this program; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00026 * Boston, MA 02110-1301 USA * 00027 * * 00028 ***************************************************************************/ 00029 #ifndef NOTE_H 00030 #define NOTE_H 00031 00032 #include "MyWidget.h" 00033 #include "ScriptEdit.h" 00034 #include <qtextedit.h> 00035 00036 class ScriptingEnv; 00037 00043 class Note: public MyWidget 00044 { 00045 Q_OBJECT 00046 00047 public: 00048 00049 Note(ScriptingEnv *env, const QString& label, QWidget* parent=0, const char* name=0, Qt::WFlags f=0); 00050 ~Note(){}; 00051 00052 00053 void init(ScriptingEnv *env); 00054 void setName(const char *name); 00055 00056 public slots: 00057 QString saveToString(const QString &info); 00058 void restore(const QStringList&); 00059 00060 QTextEdit* textWidget(){return (QTextEdit*)te;}; 00061 bool autoexec() const { return autoExec; } 00062 void setAutoexec(bool); 00063 void modifiedNote(); 00064 00065 // ScriptEdit methods 00066 QString text() { return te->text(); }; 00067 void setText(const QString &s) { te->setText(s); }; 00068 void print() { te->print(); }; 00069 void exportPDF(const QString& fileName){te->exportPDF(fileName);}; 00070 QString exportASCII(const QString &file=QString::null) { return te->exportASCII(file); }; 00071 QString importASCII(const QString &file=QString::null) { return te->importASCII(file); }; 00072 void execute() { te->execute(); }; 00073 void executeAll() { te->executeAll(); }; 00074 void evaluate() { te->evaluate(); }; 00075 00076 private: 00077 ScriptEdit *te; 00078 bool autoExec; 00079 }; 00080 00081 #endif