|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.KShared
org.kde.koala.KSycocaEntry
org.kde.koala.KServiceType
org.kde.koala.KMimeType
public class KMimeType
Represent a mime type, like "text/plain", and the data that is associated with it. The starting point you need is often the static methods. KMimeType inherits KServiceType because "text/plain" can be used to find services (apps and components) "which can open text/plain".
KServiceType
Constructor Summary | |
---|---|
protected |
KMimeType(java.lang.Class dummy)
|
|
KMimeType(KDesktopFile config)
Construct a mimetype and take all information from a desktop file. |
|
KMimeType(org.kde.qt.QDataStream _str,
int offset)
The stream must already be positionned at the correct offset |
|
KMimeType(java.lang.String _fullpath)
Construct a mimetype and take all information from a config file. |
|
KMimeType(java.lang.String _fullpath,
java.lang.String _type,
java.lang.String _icon,
java.lang.String _comment,
java.lang.String[] _patterns)
Constructor. |
Method Summary | |
---|---|
protected static void |
buildDefaultType()
This function makes sure that the default mime type exists. |
protected static void |
checkEssentialMimeTypes()
This function makes sure that vital mime types are installed. |
java.lang.String |
comment()
Returns the descriptive comment associated with the MIME type. |
java.lang.String |
comment(KURL arg1,
boolean arg2)
Returns the descriptive comment associated with the MIME type. |
java.lang.String |
comment(java.lang.String arg1,
boolean arg2)
Returns the descriptive comment associated with the MIME type. |
static java.lang.String |
defaultMimeType()
Returns the name of the default mimetype. |
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
protected static void |
errorMissingMimeType(java.lang.String _type)
Signal a missing mime type. |
static java.lang.String |
favIconForURL(KURL url)
Return the "favicon" (see http://www.favicon.com) for the given url ,
if available. |
protected void |
finalize()
Deletes the wrapped C++ instance |
java.lang.String |
icon(KURL arg1,
boolean arg2)
Return the filename of the icon associated with the mimetype. |
java.lang.String |
icon(java.lang.String arg1,
boolean arg2)
Return the filename of the icon associated with the mimetype. |
static java.lang.String |
iconForURL(KURL _url)
|
static java.lang.String |
iconForURL(KURL _url,
long _mode)
The same functionality as pixmapForURL(), but this method returns the name of the icon to load. |
protected void |
init(KDesktopFile arg1)
Returns a list of all the supported servicetypes. |
boolean |
is(java.lang.String mimeTypeName)
Do not use name()=="somename" anymore, to check for a given mimetype. |
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
void |
load(org.kde.qt.QDataStream qs)
Load the mimetype from a stream. |
protected void |
loadInternal(org.kde.qt.QDataStream arg1)
Determines the mimetype of file based on it's name and returns the matching pattern if any. |
java.lang.String |
parentMimeType()
If this mimetype inherits from ("is also") another mimetype, return the name of the parent. |
java.util.ArrayList |
patterns()
Retrieve the list of patterns associated with the MIME Type. |
protected int |
patternsAccuracy()
|
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 org.kde.qt.QPixmap |
pixmapForURL(KURL _url)
|
static org.kde.qt.QPixmap |
pixmapForURL(KURL _url,
long _mode)
|
static org.kde.qt.QPixmap |
pixmapForURL(KURL _url,
long _mode,
int _group)
|
static org.kde.qt.QPixmap |
pixmapForURL(KURL _url,
long _mode,
int _group,
int _force_size)
|
static org.kde.qt.QPixmap |
pixmapForURL(KURL _url,
long _mode,
int _group,
int _force_size,
int _state)
|
static org.kde.qt.QPixmap |
pixmapForURL(KURL _url,
long _mode,
int _group,
int _force_size,
int _state,
java.lang.StringBuffer _path)
Convenience method to find the pixmap for a URL. |
org.kde.qt.QVariant |
property(java.lang.String _name)
Returns the property with the given _name. |
java.util.ArrayList |
propertyNames()
Retrieves a list of all properties associated with this KMimeType. |
void |
save(org.kde.qt.QDataStream qs)
Save the mimetype to a stream. |
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 |
Constructor Detail |
---|
protected KMimeType(java.lang.Class dummy)
public KMimeType(java.lang.String _fullpath, java.lang.String _type, java.lang.String _icon, java.lang.String _comment, java.lang.String[] _patterns)
_fullpath
- the path to the configuration file (.desktop)_type
- the mime type itself_icon
- the name of the icon that represens the mime type_comment
- a comment describing the mime type_patterns
- a list of file globs that describes the names (or
extensions) of the files with this mime typepublic KMimeType(java.lang.String _fullpath)
_fullpath
- the path to the configuration file (.desktop)public KMimeType(KDesktopFile config)
config
- the desktop configuration file that describes the mime typepublic KMimeType(org.kde.qt.QDataStream _str, int offset)
Method Detail |
---|
public java.lang.String icon(java.lang.String arg1, boolean arg2)
public java.lang.String icon(KURL arg1, boolean arg2)
public org.kde.qt.QPixmap pixmap(int group, int force_size, int state, java.lang.StringBuffer path)
group
- The icon group where the icon is going to be used.force_size
- Override globallly configured icon size.
Use 0 for the default sizestate
- 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
public org.kde.qt.QPixmap pixmap(int group, int force_size, int state)
public org.kde.qt.QPixmap pixmap(int group, int force_size)
public org.kde.qt.QPixmap pixmap(int group)
public org.kde.qt.QPixmap pixmap(KURL _url, int _group, int _force_size, int _state, java.lang.StringBuffer _path)
_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
public org.kde.qt.QPixmap pixmap(KURL _url, int _group, int _force_size, int _state)
public org.kde.qt.QPixmap pixmap(KURL _url, int _group, int _force_size)
public org.kde.qt.QPixmap pixmap(KURL _url, int _group)
public java.lang.String comment()
comment
in class KServiceType
public java.lang.String comment(java.lang.String arg1, boolean arg2)
public java.lang.String comment(KURL arg1, boolean arg2)
public java.util.ArrayList patterns()
public void load(org.kde.qt.QDataStream qs)
load
in class KServiceType
qs
- the stream to load frompublic void save(org.kde.qt.QDataStream qs)
save
in class KServiceType
qs
- the stream to save topublic org.kde.qt.QVariant property(java.lang.String _name)
_name.
property
in class KServiceType
_name
- the name of the property
propertyNames()
public java.util.ArrayList propertyNames()
propertyNames
in class KServiceType
property(java.lang.String)
public java.lang.String parentMimeType()
public boolean is(java.lang.String mimeTypeName)
public static org.kde.qt.QPixmap pixmapForURL(KURL _url, long _mode, int _group, int _force_size, int _state, java.lang.StringBuffer _path)
_url
- URL for the file._mode
- the mode of the file. The mode may modify the icon
with overlays that show special properties of the
icon. Use 0 for default_group
- The icon group where the icon is going to be used._force_size
- Override globally 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
public static org.kde.qt.QPixmap pixmapForURL(KURL _url, long _mode, int _group, int _force_size, int _state)
public static org.kde.qt.QPixmap pixmapForURL(KURL _url, long _mode, int _group, int _force_size)
public static org.kde.qt.QPixmap pixmapForURL(KURL _url, long _mode, int _group)
public static org.kde.qt.QPixmap pixmapForURL(KURL _url, long _mode)
public static org.kde.qt.QPixmap pixmapForURL(KURL _url)
public static java.lang.String iconForURL(KURL _url, long _mode)
_url
- URL for the file_mode
- the mode of the file. The mode may modify the icon
with overlays that show special properties of the
icon. Use 0 for default
public static java.lang.String iconForURL(KURL _url)
public static java.lang.String favIconForURL(KURL url)
url
,
if available. Does NOT attempt to download the favicon, it only returns
one that is already available.
If unavailable, returns null.
url
- the URL of the favicon
public static java.lang.String defaultMimeType()
protected void loadInternal(org.kde.qt.QDataStream arg1)
protected void init(KDesktopFile arg1)
KServiceType
init
in class KServiceType
protected int patternsAccuracy()
protected static void errorMissingMimeType(java.lang.String _type)
_type
- the missinf mime typeprotected static void buildDefaultType()
protected static void checkEssentialMimeTypes()
protected void finalize() throws java.lang.InternalError
finalize
in class KServiceType
java.lang.InternalError
public void dispose()
dispose
in class KServiceType
public boolean isDisposed()
isDisposed
in class KServiceType
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |