.TH "KMimeTypeValidator" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KMimeTypeValidator \- This validator allows you to validate mimetype names (e.g. A \fBQValidator\fP for mime types.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kstringvalidator.h>\fP
.PP
Inherits \fBQValidator\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKMimeTypeValidator\fP (\fBQObject\fP *parent, const  char *name=0)"
.br
.ti -1c
.RI "virtual State \fBvalidate\fP (\fBQString\fP &input, int &pos) const "
.br
.RI "\fIChecks for well-formed mimetype. \fP"
.ti -1c
.RI "virtual void \fBfixup\fP (\fBQString\fP &input) const "
.br
.RI "\fIRemoves all characters that are forbidden in mimetypes. \fP"
.in -1c
.SH "Detailed Description"
.PP 
This validator allows you to validate mimetype names (e.g. A \fBQValidator\fP for mime types. 

text/plain, image/jpeg). Note that the validation is only syntactically. It will e.g. not reject 'foo/bar', although that particular mime type isn't yet registered. It suffices for the name to adhere to the production
.PP
.PP
.nf

 mime-type := token '/' token ; 'token' is defined in rfc2045
 
.PP
.PP
The fixup will simply remove all non-token characters.
.PP
\fBAuthor:\fP
.RS 4
Marc Mutz <mutz@kde.org> 
.RE
.PP

.PP
Definition at line 112 of file kstringvalidator.h.
.SH "Member Function Documentation"
.PP 
.SS "QValidator::State KMimeTypeValidator::validate (\fBQString\fP & input, int & pos) const\fC [virtual]\fP"
.PP
Checks for well-formed mimetype. Returns 
.IP "\(bu" 2
Acceptable iff input ~= /^[:allowed chars:]+\\/[:allowed chars:]+$/ 
.IP "\(bu" 2
Intermediate iff input ~= /^[:allowed chars:]*\\/?[:allowed chars:]*$/ 
.IP "\(bu" 2
Invalid else 
.PP
Reimplemented from \fBQValidator\fP.
.PP
Definition at line 66 of file kstringvalidator.cpp.
.PP
References QRegExp::exactMatch(), and QString::isEmpty().
.SS "void KMimeTypeValidator::fixup (\fBQString\fP & input) const\fC [virtual]\fP"
.PP
Removes all characters that are forbidden in mimetypes. Reimplemented from \fBQValidator\fP.
.PP
Definition at line 84 of file kstringvalidator.cpp.
.PP
References QString::replace().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
