]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiTabular.h
Fix left/right border UI when toggling formal
[lyx.git] / src / frontends / qt4 / GuiTabular.h
index 7339d5c60b991c856733427efd484ceb07bfbbf6..f56abdacfbdaa5b02b4e0b6cb7ec8037b58735f5 100644 (file)
@@ -6,8 +6,8 @@
  *
  * \author John Levon
  * \author Kalle Dalheimer
- * \author Jürgen Spitzmüller
- * \author Herbert Voß
+ * \author Jürgen Spitzmüller
+ * \author Herbert Voß
  *
  * Full author contact details are available in file CREDITS.
  */
 #ifndef GUITABULAR_H
 #define GUITABULAR_H
 
-#include "GuiDialogView.h"
-#include "ControlTabular.h"
+#include "InsetParamsWidget.h"
 #include "ui_TabularUi.h"
-
-#include <QDialog>
+#include "insets/InsetTabular.h"
 
 namespace lyx {
 namespace frontend {
 
-class GuiTabular;
-
-class GuiTabularDialog : public QDialog, public Ui::TabularUi
+class GuiTabular : public InsetParamsWidget, public Ui::TabularUi
 {
        Q_OBJECT
-public:
-       GuiTabularDialog(GuiTabular * form);
-
-protected Q_SLOTS:
-       virtual void change_adaptor();
 
-       virtual void topspace_changed();
-       virtual void bottomspace_changed();
-       virtual void interlinespace_changed();
-       virtual void booktabsChanged(bool);
-       virtual void close_clicked();
-       virtual void borderSet_clicked();
-       virtual void borderUnset_clicked();
-       virtual void leftBorder_changed();
-       virtual void rightBorder_changed();
-       virtual void topBorder_changed();
-       virtual void bottomBorder_changed();
-       virtual void multicolumn_clicked();
-       virtual void rotateTabular();
-       virtual void rotateCell();
-       virtual void hAlign_changed(int align);
-       virtual void vAlign_changed(int align);
-       virtual void specialAlignment_changed();
-       virtual void width_changed();
-       virtual void longTabular();
-       virtual void ltNewpage_clicked();
-       virtual void ltHeaderStatus_clicked();
-       virtual void ltHeaderBorderAbove_clicked();
-       virtual void ltHeaderBorderBelow_clicked();
-       virtual void ltFirstHeaderStatus_clicked();
-       virtual void ltFirstHeaderBorderAbove_clicked();
-       virtual void ltFirstHeaderBorderBelow_clicked();
-       virtual void ltFirstHeaderEmpty_clicked();
-       virtual void ltFooterStatus_clicked();
-       virtual void ltFooterBorderAbove_clicked();
-       virtual void ltFooterBorderBelow_clicked();
-       virtual void ltLastFooterStatus_clicked();
-       virtual void ltLastFooterBorderAbove_clicked();
-       virtual void ltLastFooterBorderBelow_clicked();
-       virtual void ltLastFooterEmpty_clicked();
-
-protected:
-       virtual void closeEvent(QCloseEvent * e);
-
-private:
-       GuiTabular * form_;
-};
-
-
-class GuiTabular : public GuiView<GuiTabularDialog> 
-{
 public:
-       friend class GuiTabularDialog;
-
-       GuiTabular(GuiDialog &);
-
-       /// parent controller
-       ControlTabular & controller()
-       { return static_cast<ControlTabular &>(this->getController()); }
-       /// parent controller
-       ControlTabular const & controller() const
-       { return static_cast<ControlTabular const &>(this->getController()); }
-protected:
-       virtual bool isValid();
+       GuiTabular(QWidget * parent = 0);
+
+private Q_SLOTS:
+       void checkEnabled();
+       void borderSet_clicked();
+       void borderUnset_clicked();
+       void booktabs_toggled(bool const check);
+       void nonbooktabs_toggled(bool const check);
+       void on_topspaceCO_activated(int index);
+       void on_bottomspaceCO_activated(int index);
+       void on_interlinespaceCO_activated(int index);
 
 private:
-       /// We can't use this ...
-       virtual void apply() {}
-       /// update borders
-       virtual void update_borders();
-       /// update
-       virtual void update_contents();
-       /// build the dialog
-       virtual void build_dialog();
-       /// save some values before closing the gui
-       virtual void closeGUI();
+       /// \name InsetParamsWidget inherited methods
+       //@{
+       InsetCode insetCode() const { return TABULAR_CODE; }
+       FuncCode creationCode() const { return LFUN_TABULAR_INSERT; }
+       QString dialogTitle() const { return qt_("Tabular Settings"); }
+       void paramsToDialog(Inset const *);
+       docstring dialogToParams() const;
+       bool checkWidgets(bool readonly) const;
+       //@}
+
+       ///
+       void enableWidgets() const;
+       ///
+       void setHAlign(std::string & param_str) const;
+       ///
+       void setVAlign(std::string & param_str) const;
+       ///
+       void setTableAlignment(std::string & param_str) const;
+       ///
+       void setWidthAndAlignment();
+       ///
+       bool funcEnabled(Tabular::Feature f) const;
+       ///
+       GuiSetBorder::BorderState borderState(GuiSetBorder::BorderState bs,
+                                             bool const line);
+       ///
+       bool firstheader_suppressable_;
+       ///
+       bool lastfooter_suppressable_;
+       ///
+       GuiSetBorder::BorderState orig_leftborder_;
+       ///
+       GuiSetBorder::BorderState orig_rightborder_;
 };
 
 } // namespace frontend