123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #ifndef FB2MAIN_H
- #define FB2MAIN_H
- #include <QMainWindow>
- #include <QTextCharFormat>
- QT_BEGIN_NAMESPACE
- class QAction;
- class QMenu;
- class QFile;
- class QThread;
- class QTextEdit;
- class QTreeView;
- class QTextDocument;
- QT_END_NAMESPACE
- class QsciScintilla;
- class Fb2MainDocument;
- class Fb2ReadThread;
- class MainWindow : public QMainWindow
- {
- Q_OBJECT
- public:
- explicit MainWindow();
- explicit MainWindow(const QString &filename);
- explicit MainWindow(const QString &filename, Fb2MainDocument * document);
- protected:
- void closeEvent(QCloseEvent *event);
- public slots:
- void logMessage(const QString &message);
- void sendDocument();
- private slots:
- void fileNew();
- void fileOpen();
- bool fileSave();
- bool fileSaveAs();
- void about();
- void documentWasModified();
- void treeDestroyed();
- void logDestroyed();
- void logShowed();
- void viewQsci();
- void viewText();
- void textBold();
- void textItalic();
- void textStrike();
- void textSub();
- void textSup();
- void currentCharFormatChanged(const QTextCharFormat &format);
- void cursorPositionChanged();
- void clipboardDataChanged();
- private:
- bool loadXML(const QString &filename);
- void connectTextDocument(QTextDocument * document);
- QIcon icon(const QString &name);
- private:
- void init();
- void createText();
- void createQsci();
- void createActions();
- void createStatusBar();
- void readSettings();
- void writeSettings();
- bool maybeSave();
- bool saveFile(const QString &fileName);
- void setCurrentFile(const QString &fileName, QTextDocument * document = NULL);
- void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
- MainWindow *findMainWindow(const QString &fileName);
- Fb2ReadThread *thread;
- QTextEdit *textEdit;
- QTextEdit *noteEdit;
- QTextEdit *messageEdit;
- QsciScintilla *qsciEdit;
- QTreeView * treeView;
- QString curFile;
- bool isUntitled;
- QAction
- *actionUndo,
- *actionRedo,
- *actionCut,
- *actionCopy,
- *actionPaste,
- *actionTextBold,
- *actionTextItalic,
- *actionTextStrike,
- *actionTextSub,
- *actionTextSup,
- *actionZoomIn,
- *actionZoomOut
- ;
- };
- #endif // FB2MAIN_H
|