1 /***************************************************************************
2 * Copyright (C) 2006 by Pino Toscano, toscano.pino@tiscali.it *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef KALZIUMSEARCH_H
21 #define KALZIUMSEARCH_H
32 * @author Pino Toscano
34 class Search
: public QObject
40 * The kind of search we can perform
45 SearchBySymbol
= 0x02,
50 * Construct a new empty search.
55 * @return the search text
57 QString
searchText() const;
60 * @return the kind of search
62 SearchKind
searchKind() const;
65 * is the current Search active?
66 * @return whether this search is active
68 bool isActive() const;
71 * @return the found elements
73 const QList
<Element
*>& foundElements() const;
76 * @return whether the element @p el matches the search
78 bool matches( Element
* el
) const;
82 * Search the @p text by looking at the element using the
85 void doSearch( const QString
& text
, SearchKind kind
);
87 * Reset the current search (and put it not active).
93 * The current search has changed (ie the found elements have
98 * The current search has been reset.
105 QString m_searchText
;
106 SearchKind m_searchKind
;
108 QList
<Element
*> m_foundElements
;
111 #endif // KALZIUMSEARCH_H