kexi

kexisearchandreplaceiface.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2007 Jaroslaw Staniek <js@iidea.pl>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KexiSearchAndReplaceViewInterface_H
00021 #define KexiSearchAndReplaceViewInterface_H
00022 
00023 #include <kexiutils/tristate.h>
00024 #include <qstring.h>
00025 class QVariant;
00026 class QStringList;
00027 
00029 class KEXICORE_EXPORT KexiSearchAndReplaceViewInterface
00030 {
00031     public:
00032         KexiSearchAndReplaceViewInterface();
00033         virtual ~KexiSearchAndReplaceViewInterface();
00034 
00036 
00037         class KEXICORE_EXPORT Options {
00038             public:
00039                 Options();
00040 
00042                 enum SpecialLookInValue {
00043                     AllColumns = -1,   
00044                     CurrentColumn = -2 
00045                 };
00048                 int columnNumber;
00049 
00051                 enum TextMatching {
00052                     MatchAnyPartOfField = 0, 
00053                     MatchWholeField = 1,     
00054                     MatchStartOfField = 2    
00055                 };
00056 
00058                 TextMatching textMatching;
00059 
00061                 enum SearchDirection {
00062                     SearchUp = 0,      
00063                     SearchDown = 1,    
00064                     SearchAllRows = 2, 
00065                     DefaultSearchDirection = SearchDown 
00066                 };
00067 
00069                 SearchDirection searchDirection;
00070 
00072                 bool caseSensitive : 1;
00073 
00075                 bool wholeWordsOnly : 1;
00076 
00078                 bool promptOnReplace : 1;
00079         };
00080 
00085         virtual bool setupFindAndReplace(QStringList& columnNames, QStringList& columnCaptions,
00086             QString& currentColumnName) = 0;
00087 
00093         virtual tristate find(const QVariant& valueToFind, 
00094             const KexiSearchAndReplaceViewInterface::Options& options, bool next) = 0;
00095 
00102         virtual tristate findNextAndReplace(const QVariant& valueToFind, const QVariant& replacement, 
00103             const KexiSearchAndReplaceViewInterface::Options& options, bool replaceAll) = 0;
00104 };
00105 
00106 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys