2002-11-15 02:41:54 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file ControlTabular.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-11-15 02:41:54 +00:00
|
|
|
*
|
|
|
|
* This is pretty icky, we should really be able to use
|
|
|
|
* ControlInset. We can't because there are no params for
|
|
|
|
* tabular inset.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONTROLTABULAR_H
|
|
|
|
#define CONTROLTABULAR_H
|
|
|
|
|
2003-03-09 18:11:57 +00:00
|
|
|
#include "Dialog.h"
|
2002-11-15 02:41:54 +00:00
|
|
|
#include "tabular.h"
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
2002-11-15 02:41:54 +00:00
|
|
|
|
2003-03-09 18:11:57 +00:00
|
|
|
class ControlTabular : public Dialog::Controller {
|
2002-11-15 02:41:54 +00:00
|
|
|
public:
|
|
|
|
|
2003-03-09 18:11:57 +00:00
|
|
|
ControlTabular(Dialog &);
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual bool initialiseParams(std::string const & data);
|
2003-03-09 18:11:57 +00:00
|
|
|
/// clean-up on hide.
|
|
|
|
virtual void clearParams();
|
|
|
|
/// We use set() instead.
|
|
|
|
virtual void dispatchParams() {};
|
|
|
|
///
|
|
|
|
virtual bool isBufferDependent() const { return true; }
|
2002-11-15 02:41:54 +00:00
|
|
|
|
2003-03-09 10:08:22 +00:00
|
|
|
///
|
2004-12-03 13:57:50 +00:00
|
|
|
LyXTabular::idx_type getActiveCell() const;
|
2002-11-15 02:41:54 +00:00
|
|
|
/// get the contained tabular
|
2003-03-09 10:08:22 +00:00
|
|
|
LyXTabular const & tabular() const;
|
|
|
|
/// return true if units should default to metric
|
|
|
|
bool useMetricUnits() const;
|
2002-11-15 02:41:54 +00:00
|
|
|
/// set a parameter
|
2003-10-06 15:43:21 +00:00
|
|
|
void set(LyXTabular::Feature, std::string const & arg = std::string());
|
2002-11-15 02:41:54 +00:00
|
|
|
|
2003-04-10 20:20:36 +00:00
|
|
|
/// borders
|
|
|
|
void toggleTopLine();
|
|
|
|
void toggleBottomLine();
|
|
|
|
void toggleLeftLine();
|
|
|
|
void toggleRightLine();
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
void setSpecial(std::string const & special);
|
2003-04-10 20:20:36 +00:00
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
void setWidth(std::string const & width);
|
2003-04-10 20:20:36 +00:00
|
|
|
|
|
|
|
void toggleMultiColumn();
|
|
|
|
|
|
|
|
void rotateTabular(bool yes);
|
|
|
|
void rotateCell(bool yes);
|
|
|
|
|
|
|
|
enum HALIGN { LEFT, RIGHT, CENTER, BLOCK };
|
|
|
|
|
|
|
|
void halign(HALIGN h);
|
|
|
|
|
2003-08-14 15:45:09 +00:00
|
|
|
enum VALIGN { TOP, MIDDLE, BOTTOM };
|
2003-04-10 20:20:36 +00:00
|
|
|
|
|
|
|
void valign(VALIGN h);
|
|
|
|
|
|
|
|
void longTabular(bool yes);
|
|
|
|
|
2002-11-15 02:41:54 +00:00
|
|
|
private:
|
2003-03-09 18:11:57 +00:00
|
|
|
///
|
2004-12-03 13:57:50 +00:00
|
|
|
LyXTabular::idx_type active_cell_;
|
2003-03-09 18:11:57 +00:00
|
|
|
///
|
|
|
|
boost::scoped_ptr<LyXTabular> params_;
|
2002-11-15 02:41:54 +00:00
|
|
|
};
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2002-11-15 02:41:54 +00:00
|
|
|
#endif // CONTROLTABULAR_H
|