Isis 3 Programmer Reference
GuiEditFile.h
1 #ifndef _GuiEditFile_h_
2 #define _GuiEditFile_h_
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include <QAction>
10 #include <QFile>
11 #include <QObject>
12 #include <QMainWindow>
13 #include <QString>
14 #include <QTextEdit>
15 #include <QWidget>
16 
36 namespace Isis {
37  class UserInterface;
54  class GuiEditFile : public QObject {
55  Q_OBJECT
56  public:
58  static void EditFile(UserInterface & pUI, QString psFile="");
59 
61  void showWindow(QString psFile="");
62 
64  ~GuiEditFile();
65 
67  void clearFile();
68 
69  public slots:
70  void open();
71  void OpenFile(QString);
72  void setTextChanged();
73  void saveAs();
74  void saveAsFile(QString);
75  void saveFile();
76  void closeFile();
77  void closeWin();
78 
79  private:
81  GuiEditFile(UserInterface & pUI, QString psFile="");
82  void windowTitle(QString & psfile);
83 
86  QString m_fileName;
88  QTextEdit *m_txtEdit;
89  QFile *m_editFile;
91 
98  };
99 
100 };
101 #endif
102 
QWidget
Isis::GuiEditFile::m_exit
QAction * m_exit
Action Exit.
Definition: GuiEditFile.h:97
Isis::GuiEditFile::m_saveAs
QAction * m_saveAs
Action Save As.
Definition: GuiEditFile.h:95
Isis::GuiEditFile::clearFile
void clearFile()
Delete the contents of a file.
Definition: GuiEditFile.cpp:329
Isis::GuiEditFile::m_textChanged
bool m_textChanged
Flag to indicate text changed.
Definition: GuiEditFile.h:90
Isis::GuiEditFile::saveAs
void saveAs()
For action File->Save As.
Definition: GuiEditFile.cpp:291
Isis::GuiEditFile::m_save
QAction * m_save
Action Save.
Definition: GuiEditFile.h:94
QMainWindow
Isis::GuiEditFile::EditFile
static void EditFile(UserInterface &pUI, QString psFile="")
Creates a single instance of the GuiEditFile.
Definition: GuiEditFile.cpp:38
Isis::GuiEditFile::~GuiEditFile
~GuiEditFile()
Destructor.
Definition: GuiEditFile.cpp:155
Isis::GuiEditFile::GuiEditFile
GuiEditFile(UserInterface &pUI, QString psFile="")
Constructor.
Definition: GuiEditFile.cpp:69
Isis::GuiEditFile::closeWin
void closeWin()
For action Exit (close the window)
Definition: GuiEditFile.cpp:174
Isis::GuiEditFile::windowTitle
void windowTitle(QString &psfile)
display only the file base name
Definition: GuiEditFile.cpp:344
Isis::GuiEditFile::m_txtEdit
QTextEdit * m_txtEdit
Text Editor.
Definition: GuiEditFile.h:88
Isis::GuiEditFile::saveFile
void saveFile()
For action File->Save.
Definition: GuiEditFile.cpp:277
Isis::GuiEditFile::m_open
QAction * m_open
Actioons.
Definition: GuiEditFile.h:93
Isis::GuiEditFile::showWindow
void showWindow(QString psFile="")
If there is already an instance of this object, then display the window.
Definition: GuiEditFile.cpp:54
Isis::GuiEditFile
Opens a window in Gui Application to be able to edit, save and create text files.
Definition: GuiEditFile.h:54
Isis::GuiEditFile::saveAsFile
void saveAsFile(QString)
Save the contents of text editor to another file.
Definition: GuiEditFile.cpp:314
Isis::GuiEditFile::m_editFile
QFile * m_editFile
File pointer to current file.
Definition: GuiEditFile.h:89
Isis::GuiEditFile::m_parent
QWidget * m_parent
Parent widget.
Definition: GuiEditFile.h:85
Isis::GuiEditFile::m_editWin
QMainWindow * m_editWin
Editor window.
Definition: GuiEditFile.h:87
Isis::GuiEditFile::m_fileName
QString m_fileName
Current file open.
Definition: GuiEditFile.h:86
Isis::GuiEditFile::m_instance
static GuiEditFile * m_instance
Instance of this object - singleton.
Definition: GuiEditFile.h:84
Isis::UserInterface
Command Line and Xml loader, validation, and access.
Definition: UserInterface.h:140
Isis::GuiEditFile::m_close
QAction * m_close
Action Close.
Definition: GuiEditFile.h:96
Isis::GuiEditFile::OpenFile
void OpenFile(QString)
To display the contents of an opened file.
Definition: GuiEditFile.cpp:239
QObject
Isis::GuiEditFile::setTextChanged
void setTextChanged()
Indicator that the text has changed.
Definition: GuiEditFile.cpp:184
QAction
Isis::GuiEditFile::closeFile
void closeFile()
For action File->Close.
Definition: GuiEditFile.cpp:218
Isis::GuiEditFile::open
void open()
For action File->Open.
Definition: GuiEditFile.cpp:193
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16