xref: /AOO41X/main/sc/source/ui/inc/dbfunc.hxx (revision ff0525f24f03981d56b7579b645949f111420994)
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     //ScRange         GetDBRange( BOOL bMark, bool bIgnoreNotes );
79     void            NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList );
80 
81     void            Consolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True );
82 
83     bool            MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest, sal_Bool bNewTable,
84                                     const ScDPObject& rSource, sal_Bool bApi = sal_False );
85     void            DeletePivotTable();
86     // Wang Xu Ming -- 2009-6-17
87     // DataPilot Migration
88     sal_uLong   RecalcPivotTable();
89     // End Comments
90     sal_Bool            HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32& rParts );
91     sal_Bool            HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo );
92     void            GroupDataPilot();
93     void            DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nParts );
94     void            NumGroupDataPilot( const ScDPNumGroupInfo& rInfo );
95     void            UngroupDataPilot();
96     void            DataPilotInput( const ScAddress& rPos, const String& rString );
97 
98     bool            DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId = NULL );
99     sal_Bool            DataPilotMove( const ScRange& rSource, const ScAddress& rDest );
100 
101     sal_Bool            HasSelectionForDrillDown( sal_uInt16& rOrientation );
102     void            SetDataPilotDetails( sal_Bool bShow, const String* pNewDimensionName = NULL );
103 
104     void            ShowDataPilotSourceData( ScDPObject& rDPObj,
105                         const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::DataPilotFieldFilter >& rFilters );
106 
107     void            MakeOutline( sal_Bool bColumns, sal_Bool bRecord = sal_True );
108     void            RemoveOutline( sal_Bool bColumns, sal_Bool bRecord = sal_True );
109     void            RemoveAllOutlines( sal_Bool bRecord = sal_True );
110     void            TestRemoveOutline( sal_Bool& rCol, sal_Bool& rRow );
111 
112     void            AutoOutline( sal_Bool bRecord = sal_True );
113 
114     void            SelectLevel( sal_Bool bColumns, sal_uInt16 nLevel,
115                                     sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
116     void            ShowOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
117                                     sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
118     void            HideOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry,
119                                     sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True );
120 
121     void            ShowMarkedOutlines( sal_Bool bRecord = sal_True );
122     void            HideMarkedOutlines( sal_Bool bRecord = sal_True );
123     sal_Bool            OutlinePossible(sal_Bool bHide);
124 
125     void            UpdateCharts(sal_Bool bAllCharts = sal_False);      // Default: am Cursor
126 
127     static sal_uInt16   DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool bAllCharts );
128 };
129 
130 
131 
132 #endif
133 
134