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