1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
26 #include <boost/ptr_container/ptr_vector.hpp>
28 struct ScDBQueryParamInternal
;
33 class SharedStringPool
;
37 struct ScQueryParamBase
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
);
61 typedef boost::ptr_vector
<ScQueryEntry
> EntriesType
;
64 typedef EntriesType::const_iterator const_iterator
;
66 const_iterator
begin() const;
67 const_iterator
end() const;
71 ScQueryParamBase(const ScQueryParamBase
& r
);
73 EntriesType maEntries
;
76 struct ScQueryParamTable
85 ScQueryParamTable(const ScQueryParamTable
& r
);
86 virtual ~ScQueryParamTable();
89 struct SC_DLLPUBLIC ScQueryParam
: public ScQueryParamBase
, public ScQueryParamTable
91 bool bDestPers
; // not saved
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;
104 void ClearDestParams();
108 struct ScDBQueryParamBase
: public ScQueryParamBase
110 enum DataType
{ INTERNAL
, MATRIX
};
112 SCCOL mnField
; /// the field in which the values are processed during iteration.
115 DataType
GetType() const;
117 virtual ~ScDBQueryParamBase();
120 ScDBQueryParamBase(DataType eType
);
123 ScDBQueryParamBase();
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
;
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */