SciDAVis  1.D4
Note.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : Note.h
3  Project : SciDAVis
4  --------------------------------------------------------------------
5  Copyright : (C) 2006 by Ion Vasilief, Tilman Benkert
6  Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
7  Description : Notes window class
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef NOTE_H
30 #define NOTE_H
31 
32 #include "MyWidget.h"
33 #include "ScriptEdit.h"
34 #include <qtextedit.h>
35 
36 class ScriptingEnv;
37 
43 class Note: public MyWidget
44 {
45  Q_OBJECT
46 
47 public:
48 
49  Note(ScriptingEnv *env, const QString& label, QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
50  ~Note(){};
51 
52 
53  void init(ScriptingEnv *env);
54 
55 public slots:
56  QString saveToString(const QString &info);
57  void restore(const QStringList&);
58 
59  QTextEdit* textWidget(){return (QTextEdit*)te;};
60  bool autoexec() const { return autoExec; }
61  void setAutoexec(bool);
62  void modifiedNote();
63 
64  // ScriptEdit methods
65  QString text() { return te->text(); };
66  void setText(const QString &s) { te->setText(s); };
67  void print() { te->print(); };
68  void exportPDF(const QString& fileName){te->exportPDF(fileName);};
69  QString exportASCII(const QString &file=QString::null) { return te->exportASCII(file); };
70  QString importASCII(const QString &file=QString::null) { return te->importASCII(file); };
71  void execute() { te->execute(); };
72  void executeAll() { te->executeAll(); };
73  void evaluate() { te->evaluate(); };
74 
75 private:
76  ScriptEdit *te;
77  bool autoExec;
78 };
79 
80 #endif