3 * \file ControlDocument.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef CONTROLDOCUMENT_H
13 #define CONTROLDOCUMENT_H
16 #include "support/types.h"
17 #include <boost/scoped_ptr.hpp>
27 typedef void const * BufferId;
29 /** A controller for Document dialogs.
31 class ControlDocument : public Dialog::Controller {
33 /// font family names for BufferParams::fontsDefaultFamily
34 static char const * const fontfamilies[5];
35 /// GUI names corresponding fontfamilies
36 static char const * fontfamilies_gui[5];
38 ControlDocument(Dialog &);
42 virtual bool initialiseParams(std::string const & data);
44 virtual void clearParams();
46 virtual void dispatchParams();
48 virtual bool isBufferDependent() const { return true; }
49 /// always true since we don't manipulate document contents
50 virtual bool canApply() const { return true; }
52 TextClass const & textClass() const;
54 BufferParams & params() const;
58 void setLanguage() const;
60 void saveAsDefault() const;
62 bool loadTextclass(textclass_type tc) const;
64 bool const isFontAvailable(std::string const & font) const;
65 /// does this font provide Old Style figures?
66 bool const providesOSF(std::string const & font) const;
67 /// does this font provide true Small Caps?
68 bool const providesSC(std::string const & font) const;
69 /// does this font provide size adjustment?
70 bool const providesScale(std::string const & font) const;
73 boost::scoped_ptr<BufferParams> bp_;
76 } // namespace frontend
79 #endif // CONTROLDOCUMENT_H