bump product version to 4.1.6.2
[LibreOffice.git] / sc / inc / queryparam.hxx
blob445c23c06aacc477ef291fa8409d19e31e928ecd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SC_QUERYPARAM_HXX
21 #define SC_QUERYPARAM_HXX
23 #include "global.hxx"
24 #include "scmatrix.hxx"
26 #include <boost/ptr_container/ptr_vector.hpp>
28 struct ScDBQueryParamInternal;
29 struct ScQueryEntry;
31 struct ScQueryParamBase
33 bool bHasHeader;
34 bool bByRow;
35 bool bInplace;
36 bool bCaseSens;
37 bool bRegExp;
38 bool bDuplicate;
39 bool mbRangeLookup; ///< for spreadsheet functions like MATCH, LOOKUP, HLOOKUP, VLOOKUP
41 virtual ~ScQueryParamBase();
43 virtual bool IsValidFieldIndex() const;
45 SC_DLLPUBLIC SCSIZE GetEntryCount() const;
46 SC_DLLPUBLIC const ScQueryEntry& GetEntry(SCSIZE n) const;
47 SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n);
48 SC_DLLPUBLIC ScQueryEntry& AppendEntry();
49 ScQueryEntry* FindEntryByField(SCCOLROW nField, bool bNew);
50 SC_DLLPUBLIC void RemoveEntryByField(SCCOLROW nField);
51 void Resize(size_t nNew);
52 void FillInExcelSyntax(const OUString& aCellStr, SCSIZE nIndex);
54 protected:
55 typedef boost::ptr_vector<ScQueryEntry> EntriesType;
57 public:
58 typedef EntriesType::const_iterator const_iterator;
60 const_iterator begin() const;
61 const_iterator end() const;
63 protected:
64 ScQueryParamBase();
65 ScQueryParamBase(const ScQueryParamBase& r);
67 EntriesType maEntries;
70 // ============================================================================
72 struct ScQueryParamTable
74 SCCOL nCol1;
75 SCROW nRow1;
76 SCCOL nCol2;
77 SCROW nRow2;
78 SCTAB nTab;
80 ScQueryParamTable();
81 ScQueryParamTable(const ScQueryParamTable& r);
82 virtual ~ScQueryParamTable();
85 // ============================================================================
87 struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamTable
89 bool bDestPers; // not saved
90 SCTAB nDestTab;
91 SCCOL nDestCol;
92 SCROW nDestRow;
94 ScQueryParam();
95 ScQueryParam( const ScQueryParam& r );
96 ScQueryParam( const ScDBQueryParamInternal& r );
97 virtual ~ScQueryParam();
99 ScQueryParam& operator= ( const ScQueryParam& r );
100 bool operator== ( const ScQueryParam& rOther ) const;
101 void Clear();
102 void ClearDestParams();
103 void MoveToDest();
106 // ============================================================================
108 struct ScDBQueryParamBase : public ScQueryParamBase
110 enum DataType { INTERNAL, MATRIX };
112 SCCOL mnField; /// the field in which the values are processed during iteration.
113 bool mbSkipString;
115 DataType GetType() const;
117 virtual ~ScDBQueryParamBase();
119 protected:
120 ScDBQueryParamBase(DataType eType);
122 private:
123 ScDBQueryParamBase();
125 DataType meType;
128 // ============================================================================
130 struct ScDBQueryParamInternal : public ScDBQueryParamBase, public ScQueryParamTable
132 ScDBQueryParamInternal();
133 virtual ~ScDBQueryParamInternal();
135 virtual bool IsValidFieldIndex() const;
138 // ============================================================================
140 struct ScDBQueryParamMatrix : public ScDBQueryParamBase
142 ScMatrixRef mpMatrix;
144 ScDBQueryParamMatrix();
145 virtual ~ScDBQueryParamMatrix();
147 virtual bool IsValidFieldIndex() const;
150 #endif
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */