]> 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 4dcd13534b4a9237d04049ad84e8a7671e46c5f7..f56abdacfbdaa5b02b4e0b6cb7ec8037b58735f5 100644 (file)
 #ifndef GUITABULAR_H
 #define GUITABULAR_H
 
-#include "GuiDialog.h"
+#include "InsetParamsWidget.h"
 #include "ui_TabularUi.h"
 #include "insets/InsetTabular.h"
 
 namespace lyx {
 namespace frontend {
 
-class GuiTabular : public GuiDialog, public Ui::TabularUi
+class GuiTabular : public InsetParamsWidget, public Ui::TabularUi
 {
        Q_OBJECT
 
 public:
-       GuiTabular(GuiView & lv);
-       ~GuiTabular();
+       GuiTabular(QWidget * parent = 0);
 
 private Q_SLOTS:
-       void change_adaptor();
-
-       void topspace_changed();
-       void bottomspace_changed();
-       void interlinespace_changed();
-       void booktabsChanged(bool);
-       void close_clicked();
+       void checkEnabled();
        void borderSet_clicked();
        void borderUnset_clicked();
-       void leftBorder_changed();
-       void rightBorder_changed();
-       void topBorder_changed();
-       void bottomBorder_changed();
-       void multicolumn_clicked();
-       void multirow_clicked();
-       void rotateTabular();
-       void rotateCell();
-       void hAlign_changed(int align);
-       void vAlign_changed(int align);
-       void tableAlignment_changed(int align);
-       void specialAlignment_changed();
-       void width_changed();
-       void longTabular();
-       void ltNewpage_clicked();
-       void ltHeaderStatus_clicked();
-       void ltHeaderBorderAbove_clicked();
-       void ltHeaderBorderBelow_clicked();
-       void ltFirstHeaderStatus_clicked();
-       void ltFirstHeaderBorderAbove_clicked();
-       void ltFirstHeaderBorderBelow_clicked();
-       void ltFirstHeaderEmpty_clicked();
-       void ltFooterStatus_clicked();
-       void ltFooterBorderAbove_clicked();
-       void ltFooterBorderBelow_clicked();
-       void ltLastFooterStatus_clicked();
-       void ltLastFooterBorderAbove_clicked();
-       void ltLastFooterBorderBelow_clicked();
-       void ltLastFooterEmpty_clicked();
-       void ltAlignment_clicked();
-       void on_captionStatusCB_toggled();
+       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:
+       /// \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;
+       //@}
+
        ///
-       bool isValid() { return true; }
-       /// update borders
-       void updateBorders(Tabular const & tabular);
-       /// update
-       void updateContents();
+       void enableWidgets() const;
        ///
-       void paramsToDialog(Tabular const & tabular);
-       /// save some values before closing the gui
-       void closeGUI(Tabular const & tabular);
+       void setHAlign(std::string & param_str) const;
        ///
-       bool initialiseParams(std::string const & data);
-       /// clean-up on hide.
-       void clearParams();
-       /// We use set() instead.
-       void dispatchParams() {};
+       void setVAlign(std::string & param_str) const;
        ///
-       bool isBufferDependent() const { return true; }
+       void setTableAlignment(std::string & param_str) const;
        ///
-       FuncCode getLfun() const { return LFUN_TABULAR_FEATURE; }
-
+       void setWidthAndAlignment();
        ///
-       Tabular::idx_type getActiveCell() const;
-       /// set a parameter
-       void set(Tabular::Feature, std::string const & arg = std::string());
-
-       void setSpecial(Tabular const & tabular, std::string const & special);
-
-       void setWidth(Tabular const & tabular, std::string const & width);
-
-       void toggleMultiColumn();
-       void toggleMultiRow();
-
-       void rotateTabular(bool yes);
-       void rotateCell(bool yes);
-
-       enum HALIGN { LEFT, RIGHT, CENTER, BLOCK };
-
-       void halign(Tabular const & tabular, HALIGN h);
-
-       enum VALIGN { TOP, MIDDLE, BOTTOM };
-
-       void valign(Tabular const & tabular, VALIGN h);
-
-       void booktabs(bool yes);
-
-       void longTabular(bool yes);
-
        bool funcEnabled(Tabular::Feature f) const;
-
        ///
-       Tabular::idx_type active_cell_;
+       GuiSetBorder::BorderState borderState(GuiSetBorder::BorderState bs,
+                                             bool const line);
+       ///
+       bool firstheader_suppressable_;
+       ///
+       bool lastfooter_suppressable_;
+       ///
+       GuiSetBorder::BorderState orig_leftborder_;
        ///
-       Tabular tabular_;
+       GuiSetBorder::BorderState orig_rightborder_;
 };
 
 } // namespace frontend