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