Isis 3 Programmer Reference
GuiEditFile.h
1#ifndef _GuiEditFile_h_
2#define _GuiEditFile_h_
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
36namespace 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
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
Opens a window in Gui Application to be able to edit, save and create text files.
Definition GuiEditFile.h:54
QAction * m_exit
Action Exit.
Definition GuiEditFile.h:97
bool m_textChanged
Flag to indicate text changed.
Definition GuiEditFile.h:90
static void EditFile(UserInterface &pUI, QString psFile="")
Creates a single instance of the GuiEditFile.
void saveAsFile(QString)
Save the contents of text editor to another file.
void showWindow(QString psFile="")
If there is already an instance of this object, then display the window.
QString m_fileName
Current file open.
Definition GuiEditFile.h:86
QAction * m_close
Action Close.
Definition GuiEditFile.h:96
void saveAs()
For action File->Save As.
void clearFile()
Delete the contents of a file.
QAction * m_open
Actioons.
Definition GuiEditFile.h:93
QMainWindow * m_editWin
Editor window.
Definition GuiEditFile.h:87
void OpenFile(QString)
To display the contents of an opened file.
void windowTitle(QString &psfile)
display only the file base name
GuiEditFile(UserInterface &pUI, QString psFile="")
Constructor.
void setTextChanged()
Indicator that the text has changed.
QAction * m_save
Action Save.
Definition GuiEditFile.h:94
QWidget * m_parent
Parent widget.
Definition GuiEditFile.h:85
static GuiEditFile * m_instance
Instance of this object - singleton.
Definition GuiEditFile.h:84
void closeFile()
For action File->Close.
~GuiEditFile()
Destructor.
QFile * m_editFile
File pointer to current file.
Definition GuiEditFile.h:89
void closeWin()
For action Exit (close the window)
void saveFile()
For action File->Save.
QTextEdit * m_txtEdit
Text Editor.
Definition GuiEditFile.h:88
void open()
For action File->Open.
QAction * m_saveAs
Action Save As.
Definition GuiEditFile.h:95
Command Line and Xml loader, validation, and access.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16