excel/sidewinder/cell.h
1/* Swinder - Portable library for spreadsheet
2 Copyright (C) 2003 Ariya Hidayat <ariya@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA
18*/
19
20#ifndef SWINDER_CELL_H
21#define SWINDER_CELL_H
22
23#include "ustring.h"
24#include "format.h"
25#include "value.h"
26
27namespace Swinder
28{
29
30class Workbook;
31class Sheet;
32
33// don't export this private class
34class CellPrivate;
35
36class Cell
37{
38public:
39
40 Cell( Sheet* sheet, unsigned column, unsigned row );
41
42 virtual ~Cell();
43
44 Sheet* sheet();
45
46 unsigned column() const;
47
48 unsigned row() const;
49
50 UString name() const;
51
52 static UString name( unsigned column, unsigned row );
53
54 UString columnLabel() const;
55
56 static UString columnLabel( unsigned column );
57
58 const Value& value() const;
59
60 void setValue( const Value& value );
61
62 const UString& formula() const;
63
64 void setFormula( const UString& formula );
65
66 Format format() const;
67
68 void setFormat( const Format& format );
69
70 void setFormatIndex( int index );
71
72 int formatIndex() const;
73
74 unsigned columnSpan() const;
75
76 void setColumnSpan( unsigned span );
77
78 unsigned rowSpan() const;
79
80 void setRowSpan( unsigned span );
81
82private:
83 // no copy or assign
84 Cell( const Cell& );
85 Cell& operator=( const Cell& );
86
87 CellPrivate *d;
88};
89
90} // namespace Swinder
91
92
93#endif // SWINDER_CELL_H
94
This class describe a cell, row or column format.