2002-10-09 08:59:02 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file ControlDocument.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-10-09 08:59:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONTROLDOCUMENT_H
|
|
|
|
#define CONTROLDOCUMENT_H
|
|
|
|
|
2004-03-30 19:18:14 +00:00
|
|
|
#include "Dialog.h"
|
2003-09-09 11:24:33 +00:00
|
|
|
#include "support/types.h"
|
2003-09-07 21:25:37 +00:00
|
|
|
#include <boost/scoped_ptr.hpp>
|
2002-10-09 08:59:02 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2003-09-09 11:24:33 +00:00
|
|
|
class BufferParams;
|
|
|
|
class LyXTextClass;
|
2002-10-09 08:59:02 +00:00
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace frontend {
|
2002-10-09 08:59:02 +00:00
|
|
|
|
|
|
|
/** A controller for Document dialogs.
|
|
|
|
*/
|
2004-03-30 19:18:14 +00:00
|
|
|
class ControlDocument : public Dialog::Controller {
|
2002-10-09 08:59:02 +00:00
|
|
|
public:
|
The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).
* lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).
* lib/chkconfig.ltx: Test for newly supported font packages
* lib/doc/LaTeXConfig.lyx.in: document newly supported font packages
* lib/doc/UserGuide.lyx: document new UI.
* lib/doc/Extended.lyx: update PostScript font documentation
* development/FORMAT: document file format change 246->247.
* src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans,
tex_fonts_monospaced (with GUI equivalents).
* src/buffer.C: Format up to 247.
* src/bufferparams.C:
new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,
fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
(LyXFont const BufferParams::getFont): consider switch of default family.
(string const BufferParams::loadFonts): new method to get all the LaTeX
font stuff done.
* src/paragraph.C
(LyXFont const Paragraph::getFont):
(LyXFont const Paragraph::getLabelFont):
(LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's
default font
* src/text.C
(int LyXText::leftMargin):
(int LyXText::rightMargin): user buffer's not textclass's default font
* src/text2.C
(LyXFont LyXText::getFont):
(LyXFont LyXText::getLayoutFont):
(LyXFont LyXText::getLabelFont): check if the family of the default document
font has been customized.
* src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).
* src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM).
* src/frontends/qt3/Makefile.dialogs: add new FontModuleBase
* src/frontends/qt3/ui/FontModuleBase.ui: new File
* src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets
* src/frontends/qt3/QDocument.C
* src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/Makefile.dialogs: add new FontUi
* src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/ui/FontUi.ui: new File
* src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets
* src/frontends/qt4/ui/compile_uic.sh: add new FontUi
* src/frontends/xforms/FormDocument.[Ch]: implement new font ui
* src/frontends/xforms/forms/form_document.fd: add new font tab.
* src/frontends/controllers/ControlDocument.[Ch]
(char ControlDocument::fontfamilies):
(char ControlDocument::fontfamilies_gui):
(bool ControlDocument::isFontAvailable):
(bool ControlDocument::providesSC):
(bool ControlDocument::providesOSF):
(bool ControlDocument::providesScale): new methods, providing font info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
|
|
|
/// font family names for BufferParams::fontsDefaultFamily
|
|
|
|
static char const * const fontfamilies[5];
|
|
|
|
/// GUI names corresponding fontfamilies
|
|
|
|
static char const * fontfamilies_gui[5];
|
2002-10-09 08:59:02 +00:00
|
|
|
///
|
2004-03-30 19:18:14 +00:00
|
|
|
ControlDocument(Dialog &);
|
2002-10-20 01:48:28 +00:00
|
|
|
///
|
2002-10-09 08:59:02 +00:00
|
|
|
~ControlDocument();
|
|
|
|
///
|
2004-03-30 19:18:14 +00:00
|
|
|
virtual bool initialiseParams(std::string const & data);
|
|
|
|
///
|
|
|
|
virtual void clearParams();
|
|
|
|
///
|
|
|
|
virtual void dispatchParams();
|
|
|
|
///
|
|
|
|
virtual bool isBufferDependent() const { return true; }
|
2005-04-26 09:37:52 +00:00
|
|
|
/// always true since we don't manipulate document contents
|
|
|
|
virtual bool canApply() const { return true; }
|
2004-03-30 19:18:14 +00:00
|
|
|
///
|
|
|
|
LyXTextClass const & textClass() const;
|
2002-10-09 08:59:02 +00:00
|
|
|
///
|
2004-03-30 19:18:14 +00:00
|
|
|
BufferParams & params() const;
|
2002-10-09 08:59:02 +00:00
|
|
|
///
|
2004-03-30 19:18:14 +00:00
|
|
|
void setLanguage() const;
|
2002-10-09 08:59:02 +00:00
|
|
|
///
|
2004-03-30 19:18:14 +00:00
|
|
|
void saveAsDefault() const;
|
2002-10-20 01:48:28 +00:00
|
|
|
///
|
2004-05-19 15:11:37 +00:00
|
|
|
bool loadTextclass(textclass_type tc) const;
|
The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).
* lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).
* lib/chkconfig.ltx: Test for newly supported font packages
* lib/doc/LaTeXConfig.lyx.in: document newly supported font packages
* lib/doc/UserGuide.lyx: document new UI.
* lib/doc/Extended.lyx: update PostScript font documentation
* development/FORMAT: document file format change 246->247.
* src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans,
tex_fonts_monospaced (with GUI equivalents).
* src/buffer.C: Format up to 247.
* src/bufferparams.C:
new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,
fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
(LyXFont const BufferParams::getFont): consider switch of default family.
(string const BufferParams::loadFonts): new method to get all the LaTeX
font stuff done.
* src/paragraph.C
(LyXFont const Paragraph::getFont):
(LyXFont const Paragraph::getLabelFont):
(LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's
default font
* src/text.C
(int LyXText::leftMargin):
(int LyXText::rightMargin): user buffer's not textclass's default font
* src/text2.C
(LyXFont LyXText::getFont):
(LyXFont LyXText::getLayoutFont):
(LyXFont LyXText::getLabelFont): check if the family of the default document
font has been customized.
* src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).
* src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM).
* src/frontends/qt3/Makefile.dialogs: add new FontModuleBase
* src/frontends/qt3/ui/FontModuleBase.ui: new File
* src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets
* src/frontends/qt3/QDocument.C
* src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/Makefile.dialogs: add new FontUi
* src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/ui/FontUi.ui: new File
* src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets
* src/frontends/qt4/ui/compile_uic.sh: add new FontUi
* src/frontends/xforms/FormDocument.[Ch]: implement new font ui
* src/frontends/xforms/forms/form_document.fd: add new font tab.
* src/frontends/controllers/ControlDocument.[Ch]
(char ControlDocument::fontfamilies):
(char ControlDocument::fontfamilies_gui):
(bool ControlDocument::isFontAvailable):
(bool ControlDocument::providesSC):
(bool ControlDocument::providesOSF):
(bool ControlDocument::providesScale): new methods, providing font info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
|
|
|
///
|
|
|
|
bool const isFontAvailable(std::string const & font) const;
|
|
|
|
/// does this font provide Old Style figures?
|
|
|
|
bool const providesOSF(std::string const & font) const;
|
|
|
|
/// does this font provide true Small Caps?
|
|
|
|
bool const providesSC(std::string const & font) const;
|
|
|
|
/// does this font provide size adjustment?
|
|
|
|
bool const providesScale(std::string const & font) const;
|
2002-10-09 08:59:02 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
boost::scoped_ptr<BufferParams> bp_;
|
|
|
|
};
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
#endif // CONTROLDOCUMENT_H
|