class KMimeTypeValidator

# class KMimeTypeValidator | A QValidator for mime types. More...
Definition | `#include <kstringvalidator.h>`
Inherits | QValidator (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KMimeTypeValidator ( QObject* parent, const char* name=0)
- virtual State validate ( QString & input, int & pos ) const
- virtual void fixup ( QString & input ) const

## Detailed Description

This validator allows you to validate mimetype names (e.g. 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

     mime-type := token "/" token ; 'token' is defined in rfc2045

The fixup will simply remove all non-token characters.

KMimeTypeValidator ( QObject* parent, const char* name=0) | ### KMimeTypeValidator

State validate ( QString & input, int & pos ) | ### validate

[const virtual]

Checks for well-formed mimetype. Returns

- Acceptable iff input ~= /^[:allowed chars:]+\/[:allowed chars:]+$/
- Intermediate iff input ~= /^[:allowed chars:]*\/?[:allowed chars:]*$/
- Invalid else

void fixup ( QString & input ) | ### fixup

[const virtual]

Removes all characters that are forbidden in mimetypes.

Reimplemented from QValidator.

- Author: Marc Mutz
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:37 2003, using kdoc 2.0a54.