summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KCharsets.java
blob: da2bc00f98783e9e92a81c98fafde4a3fbed8d61 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QtSupport;
import java.util.ArrayList;
import org.kde.qt.TQTextCodec;

/**

 Charset font and encoder/decoder handling.
 This is needed, because Qt's font matching algorithm gives the font
 family a higher priority than the charset.  For many applications
 this is not acceptable, since it can totally obscure the output,
 in languages which use non iso-8859-1 charsets.
		@author Lars Knoll <knoll@kde.org>
 
		@short    Charset font and encoder/decoder handling.

*/
public class KCharsets implements QtSupport {
	private long _qt;
	private boolean _allocatedInJavaWorld = true;
	protected KCharsets(Class dummy){}

	/**	
		 Provided for compatibility.
			@param name the name of the codec
				@return the TQTextCodec. If the desired codec could not be found,
         it returns a default (Latin-1) codec
     
		@short    Provided for compatibility.
	*/
	public native TQTextCodec codecForName(String name);
	/**	
		 Tries to find a TQTextCodec to convert the given encoding from and to
		 Unicode. If no codec could be found the latin1 codec will be returned an
		 <code>ok</code> will be set to false.
				@return the TQTextCodec. If the desired codec could not be found,
         it returns a default (Latin-1) codec
     
		@short    Tries to find a TQTextCodec to convert the given encoding from and to  Unicode.
	*/
	public native TQTextCodec codecForName(String n, boolean ok);
	/**	
		 Lists all available encodings as names.
				@return the list of all encodings
     
		@short    Lists all available encodings as names.
	*/
	public native ArrayList availableEncodingNames();
	/**	
		 Lists the available encoding names together with a more descriptive language.
				@return the list of descriptive encoding names
     
		@short    Lists the available encoding names together with a more descriptive language.
	*/
	public native ArrayList descriptiveEncodingNames();
	/**	
		 Returns the language the encoding is used for.
			@param encoding the encoding for the language
				@return the language of the encoding
     
		@short    Returns the language the encoding is used for.
	*/
	public native String languageForEncoding(String encoding);
	/**	
		 Returns the encoding for a string obtained with descriptiveEncodingNames().
			@param descriptiveName the descriptive name for the encoding
				@return the name of the encoding
     
		@short    Returns the encoding for a string obtained with descriptiveEncodingNames().
	*/
	public native String encodingForName(String descriptiveName);
	/**	
		 Converts an entity to a character. The string must contain only the
		 entity without the trailing ';'.
			@param str the entity
				@return char.null if the entity could not be decoded.
     
		@short    Converts an entity to a character.
	*/
	public static native char fromEntity(String str);
	/**	
		 Overloaded member function. Tries to find an entity in the
		 String str.
			@param str the string containing entified
			@param len is a return value, that gives the length of the decoded
		 entity.
				@return a decoded entity if one could be found, char.null
 otherwise
     
		@short    Overloaded member function.
	*/
	public static native char fromEntity(String str, int[] len);
	/**	
		 Converts a char to an entity. The returned string does already
		 contain the leading '&' and the trailing ';'.
			@param ch the char to convert
				@return the entity
     
		@short    Converts a char to an entity.
	*/
	public static native String toEntity(char ch);
	/**	
		 Scans the given string for entities (like &amp;amp;) and resolves them
		 using fromEntity.
			@param text the string containing the entities
				@return the clean string

		@short    Scans the given string for entities (like &amp;amp;) and resolves them  using fromEntity.
	*/
	public static native String resolveEntities(String text);
	/**	 Protected constructor. If you need the kcharsets object, use
		 KGlobal.charsets() instead.
		    		@short   Protected constructor.
	*/
	public KCharsets() {
		newKCharsets();
	}
	private native void newKCharsets();
	/** 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();
}