//Auto-generated by kalyptus. DO NOT EDIT. package org.kde.koala; import org.kde.qt.Qt; import org.kde.qt.QtSupport; /** May be removed in KDE 4.0. Determine auto-magically the type of file, not only by using its extension, but also by reading its contents. Unless specified otherwise, KMimeMagic uses $TDEDIR/share/mimelnk/magic for this purpose. To make KMimeMagic restore the 'atime' of a file after it opened it, add its directory in kmimemagicrc like: [Settings] atimeDirs=/tmp,/var/tmp,/home/dfaure/tmp This isn't done by default because it changes the 'ctime'. See kmimemagic.cpp for a full discussion on this issue. The basic usage of KMimeMagic is :
  • Get a pointer to it, using KMimeMagic.self().
  • Use it for any file or buffer you want, using one of the three find...Type() methods.
  • The result is contained in the class KMimeMagicResult. @short */ public class KMimeMagic implements QtSupport { private long _qt; private boolean _allocatedInJavaWorld = true; protected KMimeMagic(Class dummy){} /** Create a parser and initialize it with the KDE-global data: the "magic" config file as well as the snippets from share/config/magic. @short Create a parser and initialize it with the KDE-global data: the "magic" config file as well as the snippets from share/config/magic. */ public KMimeMagic() { newKMimeMagic(); } private native void newKMimeMagic(); /** Create a parser and initialize it with the given config file. @short Create a parser and initialize it with the given config file. */ public KMimeMagic(String configFile) { newKMimeMagic(configFile); } private native void newKMimeMagic(String configFile); /** Merge an existing parse table with the data from the given file. @return true on success. @short Merge an existing parse table with the data from the given file. */ public native boolean mergeConfig(String configFile); /** Merge an existing parse table with the data from the given buffer. @return true on success. @short Merge an existing parse table with the data from the given buffer. */ public native boolean mergeBufConfig(String arg1); /** Enable/Disable follow-links. (Default is disabled.) @short Enable/Disable follow-links. */ public native void setFollowLinks(boolean _enable); /** Try to find a MimeType for the given file. If no special MimeType is found, the default MimeType is returned. This function looks at the content of the file. @return A pointer to the result object. Do @em not delete the result object. After another call to KMimeMagic the returned result object changes its value since it is reused by KMimeMagic. @short Try to find a MimeType for the given file. */ public native KMimeMagicResult findFileType(String _filename); /** Same functionality as above, except data is not read from a file. Instead a buffer can be supplied which is examined. @return A pointer to the result object. Do @em not delete the result object. After another call to KMimeMagic the returned result object changes its value since it is reused by KMimeMagic. @short Same functionality as above, except data is not read from a file. */ public native KMimeMagicResult findBufferType(byte[] p); /** Same functionality as findBufferType() but with additional capability of distinguishing between C-headers and C-Source. For this purpose this function looks at the extension of the filename. This means that 'filename' can be a filename on some FTP server, too. @return A pointer to the result object. Do @em not delete the result object. After another call to KMimeMagic the returned result object changes its value since it is reused by KMimeMagic. @short Same functionality as findBufferType() but with additional capability of distinguishing between C-headers and C-Source. */ public native KMimeMagicResult findBufferFileType(byte[] arg1, String filename); /** Returns a pointer to the unique KMimeMagic instance in this process. @short Returns a pointer to the unique KMimeMagic instance in this process. */ public static native KMimeMagic self(); protected static native void initStatic(); /** 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(); }