xref: /AOO41X/main/sc/source/ui/inc/dbfunc.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef SC_DBFUNC_HXX
29*cdf0e10cSrcweir #define SC_DBFUNC_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "viewfunc.hxx"
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace sheet {
34*cdf0e10cSrcweir     struct DataPilotFieldFilter;
35*cdf0e10cSrcweir }}}}
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir struct ScSortParam;
38*cdf0e10cSrcweir struct ScQueryParam;
39*cdf0e10cSrcweir class ScDBData;
40*cdf0e10cSrcweir class ScDBCollection;
41*cdf0e10cSrcweir class ScDPObject;
42*cdf0e10cSrcweir class ScDPSaveData;
43*cdf0e10cSrcweir class ScStrCollection;
44*cdf0e10cSrcweir struct ScDPNumGroupInfo;
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir // ---------------------------------------------------------------------------
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir class ScDBFunc : public ScViewFunc
49*cdf0e10cSrcweir {
50*cdf0e10cSrcweir private:
51*cdf0e10cSrcweir     void            GetSelectedMemberList( ScStrCollection& rEntries, long& rDimension );
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir public:
54*cdf0e10cSrcweir 					ScDBFunc( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell );
55*cdf0e10cSrcweir //UNUSED2008-05     ScDBFunc( Window* pParent, const ScDBFunc& rDBFunc, ScTabViewShell* pViewShell );
56*cdf0e10cSrcweir 	virtual			~ScDBFunc();
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir 					//	nur UISort wiederholt bei Bedarf die Teilergebnisse
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir 	void			UISort( const ScSortParam& rSortParam,
61*cdf0e10cSrcweir 						  sal_Bool bRecord = sal_True );
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir 	void			Sort( const ScSortParam& rSortParam,
64*cdf0e10cSrcweir 						  sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
65*cdf0e10cSrcweir 	SC_DLLPUBLIC void			Query( const ScQueryParam& rQueryParam,
66*cdf0e10cSrcweir 						   const ScRange* pAdvSource, sal_Bool bRecord );
67*cdf0e10cSrcweir 	void			DoSubTotals( const ScSubTotalParam& rParam, sal_Bool bRecord = sal_True,
68*cdf0e10cSrcweir 							const ScSortParam* pForceNewSort = NULL );
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir 	void			ToggleAutoFilter();
71*cdf0e10cSrcweir 	void			HideAutoFilter();
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir 	void			RepeatDB( sal_Bool bRecord = sal_True );
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 	sal_Bool			ImportData( const ScImportParam& rParam, sal_Bool bRecord = sal_True );
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir 	void			GotoDBArea( const String& rDBName );
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir 					// DB-Bereich vom Cursor
80*cdf0e10cSrcweir 	ScDBData* 		GetDBData( sal_Bool bMarkArea = sal_True, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP );
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir 	void			NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList );
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir 	void			Consolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True );
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir     bool            MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest, sal_Bool bNewTable,
87*cdf0e10cSrcweir                                     const ScDPObject& rSource, sal_Bool bApi = sal_False );
88*cdf0e10cSrcweir 	void			DeletePivotTable();
89*cdf0e10cSrcweir 	// Wang Xu Ming -- 2009-6-17
90*cdf0e10cSrcweir     // DataPilot Migration
91*cdf0e10cSrcweir     sal_uLong   RecalcPivotTable();
92*cdf0e10cSrcweir     // End Comments
93*cdf0e10cSrcweir     sal_Bool            HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32& rParts );
94*cdf0e10cSrcweir     sal_Bool            HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo );
95*cdf0e10cSrcweir     void            GroupDataPilot();
96*cdf0e10cSrcweir     void            DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nParts );
97*cdf0e10cSrcweir     void            NumGroupDataPilot( const ScDPNumGroupInfo& rInfo );
98*cdf0e10cSrcweir     void            UngroupDataPilot();
99*cdf0e10cSrcweir     void            DataPilotInput( const ScAddress& rPos, const String& rString );
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir     bool            DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId = NULL );
102*cdf0e10cSrcweir     sal_Bool            DataPilotMove( const ScRange& rSource, const ScAddress& rDest );
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir     sal_Bool            HasSelectionForDrillDown( sal_uInt16& rOrientation );
105*cdf0e10cSrcweir     void            SetDataPilotDetails( sal_Bool bShow, const String* pNewDimensionName = NULL );
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir     void            ShowDataPilotSourceData( ScDPObject& rDPObj,
108*cdf0e10cSrcweir                         const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::DataPilotFieldFilter >& rFilters );
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir 	void			MakeOutline( sal_Bool bColumns, sal_Bool bRecord = sal_True );
111*cdf0e10cSrcweir 	void			RemoveOutline( sal_Bool bColumns, sal_Bool bRecord = sal_True );
112*cdf0e10cSrcweir 	void			RemoveAllOutlines( sal_Bool bRecord = sal_True );
113*cdf0e10cSrcweir 	void			TestRemoveOutline( sal_Bool& rCol, sal_Bool& rRow );
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir 	void			AutoOutline( sal_Bool bRecord = sal_True );
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir 	void			SelectLevel( sal_Bool bColumns, sal_uInt16 nLevel,
118*cdf0e10cSrcweir 									sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
119*cdf0e10cSrcweir 	void			ShowOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
120*cdf0e10cSrcweir 									sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
121*cdf0e10cSrcweir 	void			HideOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
122*cdf0e10cSrcweir 									sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir 	void			ShowMarkedOutlines( sal_Bool bRecord = sal_True );
125*cdf0e10cSrcweir 	void			HideMarkedOutlines( sal_Bool bRecord = sal_True );
126*cdf0e10cSrcweir 	sal_Bool			OutlinePossible(sal_Bool bHide);
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir 	void			UpdateCharts(sal_Bool bAllCharts = sal_False);		// Default: am Cursor
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir     static sal_uInt16   DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool bAllCharts );
131*cdf0e10cSrcweir };
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir #endif
136*cdf0e10cSrcweir 
137