• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KMimeTypeValidator Class Reference

#include <kstringvalidator.h>

Inheritance diagram for KMimeTypeValidator:

Inheritance graph
[legend]

List of all members.


Detailed Description

A QValidator for mime types.

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.

Author:
Marc Mutz <mutz@kde.org>

Definition at line 153 of file kstringvalidator.h.


Public Member Functions

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

Constructor & Destructor Documentation

KMimeTypeValidator::KMimeTypeValidator ( QObject *  parent = 0  )  [explicit]

Creates a new mime type validator.

Definition at line 124 of file kstringvalidator.cpp.

KMimeTypeValidator::~KMimeTypeValidator (  ) 

Destroys the mime type validator.

Definition at line 130 of file kstringvalidator.cpp.


Member Function Documentation

void KMimeTypeValidator::fixup ( QString &  input  )  const [virtual]

Removes all characters that are forbidden in mimetypes.

Definition at line 151 of file kstringvalidator.cpp.

QValidator::State KMimeTypeValidator::validate ( QString &  input,
int &  pos 
) const [virtual]

Checks for well-formed mimetype.

Returns

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

Definition at line 135 of file kstringvalidator.cpp.


The documentation for this class was generated from the following files:
  • kstringvalidator.h
  • kstringvalidator.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal