1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include "viewfunc.hxx"
23 #include <dptypes.hxx>
25 namespace com::sun::star::sheet
{ struct DataPilotFieldFilter
; }
31 struct ScDPNumGroupInfo
;
32 struct ScSubTotalParam
;
34 class SAL_DLLPUBLIC_RTTI ScDBFunc
: public ScViewFunc
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 SCROW nRow
, SCTAB nTab
, const ScQueryParam
& aParam
);
42 DECL_STATIC_LINK(ScDBFunc
, InstallLOKNotifierHdl
, void*, vcl::ILibreOfficeKitNotifier
*);
45 ScDBFunc( vcl::Window
* pParent
, ScDocShell
& rDocSh
, ScTabViewShell
* pViewShell
);
48 // only UISort repeat the partial results if necessary
50 void UISort( const ScSortParam
& rSortParam
);
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 );
59 void ToggleAutoFilter();
60 void HideAutoFilter();
62 void RepeatDB( bool bRecord
= true );
64 bool ImportData( const ScImportParam
& rParam
);
66 void GotoDBArea( const OUString
& rDBName
);
68 // DB range from Cursor
69 ScDBData
* GetDBData( bool bMarkArea
= true, ScGetDBMode eMode
= SC_DB_MAKE
, ScGetDBSelection eSel
= ScGetDBSelection::Keep
);
70 ScDBData
* GetAnonymousDBData();
72 void Consolidate( const ScConsolidateParam
& rParam
);
75 const ScDPSaveData
& rData
, const ScRange
& rDest
, bool bNewTable
,
76 const ScDPObject
& rSource
);
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
);
88 void DataPilotSort(ScDPObject
* pDPObject
, tools::Long nDimIndex
, bool bAscending
, const sal_uInt16
* pUserListId
= nullptr);
89 bool DataPilotMove( const ScRange
& rSource
, const ScAddress
& rDest
);
91 bool HasSelectionForDrillDown( css::sheet::DataPilotFieldOrientation
& rOrientation
);
92 void SetDataPilotDetails(bool bShow
, const OUString
* pNewDimensionName
= nullptr);
94 void ShowDataPilotSourceData( ScDPObject
& rDPObj
,
95 const css::uno::Sequence
< css::sheet::DataPilotFieldFilter
>& rFilters
);
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
);
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 );
112 void ShowMarkedOutlines( bool bRecord
= true );
113 void HideMarkedOutlines( bool bRecord
= true );
114 bool OutlinePossible(bool bHide
);
116 void UpdateCharts(bool bAllCharts
); // Default: at the Cursor
118 static sal_uInt16
DoUpdateCharts( const ScAddress
& rPos
, ScDocument
& rDoc
, bool bAllCharts
);
120 void OnLOKShowHideColRow(bool bColumns
, SCCOLROW nStartRow
);
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */