Bump version to 4.3-4
[LibreOffice.git] / sc / inc / queryparam.hxx
blobf069abdb5dc368f48dd14289c6adbfead18faf55
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 INCLUDED_SC_INC_QUERYPARAM_HXX
21 #define INCLUDED_SC_INC_QUERYPARAM_HXX
23 #include "global.hxx"
24 #include "types.hxx"
26 #include <boost/ptr_container/ptr_vector.hpp>
28 struct ScDBQueryParamInternal;
29 struct ScQueryEntry;
31 namespace svl {
33 class SharedStringPool;
37 struct ScQueryParamBase
39 bool bHasHeader;
40 bool bByRow;
41 bool bInplace;
42 bool bCaseSens;
43 bool bRegExp;
44 bool bDuplicate;
45 bool mbRangeLookup; ///< for spreadsheet functions like MATCH, LOOKUP, HLOOKUP, VLOOKUP
47 virtual ~ScQueryParamBase();
49 virtual bool IsValidFieldIndex() const;
51 SC_DLLPUBLIC SCSIZE GetEntryCount() const;
52 SC_DLLPUBLIC const ScQueryEntry& GetEntry(SCSIZE n) const;
53 SC_DLLPUBLIC ScQueryEntry& GetEntry(SCSIZE n);
54 SC_DLLPUBLIC ScQueryEntry& AppendEntry();
55 ScQueryEntry* FindEntryByField(SCCOLROW nField, bool bNew);
56 SC_DLLPUBLIC void RemoveEntryByField(SCCOLROW nField);
57 void Resize(size_t nNew);
58 void FillInExcelSyntax(svl::SharedStringPool& rPool, const OUString& aCellStr, SCSIZE nIndex);
60 protected:
61 typedef boost::ptr_vector<ScQueryEntry> EntriesType;
63 public:
64 typedef EntriesType::const_iterator const_iterator;
66 const_iterator begin() const;
67 const_iterator end() const;
69 protected:
70 ScQueryParamBase();
71 ScQueryParamBase(const ScQueryParamBase& r);
73 EntriesType maEntries;
76 struct ScQueryParamTable
78 SCCOL nCol1;
79 SCROW nRow1;
80 SCCOL nCol2;
81 SCROW nRow2;
82 SCTAB nTab;
84 ScQueryParamTable();
85 ScQueryParamTable(const ScQueryParamTable& r);
86 virtual ~ScQueryParamTable();
89 struct SC_DLLPUBLIC ScQueryParam : public ScQueryParamBase, public ScQueryParamTable
91 bool bDestPers; // not saved
92 SCTAB nDestTab;
93 SCCOL nDestCol;
94 SCROW nDestRow;
96 ScQueryParam();
97 ScQueryParam( const ScQueryParam& r );
98 ScQueryParam( const ScDBQueryParamInternal& r );
99 virtual ~ScQueryParam();
101 ScQueryParam& operator= ( const ScQueryParam& r );
102 bool operator== ( const ScQueryParam& rOther ) const;
103 void Clear();
104 void ClearDestParams();
105 void MoveToDest();
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 struct ScDBQueryParamInternal : public ScDBQueryParamBase, public ScQueryParamTable
130 ScDBQueryParamInternal();
131 virtual ~ScDBQueryParamInternal();
133 virtual bool IsValidFieldIndex() const SAL_OVERRIDE;
136 struct ScDBQueryParamMatrix : public ScDBQueryParamBase
138 ScMatrixRef mpMatrix;
140 ScDBQueryParamMatrix();
141 virtual ~ScDBQueryParamMatrix();
143 virtual bool IsValidFieldIndex() const SAL_OVERRIDE;
146 #endif
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */