]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlDocument.h
hopefully fix tex2lyx linking.
[lyx.git] / src / frontends / controllers / ControlDocument.h
1 // -*- C++ -*-
2 /**
3  * \file ControlDocument.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Edwin Leuven
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef CONTROLDOCUMENT_H
13 #define CONTROLDOCUMENT_H
14
15 #include "Dialog.h"
16 #include "support/types.h"
17 #include <boost/scoped_ptr.hpp>
18
19 namespace lyx {
20
21 class BufferParams;
22 class LyXTextClass;
23
24 namespace frontend {
25
26 /** A controller for Document dialogs.
27  */
28 class ControlDocument : public Dialog::Controller {
29 public:
30         /// font family names for BufferParams::fontsDefaultFamily
31         static char const * const fontfamilies[5];
32         /// GUI names corresponding fontfamilies
33         static char const * fontfamilies_gui[5];
34         ///
35         ControlDocument(Dialog &);
36         ///
37         ~ControlDocument();
38         ///
39         virtual bool initialiseParams(std::string const & data);
40         ///
41         virtual void clearParams();
42         ///
43         virtual void dispatchParams();
44         ///
45         virtual bool isBufferDependent() const { return true; }
46         /// always true since we don't manipulate document contents
47         virtual bool canApply() const { return true; }
48         ///
49         LyXTextClass const & textClass() const;
50         ///
51         BufferParams & params() const;
52         ///
53         void setLanguage() const;
54         ///
55         void saveAsDefault() const;
56         ///
57         bool loadTextclass(textclass_type tc) const;
58         ///
59         bool const isFontAvailable(std::string const & font) const;
60         /// does this font provide Old Style figures?
61         bool const providesOSF(std::string const & font) const;
62         /// does this font provide true Small Caps?
63         bool const providesSC(std::string const & font) const;
64         /// does this font provide size adjustment?
65         bool const providesScale(std::string const & font) const;
66 private:
67         ///
68         boost::scoped_ptr<BufferParams> bp_;
69 };
70
71 } // namespace frontend
72 } // namespace lyx
73
74 #endif // CONTROLDOCUMENT_H