org.kde.koala
Class KDEDesktopMimeType

java.lang.Object
  extended by org.kde.koala.KShared
      extended by org.kde.koala.KSycocaEntry
          extended by org.kde.koala.KServiceType
              extended by org.kde.koala.KMimeType
                  extended by org.kde.koala.KDEDesktopMimeType
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KDEDesktopMimeType
extends KMimeType

Mime type for desktop files. Handles mount/umount icon, and user-defined properties.


Field Summary
static int ST_MOUNT
           
static int ST_UNMOUNT
           
static int ST_USER_DEFINED
           
 
Constructor Summary
protected KDEDesktopMimeType(java.lang.Class dummy)
           
  KDEDesktopMimeType(KDesktopFile config)
          Construct a desktop mimetype and take all information from a desktop file.
  KDEDesktopMimeType(org.kde.qt.QDataStream _str, int offset)
          \internal @short \internal
 
Method Summary
 java.lang.String comment(KURL _url, boolean _is_local)
          Returns the descriptive comment associated with the MIME type.
 java.lang.String comment(java.lang.String _url, boolean _is_local)
          Returns the descriptive comment associated with the MIME type.
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
protected  void finalize()
          Deletes the wrapped C++ instance
 java.lang.String icon(KURL _url, boolean _is_local)
          Return the filename of the icon associated with the mimetype.
 java.lang.String icon(java.lang.String _url, boolean _is_local)
          Return the filename of the icon associated with the mimetype.
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
 org.kde.qt.QPixmap pixmap(int group)
           
 org.kde.qt.QPixmap pixmap(int group, int force_size)
           
 org.kde.qt.QPixmap pixmap(int group, int force_size, int state)
           
 org.kde.qt.QPixmap pixmap(int group, int force_size, int state, java.lang.StringBuffer path)
          Use this function only if you don't have a special URL for which you search a pixmap.
 org.kde.qt.QPixmap pixmap(KURL _url, int _group)
           
 org.kde.qt.QPixmap pixmap(KURL _url, int _group, int _force_size)
           
 org.kde.qt.QPixmap pixmap(KURL _url, int _group, int _force_size, int _state)
           
 org.kde.qt.QPixmap pixmap(KURL _url, int _group, int _force_size, int _state, java.lang.StringBuffer _path)
          Find the pixmap for a given file of this mimetype.
static int run(KURL _url, boolean _is_local)
          Invokes the default action for the desktop entry.
protected static int runApplication(KURL _url, java.lang.String _serviceFile)
           
protected static int runFSDevice(KURL _url, KSimpleConfig cfg)
           
protected static int runLink(KURL _url, KSimpleConfig cfg)
           
protected static int runMimeType(KURL _url, KSimpleConfig cfg)
           
 
Methods inherited from class org.kde.koala.KMimeType
buildDefaultType, checkEssentialMimeTypes, comment, defaultMimeType, errorMissingMimeType, favIconForURL, iconForURL, iconForURL, init, is, load, loadInternal, parentMimeType, patterns, patternsAccuracy, pixmapForURL, pixmapForURL, pixmapForURL, pixmapForURL, pixmapForURL, pixmapForURL, property, propertyNames, save
 
Methods inherited from class org.kde.koala.KServiceType
desktopEntryPath, icon, inherits, isDerived, isValid, name, parentServiceType, propertyDef, propertyDefNames
 
Methods inherited from class org.kde.koala.KSycocaEntry
entryPath, isDeleted, isType, offset, read, read, sycocaType
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ST_MOUNT

public static final int ST_MOUNT
See Also:
Constant Field Values

ST_UNMOUNT

public static final int ST_UNMOUNT
See Also:
Constant Field Values

ST_USER_DEFINED

public static final int ST_USER_DEFINED
See Also:
Constant Field Values
Constructor Detail

KDEDesktopMimeType

protected KDEDesktopMimeType(java.lang.Class dummy)

KDEDesktopMimeType

public KDEDesktopMimeType(KDesktopFile config)
Construct a desktop mimetype and take all information from a desktop file.

Parameters:
config - the desktop configuration file that describes the mime type

KDEDesktopMimeType

public KDEDesktopMimeType(org.kde.qt.QDataStream _str,
                          int offset)
\internal @short \internal

Method Detail

icon

public java.lang.String icon(java.lang.String _url,
                             boolean _is_local)
Description copied from class: KMimeType
Return the filename of the icon associated with the mimetype. The arguments are unused, but provided so that KMimeType-derived classes can use them (e.g. KFolderType uses the URL to return one out of 2 icons)

Overrides:
icon in class KMimeType
Returns:
The path to the icon associated with this MIME type.

icon

public java.lang.String icon(KURL _url,
                             boolean _is_local)
Description copied from class: KMimeType
Return the filename of the icon associated with the mimetype. The arguments are unused, but provided so that KMimeType-derived classes can use them (e.g. KFolderType uses the URL to return one out of 2 icons)

Overrides:
icon in class KMimeType
Returns:
The path to the icon associated with this MIME type.

pixmap

public org.kde.qt.QPixmap pixmap(KURL _url,
                                 int _group,
                                 int _force_size,
                                 int _state,
                                 java.lang.StringBuffer _path)
Description copied from class: KMimeType
Find the pixmap for a given file of this mimetype. Convenience method that uses icon(), but also locates and load the pixmap.

Overrides:
pixmap in class KMimeType
Parameters:
_url - URL for the file.
_group - The icon group where the icon is going to be used.
_force_size - Override globallly configured icon size. Use 0 for the default size
_state - The icon state, one of: KIcon.DefaultState, KIcon.ActiveState or KIcon.DisabledState.
_path - Output parameter to get the full path. Seldom needed. Ignored if 0
Returns:
the pixmap of the URL, can be a default icon if not found

pixmap

public org.kde.qt.QPixmap pixmap(KURL _url,
                                 int _group,
                                 int _force_size,
                                 int _state)
Overrides:
pixmap in class KMimeType

pixmap

public org.kde.qt.QPixmap pixmap(KURL _url,
                                 int _group,
                                 int _force_size)
Overrides:
pixmap in class KMimeType

pixmap

public org.kde.qt.QPixmap pixmap(KURL _url,
                                 int _group)
Overrides:
pixmap in class KMimeType

comment

public java.lang.String comment(java.lang.String _url,
                                boolean _is_local)
Description copied from class: KMimeType
Returns the descriptive comment associated with the MIME type. The arguments are unused, but provided so that KMimeType derived classes can use them.

Overrides:
comment in class KMimeType
Returns:
The descriptive comment associated with the MIME type, if any.

comment

public java.lang.String comment(KURL _url,
                                boolean _is_local)
Description copied from class: KMimeType
Returns the descriptive comment associated with the MIME type. The arguments are unused, but provided so that KMimeType derived classes can use them.

Overrides:
comment in class KMimeType
Returns:
The descriptive comment associated with the MIME type, if any.

run

public static int run(KURL _url,
                      boolean _is_local)
Invokes the default action for the desktop entry. If the desktop entry is not local, then only false is returned. Otherwise we would create a security problem. Only types Link and Mimetype could be followed.

Parameters:
_url - the url to run
_is_local - true if the URL is local, false otherwise
Returns:
true on success and false on failure.
See Also:
KRun.runURL(org.kde.koala.KURL, java.lang.String, boolean, boolean)

pixmap

public org.kde.qt.QPixmap pixmap(int group,
                                 int force_size,
                                 int state,
                                 java.lang.StringBuffer path)
Description copied from class: KMimeType
Use this function only if you don't have a special URL for which you search a pixmap. This function is useful to find out, which icon is usually chosen for a certain mime type. Since no URL is passed, it is impossible to obey icon hints in desktop entries for example.

Overrides:
pixmap in class KMimeType
Parameters:
group - The icon group where the icon is going to be used.
force_size - Override globallly configured icon size. Use 0 for the default size
state - The icon state, one of: KIcon.DefaultState, KIcon.ActiveState or KIcon.DisabledState.
path - Output parameter to get the full path. Seldom needed. Ignored if 0
Returns:
the pixmap of the mime type, can be a default icon if not found

pixmap

public org.kde.qt.QPixmap pixmap(int group,
                                 int force_size,
                                 int state)
Overrides:
pixmap in class KMimeType

pixmap

public org.kde.qt.QPixmap pixmap(int group,
                                 int force_size)
Overrides:
pixmap in class KMimeType

pixmap

public org.kde.qt.QPixmap pixmap(int group)
Overrides:
pixmap in class KMimeType

runFSDevice

protected static int runFSDevice(KURL _url,
                                 KSimpleConfig cfg)

runApplication

protected static int runApplication(KURL _url,
                                    java.lang.String _serviceFile)

runLink

protected static int runLink(KURL _url,
                             KSimpleConfig cfg)

runMimeType

protected static int runMimeType(KURL _url,
                                 KSimpleConfig cfg)

finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class KMimeType
Throws:
java.lang.InternalError

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

Overrides:
dispose in class KMimeType

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

Overrides:
isDisposed in class KMimeType