xref: /trunk/main/sc/inc/queryparam.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2008 by Sun Microsystems, Inc.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * $RCSfile: interpre.hxx,v $
10*cdf0e10cSrcweir  * $Revision: 1.35.44.2 $
11*cdf0e10cSrcweir  *
12*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
13*cdf0e10cSrcweir  *
14*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
15*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
16*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
17*cdf0e10cSrcweir  *
18*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
19*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
22*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
23*cdf0e10cSrcweir  *
24*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
25*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
26*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
27*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
28*cdf0e10cSrcweir  *
29*cdf0e10cSrcweir  ************************************************************************/
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #ifndef SC_QUERYPARAM_HXX
32*cdf0e10cSrcweir #define SC_QUERYPARAM_HXX
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #include "global.hxx"
35*cdf0e10cSrcweir #include "scmatrix.hxx"
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include <vector>
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir struct ScDBQueryParamInternal;
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir struct ScQueryParamBase
42*cdf0e10cSrcweir {
43*cdf0e10cSrcweir     bool            bHasHeader;
44*cdf0e10cSrcweir     bool            bByRow;
45*cdf0e10cSrcweir     bool            bInplace;
46*cdf0e10cSrcweir     bool            bCaseSens;
47*cdf0e10cSrcweir     bool            bRegExp;
48*cdf0e10cSrcweir     bool            bDuplicate;
49*cdf0e10cSrcweir     bool            bMixedComparison;   // whether numbers are smaller than strings
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir     virtual ~ScQueryParamBase();
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir     SC_DLLPUBLIC SCSIZE GetEntryCount() const;
54*cdf0e10cSrcweir     SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n) const;
55*cdf0e10cSrcweir     void Resize(SCSIZE nNew);
56*cdf0e10cSrcweir     SC_DLLPUBLIC void DeleteQuery( SCSIZE nPos );
57*cdf0e10cSrcweir     void FillInExcelSyntax(String& aCellStr, SCSIZE nIndex);
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir protected:
60*cdf0e10cSrcweir     ScQueryParamBase();
61*cdf0e10cSrcweir     ScQueryParamBase(const ScQueryParamBase& r);
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir     mutable ::std::vector<ScQueryEntry>  maEntries;
64*cdf0e10cSrcweir };
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir // ============================================================================
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir struct ScQueryParamTable
69*cdf0e10cSrcweir {
70*cdf0e10cSrcweir     SCCOL           nCol1;
71*cdf0e10cSrcweir     SCROW           nRow1;
72*cdf0e10cSrcweir     SCCOL           nCol2;
73*cdf0e10cSrcweir     SCROW           nRow2;
74*cdf0e10cSrcweir     SCTAB           nTab;
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir     ScQueryParamTable();
77*cdf0e10cSrcweir     ScQueryParamTable(const ScQueryParamTable& r);
78*cdf0e10cSrcweir     virtual ~ScQueryParamTable();
79*cdf0e10cSrcweir };
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir // ============================================================================
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamTable
84*cdf0e10cSrcweir {
85*cdf0e10cSrcweir     sal_Bool            bDestPers;          // nicht gespeichert
86*cdf0e10cSrcweir     SCTAB           nDestTab;
87*cdf0e10cSrcweir     SCCOL           nDestCol;
88*cdf0e10cSrcweir     SCROW           nDestRow;
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir     ScQueryParam();
91*cdf0e10cSrcweir     ScQueryParam( const ScQueryParam& r );
92*cdf0e10cSrcweir     ScQueryParam( const ScDBQueryParamInternal& r );
93*cdf0e10cSrcweir     virtual ~ScQueryParam();
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir     ScQueryParam&   operator=   ( const ScQueryParam& r );
96*cdf0e10cSrcweir     sal_Bool            operator==  ( const ScQueryParam& rOther ) const;
97*cdf0e10cSrcweir     void            Clear();
98*cdf0e10cSrcweir     void            ClearDestParams();
99*cdf0e10cSrcweir     void            MoveToDest();
100*cdf0e10cSrcweir };
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir // ============================================================================
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir struct ScDBQueryParamBase : public ScQueryParamBase
105*cdf0e10cSrcweir {
106*cdf0e10cSrcweir     enum DataType { INTERNAL, MATRIX };
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir     SCCOL   mnField;    /// the field in which the values are processed during iteration.
109*cdf0e10cSrcweir     bool    mbSkipString;
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir     DataType        GetType() const;
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir     virtual ~ScDBQueryParamBase();
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir protected:
116*cdf0e10cSrcweir     ScDBQueryParamBase(DataType eType);
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir private:
119*cdf0e10cSrcweir     ScDBQueryParamBase();
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir     DataType        meType;
122*cdf0e10cSrcweir };
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir // ============================================================================
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir struct ScDBQueryParamInternal : public ScDBQueryParamBase, public ScQueryParamTable
127*cdf0e10cSrcweir {
128*cdf0e10cSrcweir     ScDBQueryParamInternal();
129*cdf0e10cSrcweir     virtual ~ScDBQueryParamInternal();
130*cdf0e10cSrcweir };
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir // ============================================================================
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir struct ScDBQueryParamMatrix : public ScDBQueryParamBase
135*cdf0e10cSrcweir {
136*cdf0e10cSrcweir     ScMatrixRef mpMatrix;
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir     ScDBQueryParamMatrix();
139*cdf0e10cSrcweir     virtual ~ScDBQueryParamMatrix();
140*cdf0e10cSrcweir };
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir #endif
143