Release 0.41.92
[vala-gnome.git] / libvaladoc / content / tablecell.vala
bloba0a806a332f3c93b06afc492541d1a5f6f61f9f7
1 /* tablecell.vala
3 * Copyright (C) 2008-2009 Didier Villevalois
4 * Copyright (C) 2008-2012 Florian Brosch
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Author:
21 * Didier 'Ptitjes Villevalois <ptitjes@free.fr>
25 public class Valadoc.Content.TableCell : InlineContent, StyleAttributes {
26 public HorizontalAlign horizontal_align {
27 get;
28 set;
31 public VerticalAlign vertical_align {
32 get;
33 set;
36 public string? style {
37 get;
38 set;
41 public int colspan {
42 get;
43 set;
46 public int rowspan {
47 get;
48 set;
51 internal TableCell () {
52 base ();
53 _colspan = 1;
54 _rowspan = 1;
57 public override void check (Api.Tree api_root, Api.Node container, string file_path,
58 ErrorReporter reporter, Settings settings)
60 // Check inline content
61 base.check (api_root, container, file_path, reporter, settings);
64 public override void accept (ContentVisitor visitor) {
65 visitor.visit_table_cell (this);
68 public override bool is_empty () {
69 // empty cells are displayed as well
70 return false;
73 public override ContentElement copy (ContentElement? new_parent = null) {
74 TableCell cell = new TableCell ();
75 cell.parent = new_parent;
77 cell.horizontal_align = horizontal_align;
78 cell.vertical_align = vertical_align;
79 cell.colspan = colspan;
80 cell.rowspan = rowspan;
81 cell.style = style;
83 foreach (Inline element in content) {
84 Inline copy = element.copy (cell) as Inline;
85 cell.content.add (copy);
88 return cell;