xref: /aoo42x/main/sc/inc/queryparam.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_QUERYPARAM_HXX
25cdf0e10cSrcweir #define SC_QUERYPARAM_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "global.hxx"
28cdf0e10cSrcweir #include "scmatrix.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <vector>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir struct ScDBQueryParamInternal;
33cdf0e10cSrcweir 
34cdf0e10cSrcweir struct ScQueryParamBase
35cdf0e10cSrcweir {
36cdf0e10cSrcweir     bool            bHasHeader;
37cdf0e10cSrcweir     bool            bByRow;
38cdf0e10cSrcweir     bool            bInplace;
39cdf0e10cSrcweir     bool            bCaseSens;
40cdf0e10cSrcweir     bool            bRegExp;
41cdf0e10cSrcweir     bool            bDuplicate;
42cdf0e10cSrcweir     bool            bMixedComparison;   // whether numbers are smaller than strings
43cdf0e10cSrcweir 
44cdf0e10cSrcweir     virtual ~ScQueryParamBase();
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     SC_DLLPUBLIC SCSIZE GetEntryCount() const;
47cdf0e10cSrcweir     SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n) const;
48cdf0e10cSrcweir     void Resize(SCSIZE nNew);
49cdf0e10cSrcweir     SC_DLLPUBLIC void DeleteQuery( SCSIZE nPos );
50cdf0e10cSrcweir     void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex);
51cdf0e10cSrcweir 
52cdf0e10cSrcweir protected:
53cdf0e10cSrcweir     ScQueryParamBase();
54cdf0e10cSrcweir     ScQueryParamBase(const ScQueryParamBase& r);
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     mutable ::std::vector<ScQueryEntry>  maEntries;
57cdf0e10cSrcweir };
58cdf0e10cSrcweir 
59cdf0e10cSrcweir // ============================================================================
60cdf0e10cSrcweir 
61cdf0e10cSrcweir struct ScQueryParamTable
62cdf0e10cSrcweir {
63cdf0e10cSrcweir     SCCOL           nCol1;
64cdf0e10cSrcweir     SCROW           nRow1;
65cdf0e10cSrcweir     SCCOL           nCol2;
66cdf0e10cSrcweir     SCROW           nRow2;
67cdf0e10cSrcweir     SCTAB           nTab;
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     ScQueryParamTable();
70cdf0e10cSrcweir     ScQueryParamTable(const ScQueryParamTable& r);
71cdf0e10cSrcweir     virtual ~ScQueryParamTable();
72cdf0e10cSrcweir };
73cdf0e10cSrcweir 
74cdf0e10cSrcweir // ============================================================================
75cdf0e10cSrcweir 
76cdf0e10cSrcweir struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamTable
77cdf0e10cSrcweir {
78cdf0e10cSrcweir     sal_Bool            bDestPers;          // nicht gespeichert
79cdf0e10cSrcweir     SCTAB           nDestTab;
80cdf0e10cSrcweir     SCCOL           nDestCol;
81cdf0e10cSrcweir     SCROW           nDestRow;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     ScQueryParam();
84cdf0e10cSrcweir     ScQueryParam( const ScQueryParam& r );
85cdf0e10cSrcweir     ScQueryParam( const ScDBQueryParamInternal& r );
86cdf0e10cSrcweir     virtual ~ScQueryParam();
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     ScQueryParam&   operator=   ( const ScQueryParam& r );
89cdf0e10cSrcweir     sal_Bool            operator==  ( const ScQueryParam& rOther ) const;
90cdf0e10cSrcweir     void            Clear();
91cdf0e10cSrcweir     void            ClearDestParams();
92cdf0e10cSrcweir     void            MoveToDest();
93cdf0e10cSrcweir };
94cdf0e10cSrcweir 
95cdf0e10cSrcweir // ============================================================================
96cdf0e10cSrcweir 
97cdf0e10cSrcweir struct ScDBQueryParamBase : public ScQueryParamBase
98cdf0e10cSrcweir {
99cdf0e10cSrcweir     enum DataType { INTERNAL, MATRIX };
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     SCCOL   mnField;    /// the field in which the values are processed during iteration.
102cdf0e10cSrcweir     bool    mbSkipString;
103cdf0e10cSrcweir 
104cdf0e10cSrcweir     DataType        GetType() const;
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     virtual ~ScDBQueryParamBase();
107cdf0e10cSrcweir 
108cdf0e10cSrcweir protected:
109cdf0e10cSrcweir     ScDBQueryParamBase(DataType eType);
110cdf0e10cSrcweir 
111cdf0e10cSrcweir private:
112cdf0e10cSrcweir     ScDBQueryParamBase();
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     DataType        meType;
115cdf0e10cSrcweir };
116cdf0e10cSrcweir 
117cdf0e10cSrcweir // ============================================================================
118cdf0e10cSrcweir 
119cdf0e10cSrcweir struct ScDBQueryParamInternal : public ScDBQueryParamBase, public ScQueryParamTable
120cdf0e10cSrcweir {
121cdf0e10cSrcweir     ScDBQueryParamInternal();
122cdf0e10cSrcweir     virtual ~ScDBQueryParamInternal();
123cdf0e10cSrcweir };
124cdf0e10cSrcweir 
125cdf0e10cSrcweir // ============================================================================
126cdf0e10cSrcweir 
127cdf0e10cSrcweir struct ScDBQueryParamMatrix : public ScDBQueryParamBase
128cdf0e10cSrcweir {
129cdf0e10cSrcweir     ScMatrixRef mpMatrix;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     ScDBQueryParamMatrix();
132cdf0e10cSrcweir     virtual ~ScDBQueryParamMatrix();
133cdf0e10cSrcweir };
134cdf0e10cSrcweir 
135cdf0e10cSrcweir #endif
136