summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KMimeTypeValidator.java
blob: 9154d217e68e2c18ebd88e700f33589cf1bf7f95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QMetaObject;
import org.kde.qt.QtSupport;
import org.kde.qt.QObject;
import org.kde.qt.QValidator;

/**

 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
 <pre>
 mime-type := token "/" token ; 'token' is defined in rfc2045
 </pre>
 The fixup will simply remove all non-token characters.
		@author Marc Mutz <mutz@kde.org>

		@short A QValidator for mime types.

*/
public class KMimeTypeValidator extends QValidator  {
	protected KMimeTypeValidator(Class dummy){super((Class) null);}
	public native QMetaObject metaObject();
	public native String className();
	public KMimeTypeValidator(QObject parent, String name) {
		super((Class) null);
		newKMimeTypeValidator(parent,name);
	}
	private native void newKMimeTypeValidator(QObject parent, String name);
	public KMimeTypeValidator(QObject parent) {
		super((Class) null);
		newKMimeTypeValidator(parent);
	}
	private native void newKMimeTypeValidator(QObject parent);
	/**	
		 Checks for well-formed mimetype. Returns
		
			<li>
			Acceptable iff input ~= /^[:allowed chars:]+\/[:allowed chars:]+$/
			</li>
			
			<li>
			Intermediate iff input ~= /^[:allowed chars:]\/?[:allowed chars:]$/
			</li>
			
			<li>
			Invalid else
			   
			</li>		@short    Checks for well-formed mimetype.
	*/
	public native int validate(StringBuffer input, int[] pos);
	/**	
		 Removes all characters that are forbidden in mimetypes.
		   		@short    Removes all characters that are forbidden in mimetypes.
	*/
	public native void fixup(StringBuffer input);
	/** Deletes the wrapped C++ instance */
	protected native void finalize() throws InternalError;
	/** Delete the wrapped C++ instance ahead of finalize() */
	public native void dispose();
	/** Has the wrapped C++ instance been deleted? */
	public native boolean isDisposed();
}