fb2main.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef FB2MAIN_H
  2. #define FB2MAIN_H
  3. #include <QMainWindow>
  4. QT_BEGIN_NAMESPACE
  5. class QAction;
  6. class QMenu;
  7. class QFile;
  8. class QModelIndex;
  9. class QTextEdit;
  10. class QThread;
  11. class QTreeView;
  12. class QWebView;
  13. QT_END_NAMESPACE
  14. class QsciScintilla;
  15. class Fb2MainDocument;
  16. class Fb2ReadThread;
  17. class Fb2MainWindow : public QMainWindow
  18. {
  19. Q_OBJECT
  20. public:
  21. explicit Fb2MainWindow();
  22. explicit Fb2MainWindow(const QString &filename);
  23. explicit Fb2MainWindow(const QString &filename, Fb2MainDocument * document);
  24. protected:
  25. void closeEvent(QCloseEvent *event);
  26. public slots:
  27. void logMessage(const QString &message);
  28. void sendDocument();
  29. private slots:
  30. void fileNew();
  31. void fileOpen();
  32. bool fileSave();
  33. bool fileSaveAs();
  34. void about();
  35. void documentWasModified();
  36. void treeActivated(const QModelIndex &index);
  37. void treeDestroyed();
  38. void logDestroyed();
  39. void logShowed();
  40. void viewQsci();
  41. void viewText();
  42. void textBold();
  43. void textItalic();
  44. void textStrike();
  45. void textSub();
  46. void textSup();
  47. void cursorPositionChanged();
  48. void clipboardDataChanged();
  49. private:
  50. bool loadXML(const QString &filename);
  51. QIcon icon(const QString &name);
  52. private:
  53. void init();
  54. void createText();
  55. void createQsci();
  56. void createActions();
  57. void createStatusBar();
  58. void readSettings();
  59. void writeSettings();
  60. bool maybeSave();
  61. bool saveFile(const QString &fileName);
  62. void setCurrentFile(const QString &fileName, const QString &html = QString());
  63. Fb2MainWindow *findFb2MainWindow(const QString &fileName);
  64. Fb2ReadThread *thread;
  65. QWebView *textEdit;
  66. QTextEdit *noteEdit;
  67. QTextEdit *messageEdit;
  68. QsciScintilla *qsciEdit;
  69. QTreeView * treeView;
  70. QString curFile;
  71. bool isUntitled;
  72. QAction
  73. *actionBack,
  74. *actionForward,
  75. *actionUndo,
  76. *actionRedo,
  77. *actionCut,
  78. *actionCopy,
  79. *actionPaste,
  80. *actionSelect,
  81. *actionTextBold,
  82. *actionTextItalic,
  83. *actionTextStrike,
  84. *actionTextSub,
  85. *actionTextSup,
  86. *actionZoomIn,
  87. *actionZoomOut,
  88. *actionZoomOrig
  89. ;
  90. };
  91. #endif // FB2MAIN_H