Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef OOX_XLS_QUERYTABLEBUFFER_HXX
30 : : #define OOX_XLS_QUERYTABLEBUFFER_HXX
31 : :
32 : : #include "stylesbuffer.hxx"
33 : : #include "worksheethelper.hxx"
34 : :
35 : : namespace oox {
36 : : namespace xls {
37 : :
38 : : // ============================================================================
39 : :
40 : 0 : struct QueryTableModel : public AutoFormatModel
41 : : {
42 : : ::rtl::OUString maDefName; /// Defined name containing the target cell range.
43 : : sal_Int32 mnConnId; /// Identifier of the external connection used to query the data.
44 : : sal_Int32 mnGrowShrinkType; /// Behaviour when source data size changes.
45 : : bool mbHeaders; /// True = source data contains a header row.
46 : : bool mbRowNumbers; /// True = first column contains row numbers.
47 : : bool mbDisableRefresh; /// True = refreshing data disabled.
48 : : bool mbBackground; /// True = refresh asynchronously.
49 : : bool mbFirstBackground; /// True = first background refresh not yet finished.
50 : : bool mbRefreshOnLoad; /// True = refresh table after import.
51 : : bool mbFillFormulas; /// True = expand formulas next to range when source data grows.
52 : : bool mbRemoveDataOnSave; /// True = remove querried data before saving.
53 : : bool mbDisableEdit; /// True = connection locked for editing.
54 : : bool mbPreserveFormat; /// True = use existing formatting for new rows.
55 : : bool mbAdjustColWidth; /// True = adjust column widths after refresh.
56 : : bool mbIntermediate; /// True = query table defined but not built yet.
57 : :
58 : : explicit QueryTableModel();
59 : : };
60 : :
61 : : // ----------------------------------------------------------------------------
62 : :
63 [ # # ]: 0 : class QueryTable : public WorksheetHelper
64 : : {
65 : : public:
66 : : explicit QueryTable( const WorksheetHelper& rHelper );
67 : :
68 : : /** Imports query table settings from the queryTable element. */
69 : : void importQueryTable( const AttributeList& rAttribs );
70 : : /** Imports query table settings from the QUERYTABLE record. */
71 : : void importQueryTable( SequenceInputStream& rStrm );
72 : :
73 : : /** Inserts a web query into the sheet. */
74 : : void finalizeImport();
75 : :
76 : : private:
77 : : QueryTableModel maModel;
78 : : };
79 : :
80 : : // ============================================================================
81 : :
82 [ - + ]: 60 : class QueryTableBuffer : public WorksheetHelper
83 : : {
84 : : public:
85 : : explicit QueryTableBuffer( const WorksheetHelper& rHelper );
86 : :
87 : : /** Creates a new query table and stores it into the internal vector. */
88 : : QueryTable& createQueryTable();
89 : :
90 : : /** Inserts all web queries into the sheet. */
91 : : void finalizeImport();
92 : :
93 : : private:
94 : : typedef RefVector< QueryTable > QueryTableVector;
95 : : QueryTableVector maQueryTables;
96 : : };
97 : :
98 : : // ============================================================================
99 : :
100 : : } // namespace xls
101 : : } // namespace oox
102 : :
103 : : #endif
104 : :
105 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|