All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ScriptWidget.h
Go to the documentation of this file.
1 /* Copyright (C) 2011-2011 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file ScriptWidget.h
22 
23  \brief A widget that can be used to show and control he execution of a script.
24 */
25 
26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_SCRIPTWIDGET_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_SCRIPTWIDGET_H
28 
29 // TerraLib
30 #include "../Config.h"
31 
32 // Qt
33 #include <QtGui/QWidget>
34 
35 // Forward declaration
36 class QString;
37 
38 // Forward declaration
39 class QsciLexer;
40 class QsciScintilla;
41 
42 namespace te
43 {
44  namespace qt
45  {
46  namespace widgets
47  {
48  /*!
49  \class ScriptWidget
50 
51  \brief A widget that can be used to show and control he execution of a script.
52  */
53  class TEQTWIDGETSEXPORT ScriptWidget : public QWidget
54  {
55  Q_OBJECT
56 
57  public:
58 
59  ScriptWidget(QWidget* parent);
60 
61  ~ScriptWidget();
62 
63  QsciScintilla* getTxtEditor() { return m_txtEditor; }
64 
65  const QsciScintilla* getTxtEditor() const { return m_txtEditor; }
66 
67  QString* getFileName() { return m_fileName; }
68 
69  const QString* getFileName() const { return m_fileName; }
70 
71  QString getScriptType() const;
72 
73  QString getScriptName() const;
74 
75  void open(const QString& fileName);
76 
77  bool hasChanged() const { return m_hasChanged; }
78 
79  public slots:
80 
81  void save();
82 
83  void saveAs();
84 
85  void close();
86 
87  void execute();
88 
89  void stop();
90 
91  void pause();
92 
93  void zoomIn();
94 
95  void zoomOut();
96 
97  void setTextChanged();
98 
99  protected:
100 
101  void saveFile(const QString& fileName);
102 
103  void setLexer();
104 
105  private:
106 
107  QsciScintilla* m_txtEditor;
108  QsciLexer* m_lexer; //!< The text editor owns the lexer.
109  QString* m_fileName;
111  };
112 
113  } // end namespace widgets
114  } // end namespace qt
115 } // end namespace te
116 
117 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_SCRIPTWIDGET_H
118 
#define TEQTWIDGETSEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:101
QsciScintilla * getTxtEditor()
Definition: ScriptWidget.h:63
A widget that can be used to show and control he execution of a script.
Definition: ScriptWidget.h:53
QsciLexer * m_lexer
The text editor owns the lexer.
Definition: ScriptWidget.h:108
const QsciScintilla * getTxtEditor() const
Definition: ScriptWidget.h:65
const QString * getFileName() const
Definition: ScriptWidget.h:69