]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlDocument.h
Fixed some lines that were too long. It compiled afterwards.
[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 TextClass;
23
24 namespace frontend {
25
26 ///
27 typedef void const * BufferId;
28
29 /** A controller for Document dialogs.
30  */
31 class ControlDocument : public Dialog::Controller {
32 public:
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];
37         ///
38         ControlDocument(Dialog &);
39         ///
40         ~ControlDocument();
41         ///
42         virtual bool initialiseParams(std::string const & data);
43         ///
44         virtual void clearParams();
45         ///
46         virtual void dispatchParams();
47         ///
48         virtual bool isBufferDependent() const { return true; }
49         /// always true since we don't manipulate document contents
50         virtual bool canApply() const { return true; }
51         ///
52         TextClass const & textClass() const;
53         ///
54         BufferParams & params() const;
55         ///
56         BufferId id() const;
57         ///
58         void setLanguage() const;
59         ///
60         void saveAsDefault() const;
61         ///
62         bool loadTextclass(textclass_type tc) const;
63         ///
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;
71 private:
72         ///
73         boost::scoped_ptr<BufferParams> bp_;
74 };
75
76 } // namespace frontend
77 } // namespace lyx
78
79 #endif // CONTROLDOCUMENT_H