4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Bernhard Reiter
9 * Full author contact details are available in file CREDITS.
15 #include "GViewBase.h"
17 #include "GtkLengthEntry.h"
19 #include "insets/ExternalTemplate.h"
20 #include "insets/insetexternal.h"
27 class ControlExternal;
29 /** This class provides a GTK+ implementation of the External Dialog.
31 class GExternal : public GViewCB<ControlExternal, GViewGladeB> {
33 GExternal(Dialog & parent);
36 virtual void doBuild();
37 virtual void update();
39 /** Called if a different template is selected from the templates combo
40 Updates the dialog widgets accordingly
42 void update_template();
44 /** Called if the "Get from file" button in the Crop tab is pressed
45 Inserts bounding box coordinates from file into coordinate entries
49 /** Checks if the Aspect Ratio CheckButton is to be activated
50 True if widthlength_'s unit is not Scale% and both widthlength and
51 heightlength_ are nonzero
53 bool activate_ar() const;
55 /** Calls controller().bbChanged() providing it with new coordinates
56 if they any of them were changed
60 /** Calls controller().editExternal() if corresponding button is
65 /** Sets Aspect Ratio CheckButton and Height Length sensitive or greys
66 them out depending on widthlength_'s and heightlength_'s status
67 Called if either widthlength_ or heightlength_ were changed
71 /// enables the apply button
72 void template_changed();
74 /** Sets sensitivity of the LyxView tab's other widgets depending und
75 the 'Show in LyX' CheckButton
77 void showcheck_toggled();
80 /** Sets sensitivity of the Crop tab's other widgets depending und
81 the 'Clip to bounding box' CheckButton
83 void clipcheck_toggled();
85 /** Sets sensitivity of the 'Edit file' and
86 'Get [bounding box] from file' buttons if there was a file selected
90 /// Holds the currently selected template
91 Gtk::TreeModel::iterator currenttemplate_;
94 // Widgets & couple of corresponding models
96 Gtk::Button * cancelbutton_;
97 Gtk::Button * okbutton_;
98 Gtk::Button * applybutton_;
100 Glib::RefPtr<Gtk::ListStore> templatestore_;
101 Gtk::ComboBox * templatecombo_;
103 Glib::RefPtr<Gtk::TextBuffer> templatebuffer_;
104 Gtk::TextView * templateview_;
106 Gtk::Notebook * notebook_;
108 // *** Start "File" Page ***
109 Gtk::Label * filelabel_;
110 Gtk::FileChooserButton * templatefcbutton_; //requires gtkmm>=2.6
111 Gtk::Button * editfilebutton_;
112 Gtk::CheckButton * draftcheck_;
113 // *** End "File" Page ***
115 // *** Start "LyX View" Page ***
116 Gtk::CheckButton * showcheck_;
117 Gtk::Label * displaylabel_;
118 Glib::RefPtr<Gtk::ListStore> displaystore_;
119 Gtk::ComboBox * displaycombo_;
120 Gtk::Label * scalelabel_;
121 GtkLengthEntry * scalelength_;
122 Gtk::ComboBoxText * scalecombo_;
123 Gtk::SpinButton * scalespin_;
124 Gtk::Label * percentlabel_;
125 // *** End "LyX View" Page ***
127 // *** Start "Rotate" Page ***
128 Gtk::Entry * angleentry_;
129 Gtk::Label * originlabel_;
130 Gtk::ComboBoxText origincombo_;
131 // *** End "Rotate" Page ***
133 // *** Start "Scale" Page ***
134 Gtk::CheckButton * archeck_;
135 Gtk::Label * widthlabel_;
136 GtkLengthEntry * widthlength_;
137 Gtk::Label * heightlabel_;
138 GtkLengthEntry * heightlength_;
140 Gtk::ComboBoxText * widthcombo_;
141 // *** End "Scale" Page ***
143 // *** Start "Crop" Page ***
144 Gtk::CheckButton * clipcheck_;
145 Gtk::Button * bbfromfilebutton_;
147 Gtk::Label * xlabel_;
148 Gtk::Label * ylabel_;
149 Gtk::Label * rtlabel_;
150 Gtk::Label * lblabel_;
152 Gtk::Entry * xlentry_;
153 Gtk::Entry * ybentry_;
154 Gtk::Entry * xrentry_;
155 Gtk::Entry * ytentry_;
156 // *** End "Crop" Page ***
158 // *** Start "Options" Page ***
159 Glib::RefPtr<Gtk::ListStore> formatstore_;
160 Gtk::TreeView * optionsview_;
161 // *** End "Options" Page ***
165 } // namespace frontend
168 #endif // GEXTERNAL_H