1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef FB2MAIN_H
- #define FB2MAIN_H
- #include <QMainWindow>
- QT_BEGIN_NAMESPACE
- class QAction;
- class QMenu;
- class QFile;
- class QTextEdit;
- class QTextDocument;
- QT_END_NAMESPACE
- class QsciScintilla;
- class MainWindow : public QMainWindow
- {
- Q_OBJECT
- public:
- MainWindow();
- MainWindow(const QString &filename);
- MainWindow(const QString &filename, QTextDocument * document);
- protected:
- void closeEvent(QCloseEvent *event);
- private slots:
- void newFile();
- void open();
- bool save();
- bool saveAs();
- void about();
- void documentWasModified();
- void viewQsci();
- void viewText();
- private:
- static QTextDocument * loadFB2(const QString &filename);
- bool loadXML(const QString &filename);
- private:
- void init();
- void createText();
- void createQsci();
- void createActions();
- void createMenus();
- void createToolBars();
- void createStatusBar();
- void readSettings();
- void writeSettings();
- bool maybeSave();
- bool saveFile(const QString &fileName);
- void setCurrentFile(const QString &fileName, QTextDocument * document = NULL);
- MainWindow *findMainWindow(const QString &fileName);
- QTextEdit *textEdit;
- QsciScintilla *qsciEdit;
- QString curFile;
- bool isUntitled;
- QMenu *fileMenu;
- QMenu *editMenu;
- QMenu *viewMenu;
- QMenu *helpMenu;
- QToolBar *fileToolBar;
- QToolBar *editToolBar;
- QAction *newAct;
- QAction *openAct;
- QAction *saveAct;
- QAction *saveAsAct;
- QAction *closeAct;
- QAction *exitAct;
- QAction *cutAct;
- QAction *copyAct;
- QAction *pasteAct;
- QAction *textAct;
- QAction *qsciAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
- };
- #endif // FB2MAIN_H
|