kexi

kexisearchandreplaceiface.h
1/* This file is part of the KDE project
2 Copyright (C) 2007 Jaroslaw Staniek <js@iidea.pl>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library 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 GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KexiSearchAndReplaceViewInterface_H
21#define KexiSearchAndReplaceViewInterface_H
22
23#include <kexiutils/tristate.h>
24#include <tqstring.h>
25class TQVariant;
26class TQStringList;
27
30{
31 public:
34
36
37 class KEXICORE_EXPORT Options {
38 public:
39 Options();
40
43 AllColumns = -1,
44 CurrentColumn = -2
45 };
49
52 MatchAnyPartOfField = 0,
53 MatchWholeField = 1,
54 MatchStartOfField = 2
55 };
56
59
62 SearchUp = 0,
63 SearchDown = 1,
64 SearchAllRows = 2,
65 DefaultSearchDirection = SearchDown
66 };
67
70
72 bool caseSensitive : 1;
73
76
79 };
80
85 virtual bool setupFindAndReplace(TQStringList& columnNames, TQStringList& columnCaptions,
86 TQString& currentColumnName) = 0;
87
93 virtual tristate find(const TQVariant& valueToFind,
94 const KexiSearchAndReplaceViewInterface::Options& options, bool next) = 0;
95
102 virtual tristate findNextAndReplace(const TQVariant& valueToFind, const TQVariant& replacement,
103 const KexiSearchAndReplaceViewInterface::Options& options, bool replaceAll) = 0;
104};
105
106#endif
Specifies options for find and replace operations.
bool promptOnReplace
True if question should be displayed before every replacement made (true by default)
TextMatching
Specifies possible options for text matching.
int columnNumber
Column number to look in, AllColumns means "all columns" (the default) and CurrentColumn means "curre...
bool caseSensitive
True for searching is case-sensitive (false by default)
TextMatching textMatching
Specifies possible options for text matching.
bool wholeWordsOnly
True for searching for whole words only (false by default)
SearchDirection searchDirection
Specifies search direction.
An interface used by Kexi views (KexiViewBase) supporting search/replace features.
virtual bool setupFindAndReplace(TQStringList &columnNames, TQStringList &columnCaptions, TQString &currentColumnName)=0
virtual tristate findNextAndReplace(const TQVariant &valueToFind, const TQVariant &replacement, const KexiSearchAndReplaceViewInterface::Options &options, bool replaceAll)=0
virtual tristate find(const TQVariant &valueToFind, const KexiSearchAndReplaceViewInterface::Options &options, bool next)=0
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition tristate.h:100