]> git.lyx.org Git - lyx.git/blob - src/insets/InsetTabular.h
make code look a bit more uniform
[lyx.git] / src / insets / InsetTabular.h
1 // -*- C++ -*-
2 /**
3  * \file InsetTabular.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jürgen Vigna
8  * \author Lars Gullik Bjønnes
9  * \author Matthias Ettrich
10  * \author André Pönitz
11  * \author Jürgen Vigna
12  *
13  * Full author contact details are available in file CREDITS.
14  */
15
16
17 // This is Juergen's rewrite of the tabular (table) support.
18
19 // Things to think of when designing the new tabular support:
20 // - color support (colortbl, color)
21 // - decimal alignment (dcloumn)
22 // - custom lines (hhline)
23 // - rotation
24 // - multicolumn
25 // - multirow
26 // - column styles
27
28 // This is what I have written about tabular support in the LyX3-Tasks file:
29 //
30 //  o rewrite of table code. Should probably be written as some
31 //    kind of an inset. [Done]
32 // o enhance longtable support
33
34 // Lgb
35
36 #ifndef INSETTABULAR_H
37 #define INSETTABULAR_H
38
39 #include "Inset.h"
40 #include "InsetText.h"
41 #include "Layout.h"
42 #include "Length.h"
43 #include "MailInset.h"
44
45 #include <boost/shared_ptr.hpp>
46
47 #include <iosfwd>
48 #include <vector>
49
50 namespace lyx {
51
52 class FuncStatus;
53 class Lexer;
54 class BufferView;
55 class Buffer;
56 class BufferParams;
57 class Paragraph;
58 class CursorSlice;
59
60 namespace frontend { class Painter; }
61
62
63 class InsetTabular;
64 class Cursor;
65 class OutputParams;
66
67 //
68 // A helper struct for tables
69 //
70 class Tabular {
71 public:
72         ///
73         enum Feature {
74                 ///
75                 APPEND_ROW = 0,
76                 ///
77                 APPEND_COLUMN,
78                 ///
79                 DELETE_ROW,
80                 ///
81                 DELETE_COLUMN,
82                 ///
83                 COPY_ROW,
84                 ///
85                 COPY_COLUMN,
86                 ///
87                 TOGGLE_LINE_TOP,
88                 ///
89                 TOGGLE_LINE_BOTTOM,
90                 ///
91                 TOGGLE_LINE_LEFT,
92                 ///
93                 TOGGLE_LINE_RIGHT,
94                 ///
95                 ALIGN_LEFT,
96                 ///
97                 ALIGN_RIGHT,
98                 ///
99                 ALIGN_CENTER,
100                 ///
101                 ALIGN_BLOCK,
102                 ///
103                 VALIGN_TOP,
104                 ///
105                 VALIGN_BOTTOM,
106                 ///
107                 VALIGN_MIDDLE,
108                 ///
109                 M_TOGGLE_LINE_TOP,
110                 ///
111                 M_TOGGLE_LINE_BOTTOM,
112                 ///
113                 M_TOGGLE_LINE_LEFT,
114                 ///
115                 M_TOGGLE_LINE_RIGHT,
116                 ///
117                 M_ALIGN_LEFT,
118                 ///
119                 M_ALIGN_RIGHT,
120                 ///
121                 M_ALIGN_CENTER,
122                 ///
123                 M_VALIGN_TOP,
124                 ///
125                 M_VALIGN_BOTTOM,
126                 ///
127                 M_VALIGN_MIDDLE,
128                 ///
129                 MULTICOLUMN,
130                 ///
131                 SET_ALL_LINES,
132                 ///
133                 UNSET_ALL_LINES,
134                 ///
135                 SET_LONGTABULAR,
136                 ///
137                 UNSET_LONGTABULAR,
138                 ///
139                 SET_PWIDTH,
140                 ///
141                 SET_MPWIDTH,
142                 ///
143                 SET_ROTATE_TABULAR,
144                 ///
145                 UNSET_ROTATE_TABULAR,
146                 ///
147                 TOGGLE_ROTATE_TABULAR,
148                 ///
149                 SET_ROTATE_CELL,
150                 ///
151                 UNSET_ROTATE_CELL,
152                 ///
153                 TOGGLE_ROTATE_CELL,
154                 ///
155                 SET_USEBOX,
156                 ///
157                 SET_LTHEAD,
158                 UNSET_LTHEAD,
159                 ///
160                 SET_LTFIRSTHEAD,
161                 UNSET_LTFIRSTHEAD,
162                 ///
163                 SET_LTFOOT,
164                 UNSET_LTFOOT,
165                 ///
166                 SET_LTLASTFOOT,
167                 UNSET_LTLASTFOOT,
168                 ///
169                 SET_LTNEWPAGE,
170                 ///
171                 SET_SPECIAL_COLUMN,
172                 ///
173                 SET_SPECIAL_MULTI,
174                 ///
175                 SET_BOOKTABS,
176                 ///
177                 UNSET_BOOKTABS,
178                 ///
179                 SET_TOP_SPACE,
180                 ///
181                 SET_BOTTOM_SPACE,
182                 ///
183                 SET_INTERLINE_SPACE,
184                 ///
185                 LAST_ACTION
186         };
187         ///
188         enum {
189                 ///
190                 CELL_NORMAL = 0,
191                 ///
192                 CELL_BEGIN_OF_MULTICOLUMN,
193                 ///
194                 CELL_PART_OF_MULTICOLUMN
195         };
196
197         ///
198         enum VAlignment {
199                 ///
200                 LYX_VALIGN_TOP = 0,
201                 ///
202                 LYX_VALIGN_BOTTOM = 1,
203                 ///
204                 LYX_VALIGN_MIDDLE = 2
205         };
206
207         enum BoxType {
208                 ///
209                 BOX_NONE = 0,
210                 ///
211                 BOX_PARBOX = 1,
212                 ///
213                 BOX_MINIPAGE = 2
214         };
215
216         class ltType {
217         public:
218                 // constructor
219                 ltType();
220                 // we have this header type (is set in the getLT... functions)
221                 bool set;
222                 // double borders on top
223                 bool topDL;
224                 // double borders on bottom
225                 bool bottomDL;
226                 // used for FirstHeader & LastFooter and if this is true
227                 // all the rows marked as FirstHeader or LastFooter are
228                 // ignored in the output and it is set to be empty!
229                 bool empty;
230         };
231
232         /// type for row numbers
233         typedef size_t row_type;
234         /// type for column numbers
235         typedef size_t col_type;
236         /// type for cell indices
237         typedef size_t idx_type;
238         /// index indicating an invalid position
239         static const idx_type npos = static_cast<idx_type>(-1);
240
241         /// constructor
242         Tabular();
243         /// constructor
244         Tabular(Buffer const &, col_type columns_arg, row_type rows_arg);
245
246         /// Returns true if there is a topline, returns false if not
247         bool topLine(idx_type cell, bool wholerow = false) const;
248         /// Returns true if there is a topline, returns false if not
249         bool bottomLine(idx_type cell, bool wholerow = false) const;
250         /// Returns true if there is a topline, returns false if not
251         bool leftLine(idx_type cell, bool wholecolumn = false) const;
252         /// Returns true if there is a topline, returns false if not
253         bool rightLine(idx_type cell, bool wholecolumn = false) const;
254
255         ///
256         bool topAlreadyDrawn(idx_type cell) const;
257         ///
258         bool leftAlreadyDrawn(idx_type cell) const;
259         ///
260         bool isLastRow(idx_type cell) const;
261
262         /// return space occupied by the second horizontal line and
263         /// interline space above row \p row in pixels
264         int getAdditionalHeight(row_type row) const;
265         ///
266         int getAdditionalWidth(idx_type cell) const;
267
268         /* returns the maximum over all rows */
269         ///
270         int columnWidth(idx_type cell) const;
271         ///
272         int width() const;
273         ///
274         int height() const;
275         ///
276         int rowAscent(row_type row) const;
277         ///
278         int rowDescent(row_type row) const;
279         ///
280         void setRowAscent(row_type row, int height);
281         ///
282         void setRowDescent(row_type row, int height);
283         ///
284         void setCellWidth(idx_type cell, int new_width);
285         ///
286         void setAllLines(idx_type cell, bool line);
287         ///
288         void setTopLine(idx_type cell, bool line, bool wholerow = false);
289         ///
290         void setBottomLine(idx_type cell, bool line, bool wholerow = false);
291         ///
292         void setLeftLine(idx_type cell, bool line, bool wholecolumn = false);
293         ///
294         void setRightLine(idx_type cell, bool line, bool wholecolumn = false);
295         ///
296         void setAlignment(idx_type cell, LyXAlignment align,
297                           bool onlycolumn = false);
298         ///
299         void setVAlignment(idx_type cell, VAlignment align,
300                            bool onlycolumn = false);
301         ///
302         void setColumnPWidth(Cursor &, idx_type, Length const &);
303         ///
304         bool setMColumnPWidth(Cursor &, idx_type, Length const &);
305         ///
306         void setAlignSpecial(idx_type cell, docstring const & special,
307                              Feature what);
308         ///
309         LyXAlignment getAlignment(idx_type cell,
310                                   bool onlycolumn = false) const;
311         ///
312         VAlignment getVAlignment(idx_type cell,
313                                  bool onlycolumn = false) const;
314         ///
315         Length const getPWidth(idx_type cell) const;
316         ///
317         Length const getColumnPWidth(idx_type cell) const;
318         ///
319         Length const getMColumnPWidth(idx_type cell) const;
320         ///
321         docstring const getAlignSpecial(idx_type cell, int what) const;
322         ///
323         int cellWidth(idx_type cell) const;
324         ///
325         int getBeginningOfTextInCell(idx_type cell) const;
326         ///
327         void appendRow(idx_type cell);
328         ///
329         void deleteRow(row_type row);
330         ///
331         void copyRow(row_type);
332         ///
333         void appendColumn(idx_type cell);
334         ///
335         void deleteColumn(col_type column);
336         ///
337         void copyColumn(col_type);
338         ///
339         bool isFirstCellInRow(idx_type cell) const;
340         ///
341         idx_type getFirstCellInRow(row_type row) const;
342         ///
343         bool isLastCellInRow(idx_type cell) const;
344         ///
345         idx_type getLastCellInRow(row_type row) const;
346         ///
347         idx_type cellCount() const;
348         ///
349         idx_type numberOfCellsInRow(idx_type cell) const;
350         ///
351         void write(std::ostream &) const;
352         ///
353         void read(Lexer &);
354         ///
355         int latex(odocstream &, OutputParams const &) const;
356         //
357         int docbook(odocstream & os, OutputParams const &) const;
358         ///
359         void plaintext(odocstream &,
360                        OutputParams const & runparams, int const depth,
361                        bool onlydata, char_type delim) const;
362         ///
363         bool isMultiColumn(idx_type cell) const;
364         ///
365         bool isMultiColumnReal(idx_type cell) const;
366         ///
367         void setMultiColumn(idx_type cell, idx_type number);
368         ///
369         idx_type unsetMultiColumn(idx_type cell); // returns number of new cells
370         ///
371         bool isPartOfMultiColumn(row_type row, col_type column) const;
372         ///
373         row_type cellRow(idx_type cell) const;
374         ///
375         col_type cellColumn(idx_type cell) const;
376         ///
377         col_type cellRightColumn(idx_type cell) const;
378         ///
379         void setBookTabs(bool);
380         ///
381         bool useBookTabs() const;
382         ///
383         void setLongTabular(bool);
384         ///
385         bool isLongTabular() const;
386         ///
387         void setRotateTabular(bool);
388         ///
389         bool getRotateTabular() const;
390         ///
391         void setRotateCell(idx_type cell, bool);
392         ///
393         bool getRotateCell(idx_type cell) const;
394         ///
395         bool needRotating() const;
396         ///
397         bool isLastCell(idx_type cell) const;
398         ///
399         idx_type getCellAbove(idx_type cell) const;
400         ///
401         idx_type getCellBelow(idx_type cell) const;
402         ///
403         idx_type getLastCellAbove(idx_type cell) const;
404         ///
405         idx_type getLastCellBelow(idx_type cell) const;
406         ///
407         idx_type cellIndex(row_type row, col_type column) const;
408         ///
409         void setUsebox(idx_type cell, BoxType);
410         ///
411         BoxType getUsebox(idx_type cell) const;
412         //
413         // Long Tabular Options support functions
414         ///
415         bool checkLTType(row_type row, ltType const &) const;
416         ///
417         void setLTHead(row_type row, bool flag, ltType const &, bool first);
418         ///
419         bool getRowOfLTHead(row_type row, ltType &) const;
420         ///
421         bool getRowOfLTFirstHead(row_type row, ltType &) const;
422         ///
423         void setLTFoot(row_type row, bool flag, ltType const &, bool last);
424         ///
425         bool getRowOfLTFoot(row_type row, ltType &) const;
426         ///
427         bool getRowOfLTLastFoot(row_type row, ltType &) const;
428         ///
429         void setLTNewPage(row_type row, bool what);
430         ///
431         bool getLTNewPage(row_type row) const;
432         ///
433         bool haveLTHead() const;
434         ///
435         bool haveLTFirstHead() const;
436         ///
437         bool haveLTFoot() const;
438         ///
439         bool haveLTLastFoot() const;
440         ///
441         // end longtable support
442         ///
443         boost::shared_ptr<InsetText> getCellInset(idx_type cell) const;
444         ///
445         boost::shared_ptr<InsetText> getCellInset(row_type row,
446                                                   col_type column) const;
447         ///
448         void setCellInset(row_type row, col_type column,
449                           boost::shared_ptr<InsetText>) const;
450         /// Search for \param inset in the tabular, with the
451         ///
452         idx_type getCellFromInset(Inset const * inset) const;
453         ///
454         row_type rowCount() const { return row_info.size(); }
455         ///
456         col_type columnCount() const { return column_info.size();}
457         ///
458         void validate(LaTeXFeatures &) const;
459         ///
460 //private:
461         ///
462         class CellData {
463         public:
464                 ///
465                 CellData(Buffer const &);
466                 ///
467                 CellData(CellData const &);
468                 ///
469                 CellData & operator=(CellData);
470                 ///
471                 void swap(CellData & rhs);
472                 ///
473                 idx_type cellno;
474                 ///
475                 int width;
476                 ///
477                 int multicolumn;
478                 ///
479                 LyXAlignment alignment;
480                 ///
481                 VAlignment valignment;
482                 ///
483                 bool top_line;
484                 ///
485                 bool bottom_line;
486                 ///
487                 bool left_line;
488                 ///
489                 bool right_line;
490                 ///
491                 BoxType usebox;
492                 ///
493                 bool rotate;
494                 ///
495                 docstring align_special;
496                 ///
497                 Length p_width; // this is only set for multicolumn!!!
498                 ///
499                 boost::shared_ptr<InsetText> inset;
500         };
501         CellData & cellinfo_of_cell(idx_type cell) const;
502         ///
503         typedef std::vector<CellData> cell_vector;
504         ///
505         typedef std::vector<cell_vector> cell_vvector;
506
507         ///
508         class RowData {
509         public:
510                 ///
511                 RowData();
512                 ///
513                 int ascent;
514                 ///
515                 int descent;
516                 ///
517                 bool top_line;
518                 ///
519                 bool bottom_line;
520                 /// Extra space between the top line and this row
521                 Length top_space;
522                 /// Ignore top_space if true and use the default top space
523                 bool top_space_default;
524                 /// Extra space between this row and the bottom line
525                 Length bottom_space;
526                 /// Ignore bottom_space if true and use the default bottom space
527                 bool bottom_space_default;
528                 /// Extra space between the bottom line and the next top line
529                 Length interline_space;
530                 /// Ignore interline_space if true and use the default interline space
531                 bool interline_space_default;
532                 /// This are for longtabulars only
533                 /// a row of endhead
534                 bool endhead;
535                 /// a row of endfirsthead
536                 bool endfirsthead;
537                 /// a row of endfoot
538                 bool endfoot;
539                 /// row of endlastfoot
540                 bool endlastfoot;
541                 /// row for a newpage
542                 bool newpage;
543         };
544         ///
545         typedef std::vector<RowData> row_vector;
546
547         ///
548         class ColumnData {
549                 public:
550                 ///
551                 ColumnData();
552                 ///
553                 LyXAlignment alignment;
554                 ///
555                 VAlignment valignment;
556                 ///
557                 bool left_line;
558                 ///
559                 bool right_line;
560                 ///
561                 int width;
562                 ///
563                 Length p_width;
564                 ///
565                 docstring align_special;
566         };
567         ///
568         typedef std::vector<ColumnData> column_vector;
569
570         ///
571         idx_type numberofcells;
572         ///
573         std::vector<row_type> rowofcell;
574         ///
575         std::vector<col_type> columnofcell;
576         ///
577         row_vector row_info;
578         ///
579         column_vector column_info;
580         ///
581         mutable cell_vvector cell_info;
582         ///
583         bool use_booktabs;
584         ///
585         bool rotate;
586         //
587         // for long tabulars
588         //
589         bool is_long_tabular;
590         /// endhead data
591         ltType endhead;
592         /// endfirsthead data
593         ltType endfirsthead;
594         /// endfoot data
595         ltType endfoot;
596         /// endlastfoot data
597         ltType endlastfoot;
598
599         ///
600         void init(Buffer const &, row_type rows_arg,
601                   col_type columns_arg);
602         ///
603         void updateIndexes();
604         /// Returns true if a complete update is necessary, otherwise false
605         bool setWidthOfMulticolCell(idx_type cell, int new_width);
606         ///
607         void recalculateMulticolumnsOfColumn(col_type column);
608         /// Returns true if change
609         void calculate_width_of_column(col_type column);
610         ///
611         bool calculate_width_of_column_NMC(col_type column); // no multi cells
612         ///
613         idx_type cells_in_multicolumn(idx_type cell) const;
614         ///
615         BoxType useParbox(idx_type cell) const;
616         ///
617         // helper function for Latex returns number of newlines
618         ///
619         int TeXTopHLine(odocstream &, row_type row) const;
620         ///
621         int TeXBottomHLine(odocstream &, row_type row) const;
622         ///
623         int TeXCellPreamble(odocstream &, idx_type cell) const;
624         ///
625         int TeXCellPostamble(odocstream &, idx_type cell) const;
626         ///
627         int TeXLongtableHeaderFooter(odocstream &, OutputParams const &) const;
628         ///
629         bool isValidRow(row_type const row) const;
630         ///
631         int TeXRow(odocstream &, row_type const row,
632                    OutputParams const &) const;
633         ///
634         // helper functions for plain text
635         ///
636         bool plaintextTopHLine(odocstream &, row_type row,
637                                std::vector<unsigned int> const &) const;
638         ///
639         bool plaintextBottomHLine(odocstream &, row_type row,
640                                   std::vector<unsigned int> const &) const;
641         ///
642         void plaintextPrintCell(odocstream &,
643                                 OutputParams const &,
644                                 idx_type cell, row_type row, col_type column,
645                                 std::vector<unsigned int> const &,
646                                 bool onlydata) const;
647         /// auxiliary function for docbook
648         int docbookRow(odocstream & os, row_type, OutputParams const &) const;
649
650         /// change associated Buffer
651         void setBuffer(Buffer const & buffer) { buffer_ = &buffer; }
652         /// retrieve associated Buffer
653         Buffer const & buffer() const { return *buffer_; }
654
655 private:
656         Buffer const * buffer_;
657
658         /// renumber cells after structural changes
659         void fixCellNums();
660 };
661
662
663
664 class InsetTabular : public Inset {
665 public:
666         ///
667         InsetTabular(Buffer const &, row_type rows = 1,
668                      col_type columns = 1);
669         ///
670         ~InsetTabular();
671         ///
672         void read(Lexer &);
673         ///
674         void write(std::ostream &) const;
675         ///
676         void metrics(MetricsInfo &, Dimension &) const;
677         ///
678         void draw(PainterInfo & pi, int x, int y) const;
679         ///
680         void drawSelection(PainterInfo & pi, int x, int y) const;
681         ///
682         docstring editMessage() const;
683         ///
684         EDITABLE editable() const { return HIGHLY_EDITABLE; }
685         ///
686         bool insetAllowed(InsetCode code) const;
687         ///
688         bool allowSpellCheck() const { return true; }
689         ///
690         bool canTrackChanges() const { return true; }
691         /** returns true if, when outputing LaTeX, font changes should
692             be closed before generating this inset. This is needed for
693             insets that may contain several paragraphs */
694         bool noFontChange() const { return true; }
695         ///
696         DisplayType display() const { return tabular.isLongTabular() ? AlignCenter : Inline; }
697         ///
698         int latex(odocstream &, OutputParams const &) const;
699         ///
700         int plaintext(odocstream &, OutputParams const &) const;
701         ///
702         int docbook(odocstream &, OutputParams const &) const;
703         ///
704         void validate(LaTeXFeatures & features) const;
705         ///
706         InsetCode lyxCode() const { return TABULAR_CODE; }
707         /// get offset of this cursor slice relative to our upper left corner
708         void cursorPos(BufferView const & bv, CursorSlice const & sl,
709                 bool boundary, int & x, int & y) const;
710         ///
711         bool tabularFeatures(Cursor & cur, std::string const & what);
712         ///
713         void tabularFeatures(Cursor & cur, Tabular::Feature feature,
714                              std::string const & val = std::string());
715         ///
716         void openLayoutDialog(BufferView *) const;
717         ///
718         bool showInsetDialog(BufferView *) const;
719         /// number of cells
720         size_t nargs() const { return tabular.cellCount(); }
721         ///
722         boost::shared_ptr<InsetText const> cell(idx_type) const;
723         ///
724         boost::shared_ptr<InsetText> cell(idx_type);
725         ///
726         Text * getText(int) const;
727
728         /// set the change for the entire inset
729         void setChange(Change const & change);
730         /// accept the changes within the inset
731         void acceptChanges(BufferParams const & bparams);
732         /// reject the changes within the inset
733         void rejectChanges(BufferParams const & bparams);
734
735         // this should return true if we have a "normal" cell, otherwise false.
736         // "normal" means without width set!
737         /// should all paragraphs be output with "Standard" layout?
738         virtual bool allowParagraphCustomization(idx_type cell = 0) const;
739         ///
740         virtual bool forceEmptyLayout() { return true; }
741         ///
742         void addPreview(graphics::PreviewLoader &) const;
743
744         /// lock cell with given index
745         void edit(Cursor & cur, bool front, EntryDirection entry_from);
746         ///
747         Inset * editXY(Cursor & cur, int x, int y);
748         /// can we go further down on mouse click?
749         bool descendable() const { return true; }
750         // Update the counters of this inset and of its contents
751         void updateLabels(ParIterator const &);
752
753         //
754         // Public structures and variables
755         ///
756         mutable Tabular tabular;
757
758 private:
759         ///
760         InsetTabular(InsetTabular const &);
761         ///
762         void doDispatch(Cursor & cur, FuncRequest & cmd);
763         ///
764         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
765         ///
766         int scroll() const { return scx_; }
767         ///
768         Inset * clone() const { return new InsetTabular(*this); }
769
770         ///
771         void drawCellLines(frontend::Painter &, int x, int y, row_type row,
772                            idx_type cell, bool erased) const;
773         ///
774         void setCursorFromCoordinates(Cursor & cur, int x, int y) const;
775
776         ///
777         void moveNextCell(Cursor & cur);
778         ///
779         void movePrevCell(Cursor & cur);
780         ///
781         int getCellXPos(idx_type cell) const;
782         ///
783         void resetPos(Cursor & cur) const;
784         ///
785         void removeTabularRow();
786         ///
787         bool copySelection(Cursor & cur);
788         ///
789         bool pasteClipboard(Cursor & cur);
790         ///
791         void cutSelection(Cursor & cur);
792         ///
793         bool isRightToLeft(Cursor & cur) const;
794         ///
795         void getSelection(Cursor & cur, row_type & rs, row_type & re,
796                           col_type & cs, col_type & ce) const;
797         ///
798         bool insertPlaintextString(BufferView &, docstring const & buf, bool usePaste);
799         /// are we operating on several cells?
800         bool tablemode(Cursor & cur) const;
801
802         /// return the "Manhattan distance" to nearest corner
803         int dist(BufferView &, idx_type cell, int x, int y) const;
804         /// return the cell nearest to x, y
805         idx_type getNearestCell(BufferView &, int x, int y) const;
806
807         /// test the rotation state of the give cell range.
808         bool oneCellHasRotationState(bool rotated,
809                                 row_type row_start, row_type row_end,
810                                 col_type col_start, col_type col_end) const;
811         ///
812         mutable idx_type first_visible_cell;
813         ///
814         mutable int scx_;
815 };
816
817
818 class InsetTabularMailer : public MailInset {
819 public:
820         ///
821         InsetTabularMailer(InsetTabular const & inset);
822         ///
823         virtual Inset & inset() const { return inset_; }
824         ///
825         virtual std::string const & name() const { return name_; }
826         ///
827         virtual std::string const inset2string(Buffer const &) const;
828         ///
829         static void string2params(std::string const &, InsetTabular &);
830         ///
831         static std::string const params2string(InsetTabular const &);
832 private:
833         ///
834         static std::string const name_;
835         ///
836         InsetTabular & inset_;
837 };
838
839 std::string const featureAsString(Tabular::Feature feature);
840
841 } // namespace lyx
842
843 #endif