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