bump product version to 4.1.6.2
[LibreOffice.git] / sc / inc / columnspanset.hxx
blobab248285cfd87592f1455dc370dde990588c354d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
10 #ifndef SC_COLUMNSPANSET_HXX
11 #define SC_COLUMNSPANSET_HXX
13 #include "address.hxx"
15 #include <vector>
16 #include <mdds/flat_segment_tree.hpp>
17 #include <boost/noncopyable.hpp>
19 namespace sc {
21 /**
22 * Structure that stores segments of boolean flags per column, and perform
23 * custom action on those segments.
25 class ColumnSpanSet : boost::noncopyable
27 typedef mdds::flat_segment_tree<SCROW, bool> ColumnSpansType;
28 typedef std::vector<ColumnSpansType*> TableType;
29 typedef std::vector<TableType*> DocType;
31 DocType maDoc;
33 ColumnSpansType& getColumnSpans(SCTAB nTab, SCCOL nCol);
35 public:
36 class Action
38 public:
39 virtual ~Action() = 0;
40 virtual void startColumn(SCTAB nTab, SCCOL nCol);
41 virtual void execute(const ScAddress& rPos, SCROW nLength, bool bVal) = 0;
44 ~ColumnSpanSet();
46 void set(SCTAB nTab, SCCOL nCol, SCROW nRow, bool bVal);
47 void set(SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2, bool bVal);
49 void executeFromTop(Action& ac) const;
54 #endif
56 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */