2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiCharacter.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2007-10-06 11:17:57 +00:00
|
|
|
* \author Angus Leeming
|
2006-03-05 17:24:44 +00:00
|
|
|
* \author Edwin Leuven
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#ifndef GUICHARACTER_H
|
|
|
|
#define GUICHARACTER_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
#include "GuiDialog.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_CharacterUi.h"
|
2007-09-11 21:27:57 +00:00
|
|
|
#include "frontend_helpers.h" // for LanguagePair
|
2007-10-06 11:17:57 +00:00
|
|
|
#include "Font.h"
|
2007-02-13 18:27:46 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2007-10-06 11:17:57 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
2007-10-06 11:17:57 +00:00
|
|
|
|
|
|
|
class Color_color;
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace frontend {
|
|
|
|
|
2007-10-06 11:17:57 +00:00
|
|
|
enum FontState {
|
|
|
|
///
|
|
|
|
IGNORE,
|
|
|
|
///
|
|
|
|
EMPH_TOGGLE,
|
|
|
|
///
|
|
|
|
UNDERBAR_TOGGLE,
|
|
|
|
///
|
|
|
|
NOUN_TOGGLE,
|
|
|
|
///
|
|
|
|
INHERIT
|
|
|
|
};
|
|
|
|
|
2007-09-11 21:27:57 +00:00
|
|
|
typedef std::pair<QString, Font::FONT_FAMILY> FamilyPair;
|
|
|
|
typedef std::pair<QString, Font::FONT_SERIES> SeriesPair;
|
|
|
|
typedef std::pair<QString, Font::FONT_SHAPE> ShapePair;
|
|
|
|
typedef std::pair<QString, Font::FONT_SIZE> SizePair;
|
2007-10-06 11:17:57 +00:00
|
|
|
typedef std::pair<QString, FontState> BarPair;
|
2007-09-11 21:27:57 +00:00
|
|
|
typedef std::pair<QString, Color_color> ColorPair;
|
|
|
|
|
2007-10-06 11:17:57 +00:00
|
|
|
class GuiCharacter : public GuiDialog, public Ui::CharacterUi, public Controller
|
2007-09-05 20:33:29 +00:00
|
|
|
{
|
2007-04-25 10:57:54 +00:00
|
|
|
Q_OBJECT
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2007-04-25 10:57:54 +00:00
|
|
|
public:
|
2007-10-06 11:17:57 +00:00
|
|
|
GuiCharacter(LyXView & lv);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2007-04-25 10:57:54 +00:00
|
|
|
protected Q_SLOTS:
|
|
|
|
void change_adaptor();
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
private:
|
2007-09-05 20:33:29 +00:00
|
|
|
void closeEvent(QCloseEvent * e);
|
|
|
|
/// parent controller
|
2007-10-06 11:17:57 +00:00
|
|
|
Controller & controller() { return *this; }
|
2006-03-05 17:24:44 +00:00
|
|
|
/// Apply changes
|
2007-09-05 20:33:29 +00:00
|
|
|
void applyView();
|
2006-03-05 17:24:44 +00:00
|
|
|
/// update
|
2007-09-11 18:33:42 +00:00
|
|
|
void updateContents();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
std::vector<FamilyPair> family;
|
|
|
|
std::vector<SeriesPair> series;
|
|
|
|
std::vector<ShapePair> shape;
|
|
|
|
std::vector<SizePair> size;
|
|
|
|
std::vector<BarPair> bar;
|
|
|
|
std::vector<ColorPair> color;
|
|
|
|
std::vector<LanguagePair> language;
|
2007-10-06 11:17:57 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
bool initialiseParams(std::string const & data);
|
|
|
|
///
|
|
|
|
void clearParams() {}
|
|
|
|
///
|
|
|
|
void dispatchParams();
|
|
|
|
///
|
|
|
|
bool isBufferDependent() const { return true; }
|
|
|
|
///
|
|
|
|
kb_action getLfun() const { return LFUN_FONT_FREE_UPDATE; }
|
|
|
|
|
|
|
|
///
|
|
|
|
void setFamily(Font::FONT_FAMILY);
|
|
|
|
///
|
|
|
|
void setSeries(Font::FONT_SERIES);
|
|
|
|
///
|
|
|
|
void setShape(Font::FONT_SHAPE);
|
|
|
|
///
|
|
|
|
void setSize(Font::FONT_SIZE);
|
|
|
|
///
|
|
|
|
void setBar(FontState);
|
|
|
|
///
|
|
|
|
void setColor(Color_color);
|
|
|
|
///
|
|
|
|
void setLanguage(std::string const &);
|
|
|
|
///
|
|
|
|
void setToggleAll(bool);
|
|
|
|
|
|
|
|
///
|
|
|
|
Font::FONT_FAMILY getFamily() const;
|
|
|
|
///
|
|
|
|
Font::FONT_SERIES getSeries() const;
|
|
|
|
///
|
|
|
|
Font::FONT_SHAPE getShape() const;
|
|
|
|
///
|
|
|
|
Font::FONT_SIZE getSize() const;
|
|
|
|
///
|
|
|
|
FontState getBar() const;
|
|
|
|
///
|
|
|
|
Color_color getColor() const;
|
|
|
|
///
|
|
|
|
std::string getLanguage() const;
|
|
|
|
///
|
|
|
|
bool getToggleAll() const;
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
Font font_;
|
|
|
|
///
|
|
|
|
bool toggleall_;
|
|
|
|
/// If true the language should be reset.
|
|
|
|
/// If false the language of font_ is used.
|
|
|
|
bool reset_lang_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#endif // GUICHARACTER_H
|