kexi

identifier.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003-2005 Jaroslaw Staniek <js@iidea.pl>
00003    Copyright (C) 2005 Martin Ellis <martin.ellis@kdemail.net>
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this program; see the file COPYING.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KEXIUTILS_IDENTIFIER_H
00022 #define KEXIUTILS_IDENTIFIER_H
00023 
00024 #include "validator.h"
00025 #include <qstring.h>
00026 
00027 namespace KexiUtils {
00028 
00031     KEXIUTILS_EXPORT bool isIdentifier(const QString& s);
00032 
00037     KEXIUTILS_EXPORT QString string2Identifier(const QString &s);
00038 
00041     KEXIUTILS_EXPORT QString identifierExpectedMessage(const QString &valueName,
00042                                                       const QVariant& v);
00043 
00045     KEXIUTILS_EXPORT QString string2FileName(const QString &s);
00046 
00048     class KEXIUTILS_EXPORT IdentifierValidator : public Validator
00049     {
00050         public:
00051             IdentifierValidator(QObject * parent = 0, const char * name = 0);
00052             virtual ~IdentifierValidator();
00053             virtual State validate( QString & input, int & pos) const;
00054 
00055         protected:
00056             virtual Validator::Result internalCheck(const QString &valueName, const QVariant& v, 
00057                 QString &message, QString &details);
00058     };
00059 }
00060 
00061 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys