]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCharacter.h
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / GuiCharacter.h
index f505ad27bb902115ebd31fb9cdd6b3c4e07d2d0f..40da643dffd3b7045eb7bf563154ddc14dfcf8b7 100644 (file)
 
 #include "GuiDialog.h"
 #include "ui_CharacterUi.h"
-#include "qt_helpers.h" // for LanguagePair
 #include "Font.h"
 
+#include <QAction>
+
 #include <utility>
 
+#ifdef IGNORE
+#undef IGNORE
+#endif
 
 namespace lyx {
 namespace frontend {
 
-enum FontState {
+enum FontDeco {
        ///
        IGNORE,
        ///
-       EMPH_TOGGLE,
+       UNDERBAR,
+       ///
+       STRIKEOUT,
+       ///
+       XOUT,
        ///
-       UNDERBAR_TOGGLE,
+       UULINE,
        ///
-       NOUN_TOGGLE,
+       UWAVE,
        ///
-       INHERIT
+       INHERIT,
+       ///
+       NONE
 };
 
 typedef std::pair<QString, FontFamily> FamilyPair;
@@ -43,8 +53,8 @@ typedef std::pair<QString, FontFamily> FamilyPair;
 typedef std::pair<QString, FontSeries> SeriesPair;
 typedef std::pair<QString, FontShape>  ShapePair;
 typedef std::pair<QString, FontSize>   SizePair;
-typedef std::pair<QString, FontState>  BarPair;
-typedef std::pair<QString, ColorCode>  ColorPair;
+typedef std::pair<QString, FontDeco>  BarPair;
+typedef std::pair<QString, QString>    LanguagePair;
 
 class GuiCharacter : public GuiDialog, public Ui::CharacterUi
 {
@@ -55,70 +65,56 @@ public:
 
 protected Q_SLOTS:
        void change_adaptor();
+       void on_emphCB_clicked();
+       void on_nounCB_clicked();
+       void on_nospellcheckCB_clicked();
+       void resetToDefault();
+       void resetToNoChange();
+       void checkRestoreDefaults();
 
 private:
-       /// Apply changes
+       /// \name Dialog inherited methods
+       //@{
        void applyView();
-       /// update
        void updateContents();
-
-       QList<FamilyPair> family;
-       QList<SeriesPair> series;
-       QList<ShapePair>  shape;
-       QList<SizePair>   size;
-       QList<BarPair>    bar;
-       QList<ColorPair>  color;
-       QList<LanguagePair> language;
-
-       ///
        bool initialiseParams(std::string const & data);
-       ///
        void clearParams() {}
-       ///
        void dispatchParams();
-       ///
        bool isBufferDependent() const { return true; }
-       ///
-       FuncCode getLfun() const { return LFUN_FONT_FREE_UPDATE; }
+       FuncCode getLfun() const { return LFUN_TEXTSTYLE_UPDATE; }
+       void saveSession(QSettings & settings) const;
+       void restoreSession();
+       //@}
 
        ///
-       void setFamily(FontFamily);
+       void paramsToDialog(Font const & font);
        ///
-       void setSeries(FontSeries);
+       void setBar(FontInfo & fi, FontDeco val);
        ///
-       void setShape(FontShape);
-       ///
-       void setSize(FontSize);
-       ///
-       void setBar(FontState);
-       ///
-       void setColor(ColorCode);
-       ///
-       void setLanguage(QString const &);
+       void setStrike(FontInfo & fi, FontDeco val);
+
+       QList<FamilyPair> family;
+       QList<SeriesPair> series;
+       QList<ShapePair>  shape;
+       QList<SizePair>   size;
+       QList<BarPair>    bar;
+       QList<BarPair>    strike;
+       QList<ColorCode> color;
+       QList<LanguagePair> language;
 
        ///
-       FontFamily getFamily() const;
-       ///
-       FontSeries getSeries() const;
-       ///
-       FontShape getShape() const;
-       ///
-       FontSize getSize() const;
+       Font font_;
        ///
-       FontState getBar() const;
+       bool emph_;
        ///
-       ColorCode getColor() const;
+       bool noun_;
        ///
-       QString getLanguage() const;
+       bool nospellcheck_;
 
-private:
        ///
-       Font font_;
+       QAction * resetdefault_ = new QAction(this);
        ///
-       bool toggleall_;
-       /// If true the language should be reset.
-       /// If false the language of font_ is used.
-       bool reset_lang_;
+       QAction * resetnochange_ = new QAction(this);
 };
 
 } // namespace frontend