1 | /* This file is part of the KDE project |
2 | Copyright 2010 Marijn Kruisselbrink <mkruisselbrink@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 CALLIGRA_SHEETS_ROWFORMATSTORAGE_H |
21 | #define CALLIGRA_SHEETS_ROWFORMATSTORAGE_H |
22 | |
23 | #include <Qt> |
24 | |
25 | #include "calligra_sheets_export.h" |
26 | |
27 | namespace Calligra { |
28 | namespace Sheets { |
29 | |
30 | class Sheet; |
31 | |
32 | /** first and last row are both inclusive in all functions */ |
33 | class CALLIGRA_SHEETS_ODF_EXPORT RowFormatStorage |
34 | { |
35 | public: |
36 | explicit RowFormatStorage(Sheet *sheet); |
37 | ~RowFormatStorage(); |
38 | |
39 | Sheet* sheet() const; |
40 | |
41 | qreal rowHeight(int row, int* lastRow = 0, int* firstRow = 0) const; |
42 | void setRowHeight(int firstRow, int lastRow, qreal height); |
43 | |
44 | bool isHidden(int row, int* lastRow = 0, int* firstRow = 0) const; |
45 | void setHidden(int firstRow, int lastRow, bool hidden); |
46 | |
47 | bool isFiltered(int row, int* lastRow = 0, int* firstRow = 0) const; |
48 | void setFiltered(int firstRow, int lastRow, bool filtered); |
49 | |
50 | bool isHiddenOrFiltered(int row, int* lastRow = 0, int* firstRow = 0) const; |
51 | |
52 | qreal visibleHeight(int row, int* lastRow = 0, int* firstRow = 0) const; |
53 | |
54 | qreal totalRowHeight(int firstRow, int lastRow) const; |
55 | qreal totalVisibleRowHeight(int firstRow, int lastRow) const; |
56 | |
57 | int rowForPosition(qreal ypos, qreal * topOfRow = 0) const; |
58 | |
59 | bool hasPageBreak(int row, int* lastRow = 0, int* firstRow = 0) const; |
60 | void setPageBreak(int firstRow, int lastRow, bool pageBreak); |
61 | |
62 | bool isDefaultRow(int row, int* lastRow = 0, int* firstRow = 0) const; |
63 | void setDefault(int firstRow, int lastRow); |
64 | int lastNonDefaultRow() const; |
65 | |
66 | bool rowsAreEqual(int row1, int row2) const; |
67 | |
68 | |
69 | /** |
70 | * Insert \p number of rows at position \p row. |
71 | * Also updates the sheets documentHeight property |
72 | */ |
73 | void insertRows(int row, int number); |
74 | |
75 | /** |
76 | * Removes \p number of rows starting at position \p row. |
77 | * Also updates the sheets documentHeight property |
78 | */ |
79 | void removeRows(int row, int number); |
80 | |
81 | RowFormatStorage& operator=(const RowFormatStorage& r); |
82 | private: |
83 | RowFormatStorage(const RowFormatStorage&); |
84 | class Private; |
85 | Private * const d; |
86 | }; |
87 | |
88 | |
89 | } // namespace Sheets |
90 | } // namespace Calligra |
91 | |
92 | #endif // CALLIGRA_SHEETS_ROWFORMATSTORAGE_H |
93 | |
94 | |