LibreOffice Module sc (master)  1
dbfunc.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #pragma once
21 
22 #include "viewfunc.hxx"
23 #include <dptypes.hxx>
24 
25 namespace com::sun::star::sheet { struct DataPilotFieldFilter; }
26 struct ScSortParam;
27 struct ScQueryParam;
28 class ScDBData;
29 class ScDPObject;
30 class ScDPSaveData;
31 struct ScDPNumGroupInfo;
32 struct ScSubTotalParam;
33 
34 class SAL_DLLPUBLIC_RTTI ScDBFunc : public ScViewFunc
35 {
36 private:
37  void GetSelectedMemberList(ScDPUniqueStringSet& rEntries, tools::Long& rDimension);
38 
39 public:
40  ScDBFunc( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell );
41  virtual ~ScDBFunc();
42 
43  // only UISort repeat the partial results if necessary
44 
45  void UISort( const ScSortParam& rSortParam );
46 
47  void Sort( const ScSortParam& rSortParam,
48  bool bRecord = true, bool bPaint = true );
49  SC_DLLPUBLIC void Query( const ScQueryParam& rQueryParam,
50  const ScRange* pAdvSource, bool bRecord );
51  void DoSubTotals( const ScSubTotalParam& rParam, bool bRecord = true,
52  const ScSortParam* pForceNewSort = nullptr );
53 
54  void ToggleAutoFilter();
55  void HideAutoFilter();
56 
57  void RepeatDB( bool bRecord = true );
58 
59  bool ImportData( const ScImportParam& rParam );
60 
61  void GotoDBArea( const OUString& rDBName );
62 
63  // DB range from Cursor
64  ScDBData* GetDBData( bool bMarkArea = true, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = ScGetDBSelection::Keep);
65  ScDBData* GetAnonymousDBData();
66 
67  void Consolidate( const ScConsolidateParam& rParam );
68 
69  bool MakePivotTable(
70  const ScDPSaveData& rData, const ScRange& rDest, bool bNewTable,
71  const ScDPObject& rSource );
72 
73  void DeletePivotTable();
74  void RecalcPivotTable();
75  bool HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32& rParts );
76  bool HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo );
77  void GroupDataPilot();
78  void DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nParts );
79  void NumGroupDataPilot( const ScDPNumGroupInfo& rInfo );
80  void UngroupDataPilot();
81  void DataPilotInput( const ScAddress& rPos, const OUString& rString );
82 
83  void DataPilotSort(ScDPObject* pDPObject, tools::Long nDimIndex, bool bAscending, const sal_uInt16* pUserListId = nullptr);
84  bool DataPilotMove( const ScRange& rSource, const ScAddress& rDest );
85 
86  bool HasSelectionForDrillDown( css::sheet::DataPilotFieldOrientation& rOrientation );
87  void SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName = nullptr);
88 
89  void ShowDataPilotSourceData( ScDPObject& rDPObj,
90  const css::uno::Sequence< css::sheet::DataPilotFieldFilter >& rFilters );
91 
92  void MakeOutline( bool bColumns, bool bRecord = true );
93  void RemoveOutline( bool bColumns, bool bRecord = true );
94  void RemoveAllOutlines( bool bRecord = true );
95  void TestRemoveOutline( bool& rCol, bool& rRow );
96 
97  void AutoOutline();
98 
99  void SelectLevel( bool bColumns, sal_uInt16 nLevel,
100  bool bRecord = true );
101  void SetOutlineState( bool bColumn, sal_uInt16 nLevel, sal_uInt16 nEntry, bool bHidden);
102  void ShowOutline( bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
103  bool bRecord = true, bool bPaint = true );
104  void HideOutline( bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
105  bool bRecord = true, bool bPaint = true );
106 
107  void ShowMarkedOutlines( bool bRecord = true );
108  void HideMarkedOutlines( bool bRecord = true );
109  bool OutlinePossible(bool bHide);
110 
111  void UpdateCharts(bool bAllCharts); // Default: at the Cursor
112 
113  static sal_uInt16 DoUpdateCharts( const ScAddress& rPos, ScDocument& rDoc, bool bAllCharts );
114 
115  void OnLOKShowHideColRow(bool bColumns, SCCOLROW nStartRow);
116 };
117 
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Long
const ContentProperties & rData
ScGetDBMode
Definition: global.hxx:391
Query
Keep selection as is, expand to used data area if no selection.
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
Sort
Mode eMode
create "untitled" (if necessary)
Definition: global.hxx:393
ScGetDBSelection
For ScDBFunc::GetDBData()
Definition: global.hxx:400
std::unordered_set< OUString > ScDPUniqueStringSet
Definition: dptypes.hxx:16
#define SC_DLLPUBLIC
Definition: scdllapi.h:27