LibreOffice Module sc (master)  1
queryentry.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #pragma once
21 
22 #include "global.hxx"
23 #include <svl/sharedstring.hxx>
24 #include <unotools/textsearch.hxx>
25 #include <tools/color.hxx>
26 
27 #include <memory>
28 #include <vector>
29 
34 {
35  enum QueryType
36  {
43  };
44 
45  struct SAL_DLLPRIVATE Item
46  {
48  double mfVal;
52 
53  Item() : meType(ByValue), mfVal(0.0), mbMatchEmpty(false) {}
54 
55  bool operator== (const Item& r) const;
56  };
57  typedef std::vector<Item> QueryItemsType;
58 
59  bool bDoQuery;
63  mutable std::unique_ptr<utl::SearchParam> pSearchParam;
64  mutable std::unique_ptr<utl::TextSearch> pSearchText;
65 
66  ScQueryEntry();
67  ScQueryEntry(const ScQueryEntry& r);
68  ~ScQueryEntry();
69 
71  utl::TextSearch* GetSearchTextPtr( utl::SearchParam::SearchType eSearchType, bool bCaseSens,
72  bool bWildMatchSel ) const;
73 
74  QueryItemsType& GetQueryItems() { return maQueryItems;}
75  const QueryItemsType& GetQueryItems() const { return maQueryItems;}
76  void SetQueryByEmpty();
77  bool IsQueryByEmpty() const;
78  void SetQueryByNonEmpty();
79  bool IsQueryByNonEmpty() const;
80  void SetQueryByTextColor(Color color);
81  bool IsQueryByTextColor() const;
82  void SetQueryByBackgroundColor(Color color);
83  bool IsQueryByBackgroundColor() const;
84  const Item& GetQueryItem() const { return GetQueryItemImpl(); }
85  Item& GetQueryItem() { return GetQueryItemImpl(); }
86  void Clear();
87  ScQueryEntry& operator=( const ScQueryEntry& r );
88  bool operator==( const ScQueryEntry& r ) const;
89 
90 private:
91  Item& GetQueryItemImpl() const;
92 
98  mutable QueryItemsType maQueryItems;
99 };
100 
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)
Definition: xlstyle.cxx:518
const Item & GetQueryItem() const
Definition: queryentry.hxx:84
Item & GetQueryItem()
Definition: queryentry.hxx:85
QueryItemsType & GetQueryItems()
Definition: queryentry.hxx:74
SCCOLROW nField
Definition: queryentry.hxx:60
const QueryItemsType & GetQueryItems() const
Definition: queryentry.hxx:75
std::unique_ptr< utl::SearchParam > pSearchParam
if Wildcard or RegExp, not saved
Definition: queryentry.hxx:63
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
void Clear(EHistoryType eHistory)
svl::SharedString maString
Definition: queryentry.hxx:49
ScQueryConnect eConnect
Definition: queryentry.hxx:62
QueryItemsType maQueryItems
Stores all query items.
Definition: queryentry.hxx:98
ScQueryOp
Definition: global.hxx:818
std::vector< Item > QueryItemsType
Definition: queryentry.hxx:57
ScQueryOp eOp
Definition: queryentry.hxx:61
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
Each instance of this struct represents a single filtering criteria.
Definition: queryentry.hxx:33
std::unique_ptr< utl::TextSearch > pSearchText
if Wildcard or RegExp, not saved
Definition: queryentry.hxx:64
ScQueryConnect
Definition: global.hxx:838