Get the style color and number just once
[LibreOffice.git] / sc / source / filter / inc / querytablebuffer.hxx
blob16410ec8cfeab17a547a94c46ffe4e257cf67dc8
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 #pragma once
22 #include "stylesbuffer.hxx"
23 #include "worksheethelper.hxx"
25 namespace oox::xls {
27 struct QueryTableModel : public AutoFormatModel
29 OUString maDefName; /// Defined name containing the target cell range.
30 sal_Int32 mnConnId; /// Identifier of the external connection used to query the data.
31 sal_Int32 mnGrowShrinkType; /// Behaviour when source data size changes.
32 bool mbHeaders; /// True = source data contains a header row.
33 bool mbRowNumbers; /// True = first column contains row numbers.
34 bool mbDisableRefresh; /// True = refreshing data disabled.
35 bool mbBackground; /// True = refresh asynchronously.
36 bool mbFirstBackground; /// True = first background refresh not yet finished.
37 bool mbRefreshOnLoad; /// True = refresh table after import.
38 bool mbFillFormulas; /// True = expand formulas next to range when source data grows.
39 bool mbRemoveDataOnSave; /// True = remove queried data before saving.
40 bool mbDisableEdit; /// True = connection locked for editing.
41 bool mbPreserveFormat; /// True = use existing formatting for new rows.
42 bool mbAdjustColWidth; /// True = adjust column widths after refresh.
43 bool mbIntermediate; /// True = query table defined but not built yet.
45 explicit QueryTableModel();
48 class QueryTable : public WorksheetHelper
50 public:
51 explicit QueryTable( const WorksheetHelper& rHelper );
53 /** Imports query table settings from the queryTable element. */
54 void importQueryTable( const AttributeList& rAttribs );
55 /** Imports query table settings from the QUERYTABLE record. */
56 void importQueryTable( SequenceInputStream& rStrm );
58 /** Inserts a web query into the sheet. */
59 void finalizeImport();
61 private:
62 QueryTableModel maModel;
65 class QueryTableBuffer : public WorksheetHelper
67 public:
68 explicit QueryTableBuffer( const WorksheetHelper& rHelper );
70 /** Creates a new query table and stores it into the internal vector. */
71 QueryTable& createQueryTable();
73 /** Inserts all web queries into the sheet. */
74 void finalizeImport();
76 private:
77 typedef RefVector< QueryTable > QueryTableVector;
78 QueryTableVector maQueryTables;
81 } // namespace oox::xls
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */