casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
texteditor.qo.h
Go to the documentation of this file.
1 //# Copyright (C) 2005
2 //# Associated Universities, Inc. Washington DC, USA.
3 //#
4 //# This library is free software; you can redistribute it and/or modifyit
5 //# under the terms of the GNU Library General Public License as published by
6 //# the Free Software Foundation; either version 2 of the License, or (at your
7 //# option) any later version.
8 //#
9 //# This library is distributed in the hope that it will be useful, but WITHOUT
10 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 //# License for more details.
13 //#
14 //# You should have received a copy of the GNU Library General Public License
15 //# along with this library; if not, write to the Free Software Foundation,
16 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
17 //#
18 //# Correspondence concerning AIPS++ should be addressed as follows:
19 //# Internet email: aips2-request@nrao.edu.
20 //# Postal address: AIPS++ Project Office
21 //# National Radio Astronomy Observatory
22 //# 520 Edgemont Road
23 //# Charlottesville, VA 22903-2475 USA
24 //#
25 //# $Id: $
26 
27 
28 #ifndef TEXTEDITOR_H
29 #define TEXTEDITOR_H
30 
31 #include <graphics/X11/X_enter.h>
32 #include <QMainWindow>
33 
34 class QAction;
35 class QMenu;
36 class QTextEdit;
37 
38 #include <graphics/X11/X_exit.h>
39 
40 namespace casa {
41 
42 class TextEditor : public QMainWindow
43 {
44  Q_OBJECT
45 
46 public:
47  TextEditor();
48  void open(const QString&);
49 protected:
50  void closeEvent(QCloseEvent *event);
51 
52 private slots:
53  void newFile();
54  void open();
55  bool save();
56  bool saveAs();
57  void documentWasModified();
58 
59 private:
60  void createActions();
61  void createMenus();
62  void createToolBars();
63  void createStatusBar();
64  void readSettings();
65  void writeSettings();
66  bool maybeSave();
67  void loadFile(const QString &fileName);
68  bool saveFile(const QString &fileName);
69  void setCurrentFile(const QString &fileName);
70  QString strippedName(const QString &fullFileName);
71 
72  QTextEdit *textEdit;
73  QString curFile;
74 
75  QMenu *fileMenu;
76  QMenu *editMenu;
77  QToolBar *fileToolBar;
78  QToolBar *editToolBar;
79  QAction *newAct;
80  QAction *openAct;
81  QAction *saveAct;
82  QAction *saveAsAct;
83  QAction *exitAct;
84  QAction *cutAct;
85  QAction *copyAct;
86  QAction *pasteAct;
87 };
88 }
89 #endif
void setCurrentFile(const QString &fileName)
QString strippedName(const QString &fullFileName)
void documentWasModified()
bool saveFile(const QString &fileName)
QAction * copyAct
Definition: texteditor.qo.h:85
QAction * exitAct
Definition: texteditor.qo.h:83
QToolBar * fileToolBar
Definition: texteditor.qo.h:77
QTextEdit * textEdit
Definition: texteditor.qo.h:72
QAction * openAct
Definition: texteditor.qo.h:80
void loadFile(const QString &fileName)
QToolBar * editToolBar
Definition: texteditor.qo.h:78
QAction * cutAct
Definition: texteditor.qo.h:84
QAction * saveAsAct
Definition: texteditor.qo.h:82
QAction * pasteAct
Definition: texteditor.qo.h:86
void createStatusBar()
void closeEvent(QCloseEvent *event)
QAction * newAct
Definition: texteditor.qo.h:79
QAction * saveAct
Definition: texteditor.qo.h:81