xref: /AOO41X/main/sc/source/ui/inc/dbfunc.hxx (revision 8e8ee8fefdac26d905672cc573c35fd0ae1f9356)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_DBFUNC_HXX
25 #define SC_DBFUNC_HXX
26 
27 #include "viewfunc.hxx"
28 
29 namespace com { namespace sun { namespace star { namespace sheet {
30     struct DataPilotFieldFilter;
31 }}}}
32 
33 struct ScSortParam;
34 struct ScQueryParam;
35 class ScDBData;
36 class ScDBCollection;
37 class ScDPObject;
38 class ScDPSaveData;
39 class ScStrCollection;
40 struct ScDPNumGroupInfo;
41 
42 // ---------------------------------------------------------------------------
43 
44 class ScDBFunc : public ScViewFunc
45 {
46 private:
47     void            GetSelectedMemberList( ScStrCollection& rEntries, long& rDimension );
48 
49 public:
50                     ScDBFunc( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell );
51 //UNUSED2008-05     ScDBFunc( Window* pParent, const ScDBFunc& rDBFunc, ScTabViewShell* pViewShell );
52     virtual         ~ScDBFunc();
53 
54                     //  nur UISort wiederholt bei Bedarf die Teilergebnisse
55 
56     void            UISort( const ScSortParam& rSortParam,
57                           sal_Bool bRecord = sal_True );
58 
59     void            Sort( const ScSortParam& rSortParam,
60                           sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
61     SC_DLLPUBLIC void           Query( const ScQueryParam& rQueryParam,
62                            const ScRange* pAdvSource, sal_Bool bRecord );
63     void            DoSubTotals( const ScSubTotalParam& rParam, sal_Bool bRecord = sal_True,
64                             const ScSortParam* pForceNewSort = NULL );
65 
66     void            ToggleAutoFilter();
67     void            HideAutoFilter();
68 
69     void            RepeatDB( sal_Bool bRecord = sal_True );
70 
71     sal_Bool            ImportData( const ScImportParam& rParam, sal_Bool bRecord = sal_True );
72 
73     void            GotoDBArea( const String& rDBName );
74 
75                     // DB-Bereich vom Cursor
76     ScDBData*       GetDBData( sal_Bool bMarkArea = sal_True, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP );
77 
78     void            NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList );
79 
80     void            Consolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True );
81 
82     bool            MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest, sal_Bool bNewTable,
83                                     const ScDPObject& rSource, sal_Bool bApi = sal_False );
84     void            DeletePivotTable();
85     // Wang Xu Ming -- 2009-6-17
86     // DataPilot Migration
87     sal_uLong   RecalcPivotTable();
88     // End Comments
89     sal_Bool            HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32& rParts );
90     sal_Bool            HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo );
91     void            GroupDataPilot();
92     void            DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nParts );
93     void            NumGroupDataPilot( const ScDPNumGroupInfo& rInfo );
94     void            UngroupDataPilot();
95     void            DataPilotInput( const ScAddress& rPos, const String& rString );
96 
97     bool            DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId = NULL );
98     sal_Bool            DataPilotMove( const ScRange& rSource, const ScAddress& rDest );
99 
100     sal_Bool            HasSelectionForDrillDown( sal_uInt16& rOrientation );
101     void            SetDataPilotDetails( sal_Bool bShow, const String* pNewDimensionName = NULL );
102 
103     void            ShowDataPilotSourceData( ScDPObject& rDPObj,
104                         const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::DataPilotFieldFilter >& rFilters );
105 
106     void            MakeOutline( sal_Bool bColumns, sal_Bool bRecord = sal_True );
107     void            RemoveOutline( sal_Bool bColumns, sal_Bool bRecord = sal_True );
108     void            RemoveAllOutlines( sal_Bool bRecord = sal_True );
109     void            TestRemoveOutline( sal_Bool& rCol, sal_Bool& rRow );
110 
111     void            AutoOutline( sal_Bool bRecord = sal_True );
112 
113     void            SelectLevel( sal_Bool bColumns, sal_uInt16 nLevel,
114                                     sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
115     void            ShowOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
116                                     sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
117     void            HideOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
118                                     sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
119 
120     void            ShowMarkedOutlines( sal_Bool bRecord = sal_True );
121     void            HideMarkedOutlines( sal_Bool bRecord = sal_True );
122     sal_Bool            OutlinePossible(sal_Bool bHide);
123 
124     void            UpdateCharts(sal_Bool bAllCharts = sal_False);      // Default: am Cursor
125 
126     static sal_uInt16   DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool bAllCharts );
127 };
128 
129 
130 
131 #endif
132 
133