Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / filter / inc / tablecolumnsbuffer.hxx
blob24d5557747f8bca3db553646ea9b138dee00a745
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_TABLECOLUMNSBUFFER_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_TABLECOLUMNSBUFFER_HXX
23 #include <oox/helper/refvector.hxx>
24 #include "workbookhelper.hxx"
26 namespace oox { class AttributeList; }
27 namespace oox { class SequenceInputStream; }
28 class ScDBData;
30 namespace oox {
31 namespace xls {
33 /** A column in a table (database range).
35 class TableColumn : public WorkbookHelper
37 public:
38 explicit TableColumn( const WorkbookHelper& rHelper );
40 /** Imports table column settings from the tableColumn element. */
41 void importTableColumn( const AttributeList& rAttribs );
42 /** Imports table column settings from the TABLECOLUMN (?) record. */
43 void importTableColumn( SequenceInputStream& rStrm );
44 /** Gets the name of this column. */
45 const OUString& getName() const;
47 private:
48 OUString maName;
49 sal_Int32 mnId;
50 sal_Int32 mnDataDxfId;
53 class TableColumns : public WorkbookHelper
55 public:
56 explicit TableColumns( const WorkbookHelper& rHelper );
58 /** Imports settings from the tableColumns element. */
59 void importTableColumns( const AttributeList& rAttribs );
60 /** Imports settings from the TABLECOLUMNS (?) record. */
61 void importTableColumns( SequenceInputStream& rStrm );
63 /** Creates a new table column and stores it internally. */
64 TableColumn& createTableColumn();
66 /** Applies the columns to the passed database range. */
67 bool finalizeImport( ScDBData* pDBData );
69 private:
70 typedef RefVector< TableColumn > TableColumnVector;
72 TableColumnVector maTableColumnVector;
73 sal_Int32 mnCount;
76 class TableColumnsBuffer : public WorkbookHelper
78 public:
79 explicit TableColumnsBuffer( const WorkbookHelper& rHelper );
81 /** Creates a new table columns object and stores it internally. */
82 TableColumns& createTableColumns();
84 /** Applies the table columns to the passed database range. */
85 void finalizeImport( ScDBData* pDBData );
87 private:
88 /** Returns the table columns object used. */
89 TableColumns* getActiveTableColumns();
91 private:
92 typedef RefVector< TableColumns > TableColumnsVector;
93 TableColumnsVector maTableColumnsVector;
96 } // namespace xls
97 } // namespace oox
99 #endif
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */