xref: /trunk/main/sc/source/ui/inc/dbdocfun.hxx (revision 38d50f7b)
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_DBDOCFUN_HXX
25 #define SC_DBDOCFUN_HXX
26 
27 #include "address.hxx"
28 #include <tools/solar.h>
29 #include <com/sun/star/uno/Sequence.hxx>
30 
31 class String;
32 
33 struct ScImportParam;
34 struct ScQueryParam;
35 struct ScSortParam;
36 struct ScSubTotalParam;
37 
38 class SfxViewFrame;
39 class ScDBData;
40 class ScDocShell;
41 class ScAddress;
42 class ScRange;
43 class ScDPObject;
44 
45 namespace com { namespace sun { namespace star {
46     namespace beans {
47 	    struct PropertyValue;
48     }
49 } } }
50 
51 namespace svx {
52     class ODataAccessDescriptor;
53 }
54 
55 // ---------------------------------------------------------------------------
56 // -----------------------------------------------------------------
57 
58 
59 class ScDBDocFunc
60 {
61 friend class ScDBFunc;
62 
63 private:
64 	ScDocShell&		rDocShell;
65 
66 public:
ScDBDocFunc(ScDocShell & rDocSh)67 					ScDBDocFunc( ScDocShell& rDocSh ): rDocShell(rDocSh) {}
~ScDBDocFunc()68 					~ScDBDocFunc() {}
69 
70     void            UpdateImport( const String& rTarget, const svx::ODataAccessDescriptor& rDescriptor );
71 
72     sal_Bool		DoImport( SCTAB nTab, const ScImportParam& rParam,
73                         const svx::ODataAccessDescriptor* pDescriptor,      // used for selection and existing ResultSet
74                         sal_Bool bRecord,
75                         sal_Bool bAddrInsert = sal_False );
76 
77 	sal_Bool		DoImportUno( const ScAddress& rPos,
78 								const com::sun::star::uno::Sequence<
79 									com::sun::star::beans::PropertyValue>& aArgs );
80 
81 	static void		ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFrame );
82 
83 	sal_Bool		Sort( SCTAB nTab, const ScSortParam& rSortParam,
84 							sal_Bool bRecord, sal_Bool bPaint, sal_Bool bApi );
85 
86 	SC_DLLPUBLIC sal_Bool Query( SCTAB nTab, const ScQueryParam& rQueryParam,
87 							const ScRange* pAdvSource, sal_Bool bRecord, sal_Bool bApi );
88 
89 	sal_Bool			DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam,
90 									const ScSortParam* pForceNewSort,
91 									sal_Bool bRecord, sal_Bool bApi );
92 
93 	sal_Bool			AddDBRange( const String& rName, const ScRange& rRange, sal_Bool bApi );
94 	sal_Bool			DeleteDBRange( const String& rName, sal_Bool bApi );
95 	sal_Bool			RenameDBRange( const String& rOld, const String& rNew, sal_Bool bApi );
96 	sal_Bool			ModifyDBData( const ScDBData& rNewData, sal_Bool bApi );	// Name unveraendert
97 
98 	sal_Bool			RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi );
99 
100 	sal_Bool			DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewObj,
101 										sal_Bool bRecord, sal_Bool bApi, sal_Bool bAllowMove = sal_False );
102 };
103 
104 
105 
106 #endif
107