]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GDocument.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / gtk / GDocument.h
1 // -*- C++ -*-
2 /**
3  * \file GDocument.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Spray
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GDOCUMENT_H
13 #define GDOCUMENT_H
14
15 #include "GViewBase.h"
16 #include "vspace.h"
17
18 #include "BranchList.h"
19
20 #include "GtkLengthEntry.h"
21
22 #include <gtkmm.h>
23
24 #include <map>
25
26 namespace lyx {
27 namespace frontend {
28
29 class ControlDocument;
30
31 /** This class provides a gtk implementation of the document dialog.
32  */
33 class GDocument
34         : public GViewCB<ControlDocument, GViewGladeB> {
35 public:
36         GDocument(Dialog &);
37 private:
38         /// Build the dialog
39         virtual void doBuild();
40         /// Apply from dialog
41         virtual void apply();
42         /// Update the dialog
43         virtual void update();
44
45         void saveAsDefaults();
46         void resetToDefaults();
47
48         // *** Start "Document" Page ***
49         Gtk::ComboBoxText classcombo_;
50         Gtk::Entry * extraoptionsentry_;
51         Gtk::ComboBoxText psdrivercombo_;
52         Gtk::ComboBoxText fontsanscombo_;
53         Gtk::ComboBoxText fontromancombo_;
54         Gtk::ComboBoxText fonttypewritercombo_;
55         Gtk::ComboBoxText fontdefaultfamilycombo_;
56         Gtk::ComboBoxText fontsizecombo_;
57         Gtk::CheckButton * fontScCB_;
58         Gtk::CheckButton * fontOsfCB_;
59         Gtk::SpinButton * scaleSansSB_;
60         Gtk::SpinButton * scaleTypewriterSB_;
61         Gtk::Adjustment * linespacingadj_;
62         Gtk::RadioButton * indentradio_;
63         Gtk::RadioButton * vspaceradio_;
64         Gtk::ComboBoxText vspacesizecombo_;
65         std::map<int, VSpace::vspace_kind> vspacesizemap_;
66         GtkLengthEntry *vspacelengthentry_;
67         void updateParagraphSeparationSensitivity();
68         void classChanged();
69         // *** End "Document" Page ***
70
71         // *** Begin "Page" Page ***
72         GtkLengthEntry * pagewidthlengthentry_;
73         GtkLengthEntry * pageheightlengthentry_;
74         Gtk::ComboBoxText pagesizecombo_;
75         Gtk::RadioButton * portraitradio_;
76         Gtk::RadioButton * landscaperadio_;
77         Gtk::ComboBoxText pagestylecombo_;
78         Gtk::ToggleButton * doublesidedtoggle_;
79         Gtk::ToggleButton * twocolumnstoggle_;
80         void pageSizeChanged();
81         // *** End "Page" Page ***
82
83         // *** Begin "Margins" Page ***
84         Gtk::CheckButton * defaultmargins_;
85         GtkLengthEntry * mtoplengthentry_;
86         GtkLengthEntry * mbottomlengthentry_;
87         GtkLengthEntry * minnerlengthentry_;
88         GtkLengthEntry * mouterlengthentry_;
89         GtkLengthEntry * mheadseplengthentry_;
90         GtkLengthEntry * mheadheightlengthentry_;
91         GtkLengthEntry * mfootskiplengthentry_;
92         void marginsChanged();
93         // *** End "Margins" Page ***
94
95         // *** Start "Language" Page ***
96         Gtk::ComboBoxText languagecombo_;
97         Gtk::ComboBoxText encodingcombo_;
98         Gtk::RadioButton * qenglishradio_;
99         Gtk::RadioButton * qswedishradio_;
100         Gtk::RadioButton * qgermanradio_;
101         Gtk::RadioButton * qpolishradio_;
102         Gtk::RadioButton * qfrenchradio_;
103         Gtk::RadioButton * qdanishradio_;
104         std::vector<std::string> lang_;
105         // *** End "Language" Page ***
106
107         // *** Start "Numbering" Page ***
108         Gtk::Adjustment * numberingadj_;
109         Gtk::Adjustment * TOCadj_;
110         Gtk::Label * numberinglabel_;
111         Gtk::Label * TOClabel_;
112         void numberingChanged();
113         void TOCChanged();
114         // *** End "Numbering" Page ***
115
116         // *** Start "Bibliography" Page ***
117         Gtk::RadioButton * basicnumericalradio_;
118         Gtk::RadioButton * natbibnumericalradio_;
119         Gtk::RadioButton * natbibauthoryearradio_;
120         Gtk::RadioButton * jurabibradio_;
121         Gtk::ToggleButton * sectionedbibliographytoggle_;
122         // *** End "Bibliography" Page ***
123
124         // *** Start "Math" Page ***
125         Gtk::RadioButton * AMSautomaticallyradio_;
126         Gtk::RadioButton * AMSalwaysradio_;
127         Gtk::RadioButton * AMSneverradio_;
128         // *** End "Math" Page ***
129
130         // *** Start "Floats" Page ***
131         Gtk::RadioButton * defaultradio_;
132         Gtk::RadioButton * heredefinitelyradio_;
133         Gtk::RadioButton * alternativeradio_;
134         Gtk::CheckButton * topcheck_;
135         Gtk::CheckButton * bottomcheck_;
136         Gtk::CheckButton * pageoffloatscheck_;
137         Gtk::CheckButton * hereifpossiblecheck_;
138         Gtk::CheckButton * ignorerulescheck_;
139         void alternativeChanged();
140         // *** End "Floats" Page ***
141
142         // *** Start "Bullets" Page ***
143         // *** End "Bullets" Page ***
144
145         // *** Start "Branches" Page ***
146         //BranchList branchlist_;
147         Gtk::TreeView * branchesview_;
148         Gtk::Button * addbranchbutton_;
149         Gtk::Button * removebranchbutton_;
150         Gtk::TreeModelColumn<Glib::ustring> branchColName_;
151         Gtk::TreeModelColumn<bool> branchColActivated_;
152         Gtk::TreeModelColumn<Glib::ustring> branchColColor_;
153         Gtk::TreeModel::ColumnRecord branchCols_;
154
155         Glib::RefPtr<Gtk::ListStore> branchliststore_;
156         Glib::RefPtr<Gtk::TreeSelection> branchsel_;
157         void addBranch();
158         void removeBranch();
159         void branchSelChanged();
160         // *** End "Branches" Page ***
161
162         // *** Begin "Preamble" Page ***
163         Glib::RefPtr<Gtk::TextBuffer> preamblebuffer_;
164         // *** End "Preamble" Page ***
165 };
166
167 } // namespace frontend
168 } // namespace lyx
169
170 #endif