kspread

kspread_types.h
1/*
2KSpread's code is IMO often hard to read. The cause of this is that there
3is no clear distinction between coordinates on the screen and coordinates
4in a sheet. Therefore I want to propose to define our own types to refer to
5coordinates on the sheet.
6This is a quick draft of how it could look like. It is definitely not complete.
7So feel free to change it and add comments. The types are very straightforward,
8so I think no further comments are needed yet. -- Wilco --
9*/
10
11namespace KSpread
12{
13
14typedef Column unsigned long int;
15typedef Row unsigned long int;
16
17
18class Coordinate
19{
20public:
21 Coordinate( Row, Column );
22
23 Row row() const { return m_iRow; }
24 Column column() const { return m_iColumn; }
25
26private:
27 Row m_iRow;
28 Column m_iColumn;
29};
30
31
32class Selection
33{
34public:
35 Selection( Coordinate, Coordinate );
36
37 Coordinate begin() const { return m_crdBegin; }
38 Coordinate end() const { return m_crdEnd; }
39
40private:
41 Coordinate m_crdBegin;
42 Coordinate m_crdEnd;
43};
44
45} // namespace KSpread
The KSpread namespace.
Definition commands.h:39