summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KImageIO.java
blob: d0f06a6dd137e5eaa8623a8399e1a9a29a2e0480 (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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
//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;

/**

 Interface to the KDE Image IO plugin architecture.
 This library allows KDE applications to read and write images in a
 variety of formats, transparently via the QImage and QPixmap load
 and save methods.
 The image processing backends are written as image handlers compatible
 with the QImageIO handler format. The backends are loaded on demand
 when a particular format is requested. Each format can be identified
 by a unique type id string.
 <b></b>ormats:
 Currently supported formats include:

	<li>
	BMP     \<read\> \<write\>
	</li>
	
	<li>
	EPS     \<read\> \<write\>
	</li>
	
	<li>
	EXR     \<read\>
	</li>
	
	<li>
	G3      \<read\>
	</li>
	
	<li>
	GIF     \<read\>
	</li>
	
	<li>
	ICO     \<read\>
	</li>
	
	<li>
	JP2     \<read\> \<write\>
	</li>
	
	<li>
	JPEG    \<read\> \<write\>
	</li>
	
	<li>
	NETPBM  \<read\> \<write\>
	</li>
	
	<li>
	PCX     \<read\> \<write\>
	</li>
	
	<li>
	PNG     \<read\> \<write, only with newer libraries\>
	</li>
	
	<li>
	TGA     \<read\> \<write\>
	</li>
	
	<li>
	TIFF    \<read\>
	</li>
	
	<li>
	XBM     \<read\> \<write\>
	</li>
	
	<li>
	XPM     \<read\> \<write\>
	</li>
	
	<li>
	XV      \<read\> \<write\>
	</li>
	 <b></b>sage:
 Simply call the KImageIO.registerFormats() static method declared
 in kimageio.h.
 <b></b>xample:
 <pre>
 #include<qpixmap.h>
 #include<kimageio.h>
 int main( String[] args )
  {
   ....
   KImageIO.registerFormats();
   ...   // start main program
 }
 </pre>
		@author Sirtaj Singh Kang
 
		@short    Interface to the KDE Image IO plugin architecture.
		@see KImageIO
		@see org.kde.qt.QPixmap
		@see org.kde.qt.QImage
		@see org.kde.qt.QImageIO

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

	/**	
		 Possible image file access modes.
			 Used in various KImageIO static function.
				@short    Possible image file access modes.
	*/
	public static final int Reading = 0;
	public static final int Writing = 1;

	public KImageIO() {
		newKImageIO();
	}
	private native void newKImageIO();
	/**	
		  Registers all KImageIO supported formats.
		   		@short     Registers all KImageIO supported formats.
	*/
	public static native void registerFormats();
	/**	
		 Checks if a special type is supported for writing.
			@param type the type id of the image type
				@return true if the image format can be written
   
		@short    Checks if a special type is supported for writing.
	*/
	public static native boolean canWrite(String type);
	/**	
		 Checks if a special type is supported for reading.
			@param type the type id of the image type
				@return true if the image format can be read
   
		@short    Checks if a special type is supported for reading.
	*/
	public static native boolean canRead(String type);
	/**	
		 Returns a list of all KImageIO supported formats.
			@param mode Tells whether to retrieve modes that can be read or written.
				@return a list of the type ids
   
		@short    Returns a list of all KImageIO supported formats.
	*/
	public static native ArrayList types(int mode);
	public static native ArrayList types();
	/**	
		 Returns a list of patterns of all KImageIO supported formats.
			 These patterns can be passed to KFileDialog.getOpenFileName()
		 or KFileDialog.getSaveFileName(), for example.
			@param mode Tells whether to retrieve modes that can be read or written.
				@return a space-separated list of file globs that describe the
 supported formats
   
		@short    Returns a list of patterns of all KImageIO supported formats.
	*/
	public static native String pattern(int mode);
	public static native String pattern();
	/**	
		 Returns the suffix of an image type.
			@param type the type id of the file format
				@return the suffix of the file format or null if it does not
         exist
   
		@short    Returns the suffix of an image type.
	*/
	public static native String suffix(String type);
	/**	
		 Returns the type of a MIME type.
			@param mimeType the MIME type to search
				@return type id of the MIME type or null if the MIME type
         is not supported

		@short    Returns the type of a MIME type.
	*/
	public static native String typeForMime(String mimeType);
	/**	
		 Returns the type of given filename.
			@param filename the filename to check
				@return if the file name's suffix is known the type id of the
         file type, otherwise null
   
		@short    Returns the type of given filename.
	*/
	public static native String type(String filename);
	/**	
		  Returns a list of MIME types for all KImageIO supported formats.
			@param mode Tells whether to retrieve modes that can be read or written.
				@return a list if MIME types of the supported formats
   
		@short     Returns a list of MIME types for all KImageIO supported formats.
	*/
	public static native ArrayList mimeTypes(int mode);
	public static native ArrayList mimeTypes();
	/**	
		 Test to see whether a MIME type is supported to reading/writing.
			@param _mimeType the MIME type to check
			@param _mode Tells whether to check for reading or writing capabilities
				@return true if the type is supported

		@short    Test to see whether a MIME type is supported to reading/writing.
	*/
	public static native boolean isSupported(String _mimeType, int _mode);
	public static native boolean isSupported(String _mimeType);
	/**	
		 Returns the MIME type of <code>_filename.</code>
			@param _filename the filename to check
				@return the MIME type of the file, or null

		@short    Returns the MIME type of <code>_filename.</code>
	*/
	public static native String mimeType(String _filename);
	/** 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();
}