| 1 | 
 #ifndef WMFORMATPAGE_H | 
 
 
 
 
 
 | 2 | 
 #define WMFORMATPAGE_H | 
 
 
 
 
 
 | 3 | 
  | 
 
 
 
 
 
 | 4 | 
 #include <QWizardPage> | 
 
 
 
 
 
 | 5 | 
 #include <QColorDialog> | 
 
 
 
 
 
 | 6 | 
 #include <QKeyEvent> | 
 
 
 
 
 
 | 7 | 
 #include <QTextBlock> | 
 
 
 
 
 
 | 8 | 
  | 
 
 
 
 
 
 | 9 | 
 #include "utilvago.h" | 
 
 
 
 
 
 | 10 | 
 #include "WmPage.h" | 
 
 
 
 
 
 | 11 | 
 #include "wmsetuppage.h" | 
 
 
 
 
 
 | 12 | 
  | 
 
 
 
 
 
 | 13 | 
 namespace Ui { | 
 
 
 
 
 
 | 14 | 
 class WmFormatPage; | 
 
 
 
 
 
 | 15 | 
 } | 
 
 
 
 
 
 | 16 | 
  | 
 
 
 
 
 
 | 17 | 
 class WmFormatPage : public QWizardPage | 
 
 
 
 
 
 | 18 | 
 { | 
 
 
 
 
 
 | 19 | 
     Q_OBJECT | 
 
 
 
 
 
 | 20 | 
      | 
 
 
 
 
 
 | 21 | 
 public: | 
 
 
 
 
 
 | 22 | 
     explicit WmFormatPage(Logger *myLogger, QWidget *parent = 0); | 
 
 
 
 
 
 | 23 | 
     QList<std::shared_ptr<WmPage> >& getCurrentPages(); | 
 
 
 
 
 
 | 24 | 
  | 
 
 
 
 
 
 | 25 | 
     ~WmFormatPage(); | 
 
 
 
 
 
 | 26 | 
      | 
 
 
 
 
 
 | 27 | 
 private slots: | 
 
 
 
 
 
 | 28 | 
     bool validatePage(); | 
 
 
 
 
 
 | 29 | 
  | 
 
 
 
 
 
 | 30 | 
     void on_tbBold_clicked(); | 
 
 
 
 
 
 | 31 | 
  | 
 
 
 
 
 
 | 32 | 
     void on_pbAddPageAfter_clicked(); | 
 
 
 
 
 
 | 33 | 
  | 
 
 
 
 
 
 | 34 | 
     void on_pbAddPageBefore_clicked(); | 
 
 
 
 
 
 | 35 | 
  | 
 
 
 
 
 
 | 36 | 
     void on_pbDeleteCurrentPage_clicked(); | 
 
 
 
 
 
 | 37 | 
  | 
 
 
 
 
 
 | 38 | 
     void on_tbItalic_clicked(); | 
 
 
 
 
 
 | 39 | 
  | 
 
 
 
 
 
 | 40 | 
     void on_tbFontColor_clicked(); | 
 
 
 
 
 
 | 41 | 
  | 
 
 
 
 
 
 | 42 | 
     void on_fcbFont_currentFontChanged(const QFont &f); | 
 
 
 
 
 
 | 43 | 
  | 
 
 
 
 
 
 | 44 | 
     void on_cbTextSize_currentTextChanged(const QString &arg1); | 
 
 
 
 
 
 | 45 | 
  | 
 
 
 
 
 
 | 46 | 
 private: | 
 
 
 
 
 
 | 47 | 
     enum class FormatType{ | 
 
 
 
 
 
 | 48 | 
         BOLD, | 
 
 
 
 
 
 | 49 | 
         ITALIC, | 
 
 
 
 
 
 | 50 | 
         COLOR, | 
 
 
 
 
 
 | 51 | 
         FONT_TYPE, | 
 
 
 
 
 
 | 52 | 
         FONT_SIZE | 
 
 
 
 
 
 | 53 | 
     }; | 
 
 
 
 
 
 | 54 | 
  | 
 
 
 
 
 
 | 55 | 
     Ui::WmFormatPage *ui; | 
 
 
 
 
 
 | 56 | 
     QList<std::shared_ptr<WmPage>> currentPages; | 
 
 
 
 
 
 | 57 | 
     bool windowsIsInitialized = false; | 
 
 
 
 
 
 | 58 | 
     Logger *myLogger; | 
 
 
 
 
 
 | 59 | 
  | 
 
 
 
 
 
 | 60 | 
 private: | 
 
 
 
 
 
 | 61 | 
     void setupComboBoxTextSize(); | 
 
 
 
 
 
 | 62 | 
     void addPage(bool afterCurrentPage = true); | 
 
 
 
 
 
 | 63 | 
     void updateTabNames(int startIndex); | 
 
 
 
 
 
 | 64 | 
     void setCurrentFormatting(int index); | 
 
 
 
 
 
 | 65 | 
     void setDefaultOniFont(int index); | 
 
 
 
 
 
 | 66 | 
     void formatText(FormatType desiredFormatType); | 
 
 
 
 
 
 | 67 | 
     void initializePage(); | 
 
 
 
 
 
 | 68 | 
     void keyPressEvent (QKeyEvent * event); | 
 
 
 
 
 
 | 69 | 
 }; | 
 
 
 
 
 
 | 70 | 
  | 
 
 
 
 
 
 | 71 | 
 #endif // WMFORMATPAGE_H |