Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
table_iterator.cc
Go to the documentation of this file.
1/*
2 * Dillo Widget
3 *
4 * Copyright 2005-2007, 2014 Sebastian Geerken <sgeerken@dillo.org>
5 *
6 * (This file was originally part of textblock.cc.)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22
23#include "table.hh"
24
25using namespace lout;
26
27namespace dw {
28
30 core::Content::Type mask, bool atEnd):
31 OOFAwareWidgetIterator (table, mask, atEnd, table->children->size ())
32{
33}
34
36{
37 TableIterator *tIt =
38 new TableIterator ((Table*)getWidget(), getMask(), false);
39 cloneValues (tIt);
40 return tIt;
41}
42
43
44void Table::TableIterator::highlight (int start, int end,
46{
47 if (inFlow ()) {
49 } else
50 highlightOOF (start, end, layer);
51}
52
55{
56 if (inFlow ()) {
57 // ???
58 } else
59 unhighlightOOF (direction, layer);
60}
61
62void Table::TableIterator::getAllocation (int start, int end,
64{
65 if (inFlow ()) {
67 } else
68 getAllocationOOF (start, end, allocation);
69}
70
72{
73 return ((Table*)getWidget())->children->size ();
74}
75
77 core::Content *content)
78{
79 Table *table = (Table*)getWidget();
80
81 if (table->children->get(index) != NULL &&
82 table->children->get(index)->type == Child::CELL) {
84 content->widget = table->children->get(index)->cell.widget;
85 } else
86 content->type = core::Content::INVALID;
87}
88
89} // namespace dw
void unhighlight(int direction, core::HighlightLayer layer)
Shrink highlighted region to no longer contain the current content.
void highlight(int start, int end, core::HighlightLayer layer)
Extend highlighted region to contain part of the current content.
TableIterator(Table *table, core::Content::Type mask, bool atEnd)
lout::object::Object * clone()
Return an exact copy of the object.
void getContentInFlow(int index, core::Content *content)
void getAllocation(int start, int end, core::Allocation *allocation)
Return the shape, which a part of the item, the iterator points on, allocates.
A Widget for rendering tables.
Definition table.hh:326
lout::misc::SimpleVector< Child * > * children
Definition table.hh:371
Allocation allocation
The current allocation: size and position, always relative to the canvas.
Definition widget.hh:203
This is the base class for many other classes, which defines very common virtual methods.
Definition object.hh:25
HighlightLayer
Definition types.hh:43
Dw is in this namespace, or sub namespaces of this one.
Represents the allocation, i.e.
Definition types.hh:164
@ INVALID
can be used internally, but should never be exposed, e.
Definition types.hh:222
@ WIDGET_IN_FLOW
widget in normal flow, so that this widget (containing this content) is both container (parent) and g...
Definition types.hh:207
Widget * widget
Definition types.hh:237