]> git.lyx.org Git - features.git/blob - src/frontends/controllers/ControlDocument.h
Remove warnings reported with gcc 4.3:
[features.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  * \author Richard Heck (modules)
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef CONTROLDOCUMENT_H
14 #define CONTROLDOCUMENT_H
15
16 #include "Dialog.h"
17 #include "support/FileName.h"
18 #include "support/filetools.h"
19 #include "support/types.h"
20 #include <boost/scoped_ptr.hpp>
21 #include <map>
22 #include <vector>
23
24 namespace lyx {
25
26 class BufferParams;
27 class TextClass;
28
29 namespace frontend {
30
31 ///
32 typedef void const * BufferId;
33 ///
34 typedef std::map<std::string, support::FileName> ModuleMap;
35
36 /** A controller for Document dialogs.
37  */
38 class ControlDocument : public Controller {
39 public:
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];
44         ///
45         ControlDocument(Dialog &);
46         ///
47         ~ControlDocument();
48         ///
49         virtual bool initialiseParams(std::string const & data);
50         ///
51         virtual void clearParams();
52         ///
53         virtual void dispatchParams();
54         ///
55         virtual bool isBufferDependent() const { return true; }
56         /// always true since we don't manipulate document contents
57         virtual bool canApply() const { return true; }
58         ///
59         TextClass const & textClass() const;
60         ///
61         BufferParams & params() const;
62         ///
63         BufferId id() 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();
68         ///
69         std::string getModuleDescription(std::string const & modName) const;
70         ///
71         std::vector<std::string> getPackageList(std::string const & modName) const;
72         ///
73         void setLanguage() const;
74         ///
75         void saveAsDefault() const;
76         ///
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;
84 private:
85         ///
86         void loadModuleNames();
87         ///
88         boost::scoped_ptr<BufferParams> bp_;
89         /// List of names of available modules
90         std::vector<std::string> moduleNames_;
91 };
92
93 } // namespace frontend
94 } // namespace lyx
95
96 #endif // CONTROLDOCUMENT_H