#ifndef CONTROLTABULAR_H
#define CONTROLTABULAR_H
-#include "ControlConnections.h"
-#include "LString.h"
+#include "Dialog.h"
#include "tabular.h"
-#include <boost/signals/connection.hpp>
-class InsetTabular;
-
-class ControlTabular : public ControlConnectBD {
+class ControlTabular : public Dialog::Controller {
public:
- ControlTabular(LyXView &, Dialogs &);
-
- /// get the inset
- InsetTabular * inset() const;
-
+ ControlTabular(Dialog &);
+ ///
+ virtual bool initialiseParams(string const & data);
+ /// clean-up on hide.
+ virtual void clearParams();
+ /// We use set() instead.
+ virtual void dispatchParams() {};
+ ///
+ virtual bool isBufferDependent() const { return true; }
+
+ ///
+ int getActiveCell() const;
/// get the contained tabular
- LyXTabular * tabular() const;
-
+ LyXTabular const & tabular() const;
+ /// return true if units should default to metric
+ bool useMetricUnits() const;
/// set a parameter
void set(LyXTabular::Feature, string const & arg = string());
- /// slot launching dialog to an existing inset.
- void showInset(InsetTabular *);
+ /// borders
+ void toggleTopLine();
+ void toggleBottomLine();
+ void toggleLeftLine();
+ void toggleRightLine();
- /// update inset
- void updateInset(InsetTabular *);
+ void setSpecial(string const & special);
- /// return true if units should default to metric
- bool metric() const;
+ void setWidth(string const & width);
- /// return true if actual cell is multicolumn
- bool isMulticolumnCell() const;
+ void toggleMultiColumn();
-private:
+ void rotateTabular(bool yes);
+ void rotateCell(bool yes);
- /// we can't do this ...
- virtual void apply() {};
- /// disconnect signals and hide View.
- virtual void hide();
- /// update the dialog.
- virtual void update();
-
- /** Instantiation of ControlConnectBD private virtual method.
- Slot connected to update signal. */
- virtual void updateSlot(bool);
-
- /// show the dialog.
- void show(InsetTabular *);
- /// connect signals
- void connectInset(InsetTabular *);
-
- /// pointer to the inset passed through connectInset
- InsetTabular * inset_;
- /// inset::hide connection.
- boost::signals::connection ih_;
-
- /// is the dialog built ?
- bool dialog_built_;
+ enum HALIGN { LEFT, RIGHT, CENTER, BLOCK };
+
+ void halign(HALIGN h);
+
+ enum VALIGN { TOP, MIDDLE, BOTTOM };
+
+ void valign(VALIGN h);
+
+ void longTabular(bool yes);
+
+private:
+ ///
+ int active_cell_;
+ ///
+ boost::scoped_ptr<LyXTabular> params_;
};
#endif // CONTROLTABULAR_H