- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

KEYTable.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3 * This file is part of the libetonyek project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10 #ifndef KEYTABLE_H_INCLUDED
11 #define KEYTABLE_H_INCLUDED
12
13 #include <deque>
14
15 #include "KEYObject.h"
16
17 namespace libetonyek
18 {
19
20 class KEYTable
21 {
22 struct Cell
23 {
24 KEYObjectPtr_t content;
25 unsigned columnSpan;
26 unsigned rowSpan;
27 bool covered;
28
29 Cell();
30 };
31
32 typedef std::deque<Cell> Row_t;
33 typedef std::deque<Row_t> Table_t;
34
35 public:
36 typedef std::deque<double> ColumnSizes_t;
37 typedef std::deque<double> RowSizes_t;
38
39 public:
40 KEYTable();
41
42 void setSizes(const ColumnSizes_t &columnSizes, const RowSizes_t &rowSizes);
43 void insertCell(unsigned column, unsigned row, const KEYObjectPtr_t &content = KEYObjectPtr_t(), unsigned columnSpan = 1, unsigned rowSpan = 1);
44 void insertCoveredCell(unsigned column, unsigned row);
45
46 void setGeometry(const KEYGeometryPtr_t &geometry);
47
48 void draw(const KEYOutput &output) const;
49
50 private:
51 Table_t m_table;
52 ColumnSizes_t m_columnSizes;
53 RowSizes_t m_rowSizes;
54 KEYGeometryPtr_t m_geometry;
55 };
56
57 KEYObjectPtr_t makeObject(const KEYTable &table);
58
59 }
60
61 #endif // KEYTABLE_H_INCLUDED
62
63 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::KEYTable::KEYTable
KEYTable()
Definition: KEYTable.cpp:32
libetonyek::KEYTable::insertCoveredCell
void insertCoveredCell(unsigned column, unsigned row)
Definition: KEYTable.cpp:61
libetonyek::KEY1Token::content
Definition: KEY1Token.h:39
libetonyek::KEYTable::Table_t
std::deque< Row_t > Table_t
Definition: KEYTable.h:33
libetonyek::KEYTable::m_rowSizes
RowSizes_t m_rowSizes
Definition: KEYTable.h:53
libetonyek::KEYTable
Definition: KEYTable.h:20
libetonyek::KEYTable::Cell
Definition: KEYTable.h:22
libetonyek::KEYTable::draw
void draw(const KEYOutput &output) const
Definition: KEYTable.cpp:76
libetonyek::KEYTable::setSizes
void setSizes(const ColumnSizes_t &columnSizes, const RowSizes_t &rowSizes)
Definition: KEYTable.cpp:40
libetonyek::KEY2Token::column
Definition: KEY2Token.h:140
libetonyek::KEYObjectPtr_t
boost::shared_ptr< KEYObject > KEYObjectPtr_t
Definition: KEYObject.h:44
libetonyek::KEYTable::Cell::content
KEYObjectPtr_t content
Definition: KEYTable.h:24
libetonyek::KEYTable::Cell::columnSpan
unsigned columnSpan
Definition: KEYTable.h:25
libetonyek::KEYTable::Cell::covered
bool covered
Definition: KEYTable.h:27
libetonyek::KEY2Token::geometry
Definition: KEY2Token.h:213
KEYObject.h
libetonyek::KEYTable::RowSizes_t
std::deque< double > RowSizes_t
Definition: KEYTable.h:37
libetonyek::KEYTable::m_columnSizes
ColumnSizes_t m_columnSizes
Definition: KEYTable.h:52
libetonyek::KEYOutput
A context for drawing instances of KEYObject.
Definition: KEYOutput.h:23
libetonyek::makeObject
KEYObjectPtr_t makeObject(const KEYShapePtr_t &shape)
Object creator function for shape.
Definition: KEYShape.cpp:88
libetonyek::KEYTable::Cell::Cell
Cell()
Definition: KEYTable.cpp:24
libetonyek::KEYTable::Cell::rowSpan
unsigned rowSpan
Definition: KEYTable.h:26
libetonyek::KEYTable::setGeometry
void setGeometry(const KEYGeometryPtr_t &geometry)
Definition: KEYTable.cpp:71
libetonyek::KEYTable::insertCell
void insertCell(unsigned column, unsigned row, const KEYObjectPtr_t &content=KEYObjectPtr_t(), unsigned columnSpan=1, unsigned rowSpan=1)
Definition: KEYTable.cpp:49
libetonyek::KEYGeometryPtr_t
boost::shared_ptr< KEYGeometry > KEYGeometryPtr_t
Definition: KEYTypes_fwd.h:25
libetonyek::KEYTable::m_table
Table_t m_table
Definition: KEYTable.h:51
libetonyek::KEYTable::ColumnSizes_t
std::deque< double > ColumnSizes_t
Definition: KEYTable.h:36
libetonyek::KEY2Token::row
Definition: KEY2Token.h:1069
libetonyek::KEYTable::m_geometry
KEYGeometryPtr_t m_geometry
Definition: KEYTable.h:54
libetonyek::KEYTable::Row_t
std::deque< Cell > Row_t
Definition: KEYTable.h:32