summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KFilterDev.java
blob: beb1e1d8bda5ca778fb7862f15bdb2b33f7790c3 (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
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QtSupport;
import org.kde.qt.TQIODevice;
import org.kde.qt.TQIODeviceInterface;
import org.kde.qt.TQIODevice;

/**

 A class for reading and writing compressed data onto a device
 (e.g. file, but other usages are possible, like a buffer or a socket).
 To simply read/write compressed files, see deviceForFile.
		@author David Faure <faure@kde.org>
 
		@short    A class for reading and writing compressed data onto a device  (e.

*/
public class KFilterDev extends TQIODevice  {
	protected KFilterDev(Class dummy){super((Class) null);}
	/**	
		 Constructs a KFilterDev for a given filter (e.g. gzip, bzip2 etc.).
			@param filter the KFilterBase to use
			@param autoDeleteFilterBase when true this object will become the
		 owner of <code>filter.</code>
		     		@short    Constructs a KFilterDev for a given filter (e.
	*/
	public KFilterDev(KFilterBase filter, boolean autoDeleteFilterBase) {
		super((Class) null);
		newKFilterDev(filter,autoDeleteFilterBase);
	}
	private native void newKFilterDev(KFilterBase filter, boolean autoDeleteFilterBase);
	public KFilterDev(KFilterBase filter) {
		super((Class) null);
		newKFilterDev(filter);
	}
	private native void newKFilterDev(KFilterBase filter);
	/**	
		 Open for reading or writing.
		 If the KFilterBase's device is not opened, it will be opened.
		     		@short    Open for reading or writing.
	*/
	public native boolean open(int mode);
	/**	
		 Close after reading or writing.
		 If the KFilterBase's device was opened by open(), it will be closed.
		     		@short    Close after reading or writing.
	*/
	public native void close();
	public native void flush();
	/**	
		 For writing gzip compressed files only:
		 set the name of the original file, to be used in the gzip header.
			@param fileName the name of the original file
		     		@short    For writing gzip compressed files only:  set the name of the original file, to be used in the gzip header.
	*/
	public native void setOrigFileName(String fileName);
	/**	
		 Call this let this device skip the gzip headers when reading/writing.
		 This way KFilterDev (with gzip filter) can be used as a direct wrapper
		 around zlib - this is used by KZip.
				@short    Call this let this device skip the gzip headers when reading/writing.
	*/
	public native void setSkipHeaders();
	public native long size();
	public native long at();
	/**	
		 That one can be quite slow, when going back. Use with care.
		     		@short    That one can be quite slow, when going back.
	*/
	public native boolean at(long arg1);
	public native boolean atEnd();
	public native long readBlock(StringBuffer data, long maxlen);
	public native long writeBlock(String data, long len);
	public native int getch();
	public native int putch(int arg1);
	public native int ungetch(int arg1);
	/**	
		 Creates an i/o device that is able to read from <code>fileName</code>,
		 whether it's compressed or not. Available compression filters
		 (gzip/bzip2 etc.) will automatically be used.
			 The compression filter to be used is determined from the <code>fileName</code>
		 if <code>mimetype</code> is empty. Pass "application/x-gzip" or "application/x-bzip2"
		 to force the corresponding decompression filter, if available.
			 Warning: application/x-bzip2 may not be available.
		 In that case a TQFile opened on the compressed data will be returned !
		 Use KFilterBase.findFilterByMimeType and code similar to what
		 deviceForFile is doing, to better control what's happening.
			 The returned TQIODevice has to be deleted after using.
			@param fileName the name of the file to filter
			@param mimetype the mime type of the file to filter, or null if unknown
			@param forceFilter if true, the function will either find a compression filter, or return 0.
		                    If false, it will always return a TQIODevice. If no
		                    filter is available it will return a simple TQFile.
		                    This can be useful if the file is usable without a filter.
				@return if a filter has been found, the TQIODevice for the filter. If the
         filter does not exist, the return value depends on <code>forceFilter.</code>
         The returned TQIODevice has to be deleted after using.
     
		@short    Creates an i/o device that is able to read from <code>fileName</code>,  whether it's compressed or not.
	*/
	public static native TQIODeviceInterface deviceForFile(String fileName, String mimetype, boolean forceFilter);
	public static native TQIODeviceInterface deviceForFile(String fileName, String mimetype);
	public static native TQIODeviceInterface deviceForFile(String fileName);
	/**	
		 Creates an i/o device that is able to read from the TQIODevice <code>inDevice</code>,
		 whether the data is compressed or not. Available compression filters
		 (gzip/bzip2 etc.) will automatically be used.
			 The compression filter to be used is determined <code>mimetype</code> .
		 Pass "application/x-gzip" or "application/x-bzip2"
		 to use the corresponding decompression filter.
			 Warning: application/x-bzip2 may not be available.
		 In that case 0 will be returned !
			 The returned TQIODevice has to be deleted after using.
			@param inDevice input device, becomes owned by this device! Automatically deleted!
			@param mimetype the mime type for the filter
				@return a TQIODevice that filters the original stream. Must be deleted after
         using
     
		@short    Creates an i/o device that is able to read from the TQIODevice <code>inDevice</code>,  whether the data is compressed or not.
	*/
	public static native TQIODeviceInterface device(TQIODeviceInterface inDevice, String mimetype);
	/**	
		 Creates an i/o device that is able to read from the TQIODevice <code>inDevice</code>,
		 whether the data is compressed or not. Available compression filters
		 (gzip/bzip2 etc.) will automatically be used.
			 The compression filter to be used is determined <code>mimetype</code> .
		 Pass "application/x-gzip" or "application/x-bzip2"
		 to use the corresponding decompression filter.
			 Warning: application/x-bzip2 may not be available.
		 In that case 0 will be returned !
			 The returned TQIODevice has to be deleted after using.
			@param inDevice input device. Won't be deleted if <code>autoDeleteInDevice</code> = false
			@param mimetype the mime type for the filter
			@param autoDeleteInDevice if true, <code>inDevice</code> will be deleted automatically
				@return a TQIODevice that filters the original stream. Must be deleted after
         using

		@short    Creates an i/o device that is able to read from the TQIODevice <code>inDevice</code>,  whether the data is compressed or not.
	*/
	public static native TQIODeviceInterface device(TQIODeviceInterface inDevice, String mimetype, boolean autoDeleteInDevice);
	/** 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();
}