/****************************************************************/ /* memo.h */ /* Copyleft (c) 2020,S&S */ /****************************************************************/ #include class QAction; class FindDialog; class MyMainWindow : public QMainWindow { Q_OBJECT public: MyMainWindow(); void closeEvent(QCloseEvent *); void setAppAddr(QApplication *); void initMyMainWindow(); QPlainTextEdit *getEditAddr() { return te; } private: void createActions(); void createMenus(); bool loadFile(QString &); bool writeFile(); bool isContinued(); QAction *newAction; QAction *openAction; QAction *saveAction; QAction *saveAsAction; QAction *exitAction; QAction *undoAction; QAction *redoAction; QAction *separatorAction; QAction *cutAction; QAction *copyAction; QAction *pasteAction; QAction *selectAllAction; QAction *findAction; QAction *aboutAction; QMenu *fileMenu; QMenu *editMenu; QMenu *helpMenu; QPlainTextEdit *te; // char *textBuffer; FindDialog *fDialog; QString currentFileName = ""; QApplication *appAddr; private slots: void newFile(); void openFile(); void saveFile(); void saveAsFile(); void memoModified(); void createFindDialog(); void quitFindDialog(); void aboutMemo(); }; class FindDialog : public QDialog { Q_OBJECT public: FindDialog(QWidget *parent); void setAppAddr(MyMainWindow *p); private slots: void find1(); void findBackward1(); private: QLabel *label; QPushButton *findButton; QPushButton *findBackwardButton; QPushButton *cancelButton; QLineEdit *lineEdit; MyMainWindow *parent; bool found = false; QString beforeText = ""; }; // end of file