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 #ifndef INCLUDED_SC_SOURCE_UI_INC_DBFUNC_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_DBFUNC_HXX
22 
23 #include "viewfunc.hxx"
24 #include <dptypes.hxx>
25 
26 namespace com::sun::star::sheet { struct DataPilotFieldFilter; }
27 struct ScSortParam;
28 struct ScQueryParam;
29 class ScDBData;
30 class ScDPObject;
31 class ScDPSaveData;
32 struct ScDPNumGroupInfo;
33 struct ScSubTotalParam;
34 
35 class SAL_DLLPUBLIC_RTTI ScDBFunc : public ScViewFunc
36 {
37 private:
38  void GetSelectedMemberList(ScDPUniqueStringSet& rEntries, tools::Long& rDimension);
39 
40 public:
41  ScDBFunc( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell );
42  virtual ~ScDBFunc();
43 
44  // only UISort repeat the partial results if necessary
45 
46  void UISort( const ScSortParam& rSortParam );
47 
48  void Sort( const ScSortParam& rSortParam,
49  bool bRecord = true, bool bPaint = true );
50  SC_DLLPUBLIC void Query( const ScQueryParam& rQueryParam,
51  const ScRange* pAdvSource, bool bRecord );
52  void DoSubTotals( const ScSubTotalParam& rParam, bool bRecord = true,
53  const ScSortParam* pForceNewSort = nullptr );
54 
55  void ToggleAutoFilter();
56  void HideAutoFilter();
57 
58  void RepeatDB( bool bRecord = true );
59 
60  bool ImportData( const ScImportParam& rParam );
61 
62  void GotoDBArea( const OUString& rDBName );
63 
64  // DB range from Cursor
65  ScDBData* GetDBData( bool bMarkArea = true, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = ScGetDBSelection::Keep);
66  ScDBData* GetAnonymousDBData();
67 
68  void Consolidate( const ScConsolidateParam& rParam );
69 
70  bool MakePivotTable(
71  const ScDPSaveData& rData, const ScRange& rDest, bool bNewTable,
72  const ScDPObject& rSource );
73 
74  void DeletePivotTable();
75  void RecalcPivotTable();
76  bool HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32& rParts );
77  bool HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo );
78  void GroupDataPilot();
79  void DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nParts );
80  void NumGroupDataPilot( const ScDPNumGroupInfo& rInfo );
81  void UngroupDataPilot();
82  void DataPilotInput( const ScAddress& rPos, const OUString& rString );
83 
84  void DataPilotSort(ScDPObject* pDPObject, tools::Long nDimIndex, bool bAscending, const sal_uInt16* pUserListId = nullptr);
85  bool DataPilotMove( const ScRange& rSource, const ScAddress& rDest );
86 
87  bool HasSelectionForDrillDown( css::sheet::DataPilotFieldOrientation& rOrientation );
88  void SetDataPilotDetails(bool bShow, const OUString* pNewDimensionName = nullptr);
89 
90  void ShowDataPilotSourceData( ScDPObject& rDPObj,
91  const css::uno::Sequence< css::sheet::DataPilotFieldFilter >& rFilters );
92 
93  void MakeOutline( bool bColumns, bool bRecord = true );
94  void RemoveOutline( bool bColumns, bool bRecord = true );
95  void RemoveAllOutlines( bool bRecord = true );
96  void TestRemoveOutline( bool& rCol, bool& rRow );
97 
98  void AutoOutline();
99 
100  void SelectLevel( bool bColumns, sal_uInt16 nLevel,
101  bool bRecord = true );
102  void SetOutlineState( bool bColumn, sal_uInt16 nLevel, sal_uInt16 nEntry, bool bHidden);
103  void ShowOutline( bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
104  bool bRecord = true, bool bPaint = true );
105  void HideOutline( bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
106  bool bRecord = true, bool bPaint = true );
107 
108  void ShowMarkedOutlines( bool bRecord = true );
109  void HideMarkedOutlines( bool bRecord = true );
110  bool OutlinePossible(bool bHide);
111 
112  void UpdateCharts(bool bAllCharts); // Default: at the Cursor
113 
114  static sal_uInt16 DoUpdateCharts( const ScAddress& rPos, ScDocument& rDoc, bool bAllCharts );
115 
116  void OnLOKShowHideColRow(bool bColumns, SCCOLROW nStartRow);
117 };
118 
119 #endif
120 
121 /* 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:24
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:17
#define SC_DLLPUBLIC
Definition: scdllapi.h:28