3 * \file ControlDocument.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Richard Heck (modules)
10 * Full author contact details are available in file CREDITS.
13 #ifndef CONTROLDOCUMENT_H
14 #define CONTROLDOCUMENT_H
17 #include "support/FileName.h"
18 #include "support/filetools.h"
19 #include "support/types.h"
20 #include <boost/scoped_ptr.hpp>
32 typedef void const * BufferId;
34 typedef std::map<std::string, support::FileName> ModuleMap;
36 /** A controller for Document dialogs.
38 class ControlDocument : public Controller {
40 /// font family names for BufferParams::fontsDefaultFamily
41 static char const * const fontfamilies[5];
42 /// GUI names corresponding fontfamilies
43 static char const * fontfamilies_gui[5];
45 ControlDocument(Dialog &);
49 virtual bool initialiseParams(std::string const & data);
51 virtual void clearParams();
53 virtual void dispatchParams();
55 virtual bool isBufferDependent() const { return true; }
56 /// always true since we don't manipulate document contents
57 virtual bool canApply() const { return true; }
59 TextClass const & textClass() const;
61 BufferParams & params() const;
64 /// List of available modules
65 std::vector<std::string> getModuleNames();
66 /// Modules in use in current buffer
67 std::vector<std::string> const & getSelectedModules();
69 std::string getModuleDescription(std::string const & modName) const;
71 std::vector<std::string> getPackageList(std::string const & modName) const;
73 void setLanguage() const;
75 void saveAsDefault() const;
77 bool isFontAvailable(std::string const & font) const;
78 /// does this font provide Old Style figures?
79 bool providesOSF(std::string const & font) const;
80 /// does this font provide true Small Caps?
81 bool providesSC(std::string const & font) const;
82 /// does this font provide size adjustment?
83 bool providesScale(std::string const & font) const;
86 void loadModuleNames();
88 boost::scoped_ptr<BufferParams> bp_;
89 /// List of names of available modules
90 std::vector<std::string> moduleNames_;
93 } // namespace frontend
96 #endif // CONTROLDOCUMENT_H