|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.koala.KIconLoader
public class KIconLoader
Iconloader for KDE. KIconLoader will load the current icon theme and all its base themes. Icons will be searched in any of these themes. Additionally, it caches icons and applies effects according the the user's preferences. In KDE, it is encouraged to load icons by "Group". An icon group is a location on the screen where icons are being used. Standard groups are: Desktop, Toolbar, MainToolbar, Small and Panel. Each group has some centrally configured properties bound to it, including the icon size and effects. This makes it possible to offer a consistent icon look in all KDE applications. The standard groups are defined below.
Constructor Summary | |
---|---|
|
KIconLoader()
|
protected |
KIconLoader(java.lang.Class dummy)
|
|
KIconLoader(java.lang.String appname)
|
|
KIconLoader(java.lang.String appname,
KStandardDirs dirs)
Constructs an iconloader. |
Method Summary | |
---|---|
void |
addAppDir(java.lang.String appname)
Adds appname to the list of application specific directories. |
void |
addExtraDesktopThemes()
Adds all the default themes from other desktops at the end of the list of icon themes. |
int |
currentSize(int group)
Returns the current size of the group. |
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
void |
enableDelayedIconSetLoading(boolean enable)
Enables on-demand icon loading for QIconSets using QIconFactory. |
boolean |
extraDesktopThemesAdded()
Returns if the default icon themes of other desktops have been added to the list of icon themes where icons are searched. |
protected void |
finalize()
Deletes the wrapped C++ instance |
KIconEffect |
iconEffect()
Returns a pointer to the KIconEffect object used by the icon loader. |
java.lang.String |
iconPath(java.lang.String name,
int group_or_size)
|
java.lang.String |
iconPath(java.lang.String name,
int group_or_size,
boolean canReturnNull)
Returns the path of an icon. |
boolean |
isDelayedIconSetLoadingEnabled()
Checks whether delayed loading for QIconSet is enabled. |
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
java.util.ArrayList |
loadAnimated(java.lang.String name,
int group)
|
java.util.ArrayList |
loadAnimated(java.lang.String name,
int group,
int size)
Loads an animated icon as a series of still frames. |
org.kde.qt.QPixmap |
loadIcon(java.lang.String name,
int group)
|
org.kde.qt.QPixmap |
loadIcon(java.lang.String name,
int group,
int size)
|
org.kde.qt.QPixmap |
loadIcon(java.lang.String name,
int group,
int size,
int state)
|
org.kde.qt.QPixmap |
loadIcon(java.lang.String name,
int group,
int size,
int state,
java.lang.StringBuffer path_store)
|
org.kde.qt.QPixmap |
loadIcon(java.lang.String name,
int group,
int size,
int state,
java.lang.StringBuffer path_store,
boolean canReturnNull)
Loads an icon. |
org.kde.qt.QIconSet |
loadIconSet(java.lang.String name,
int group)
|
org.kde.qt.QIconSet |
loadIconSet(java.lang.String name,
int group,
int size)
Creates an icon set, that will do on-demand loading of the icon. |
org.kde.qt.QIconSet |
loadIconSet(java.lang.String name,
int group,
int size,
boolean canReturnNull)
Creates an icon set, that will do on-demand loading of the icon. |
org.kde.qt.QIconSet |
loadIconSet(java.lang.String name,
int group,
int size,
boolean canReturnNull,
boolean immediateExistenceCheck)
Creates an icon set, that will do on-demand loading of the icon. |
org.kde.qt.QMovie |
loadMovie(java.lang.String name,
int group)
|
org.kde.qt.QMovie |
loadMovie(java.lang.String name,
int group,
int size)
Loads an animated icon. |
java.lang.String |
moviePath(java.lang.String name,
int group)
|
java.lang.String |
moviePath(java.lang.String name,
int group,
int size)
Returns the path to an animated icon. |
java.util.ArrayList |
queryIcons(int group_or_size)
|
java.util.ArrayList |
queryIcons(int group_or_size,
int context)
Queries all available icons for a specific group, having a specific context. |
java.util.ArrayList |
queryIconsByContext(int group_or_size)
|
java.util.ArrayList |
queryIconsByContext(int group_or_size,
int context)
Queries all available icons for a specific context. |
java.util.ArrayList |
queryIconsByDir(java.lang.String iconsDir)
Returns a list of all icons (.png or .xpm extension) in the given directory. |
void |
reconfigure(java.lang.String _appname,
KStandardDirs _dirs)
Called by KInstance.newIconLoader to reconfigure the icon loader. |
static org.kde.qt.QPixmap |
unknown()
Returns the unknown icon. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected KIconLoader(java.lang.Class dummy)
public KIconLoader(java.lang.String appname, KStandardDirs dirs)
appname
- Add the data directories of this application to the
icon search path for the "User" group. The default argument adds the
directories of the current application.dirs
- the KStandardDirs object to use. If null the global one is used
Usually, you use the default iconloader, which can be accessed via
KGlobal.iconLoader(), so you hardly ever have to create an
iconloader object yourself. That one is the current KInstance's
(typically KApplication's) iconloader.KGlobal.iconLoader()
,
KInstance.iconLoader()
public KIconLoader(java.lang.String appname)
public KIconLoader()
Method Detail |
---|
public void addAppDir(java.lang.String appname)
appname
to the list of application specific directories.
appname
- The application name.public org.kde.qt.QPixmap loadIcon(java.lang.String name, int group, int size, int state, java.lang.StringBuffer path_store, boolean canReturnNull)
canReturnNull
parameter.
name
- The name of the icon, without extension.group
- The icon group. This will specify the size of and effects to
be applied to the icon.size
- If nonzero, this overrides the size specified by group.
See KIcon.StdSizes.state
- The icon state: DefaultState
, ActiveState
or
DisabledState.
Depending on the user's preferences, the iconloader
may apply a visual effect to hint about its state.path_store
- If not null, the path of the icon is stored here.canReturnNull
- Can return a null pixmap? If false, the
"unknown" pixmap is returned when no appropriate icon has been found.
canReturnNull.
public org.kde.qt.QPixmap loadIcon(java.lang.String name, int group, int size, int state, java.lang.StringBuffer path_store)
public org.kde.qt.QPixmap loadIcon(java.lang.String name, int group, int size, int state)
public org.kde.qt.QPixmap loadIcon(java.lang.String name, int group, int size)
public org.kde.qt.QPixmap loadIcon(java.lang.String name, int group)
public org.kde.qt.QIconSet loadIconSet(java.lang.String name, int group, int size, boolean canReturnNull, boolean immediateExistenceCheck)
name
- The name of the icon, without extension.group
- The icon group. This will specify the size of and effects to
be applied to the icon.size
- If nonzero, this overrides the size specified by group.
See KIcon.StdSizes.canReturnNull
- Can return a null iconset? If false, iconset
containing the "unknown" pixmap is returned when no appropriate icon has
been found.immediateExistenceCheck
- If true on-demand icon loading will be
disabled for canReturnNull and a null iconset may be returned immediately
canReturnNull.
public org.kde.qt.QIconSet loadIconSet(java.lang.String name, int group, int size, boolean canReturnNull)
name
- The name of the icon, without extension.group
- The icon group. This will specify the size of and effects to
be applied to the icon.size
- If nonzero, this overrides the size specified by group.
See KIcon.StdSizes.canReturnNull
- Can return a null iconset? If false, iconset
containing the "unknown" pixmap is returned when no appropriate icon has
been found.
canReturnNull.
public org.kde.qt.QIconSet loadIconSet(java.lang.String name, int group, int size)
name
- The name of the icon, without extension.group
- The icon group. This will specify the size of and effects to
be applied to the icon.size
- If nonzero, this overrides the size specified by group.
See KIcon.StdSizes.
public org.kde.qt.QIconSet loadIconSet(java.lang.String name, int group)
public java.lang.String iconPath(java.lang.String name, int group_or_size, boolean canReturnNull)
name
- The name of the icon, without extension. If an absolute
path is supplied for this parameter, iconPath will return it
directly.group_or_size
- If positive, search icons whose size is
specified by the icon group group_or_size.
If negative, search
icons whose size is - group_or_size.
See KIcon.Group and KIcon.StdSizescanReturnNull
- Can return a null string? If not, a path to the
"unknown" icon will be returned.
canReturnNull.
public java.lang.String iconPath(java.lang.String name, int group_or_size)
public org.kde.qt.QMovie loadMovie(java.lang.String name, int group, int size)
name
- The name of the icon.group
- The icon group. See loadIcon().size
- Override the default size for group.
See KIcon.StdSizes.
public org.kde.qt.QMovie loadMovie(java.lang.String name, int group)
public java.lang.String moviePath(java.lang.String name, int group, int size)
name
- The name of the icon.group
- The icon group. See loadIcon().size
- Override the default size for group.
See KIcon.StdSizes.
public java.lang.String moviePath(java.lang.String name, int group)
public java.util.ArrayList loadAnimated(java.lang.String name, int group, int size)
name
- The name of the icon.group
- The icon group. See loadIcon().size
- Override the default size for group.
See KIcon.StdSizes.
public java.util.ArrayList loadAnimated(java.lang.String name, int group)
public java.util.ArrayList queryIcons(int group_or_size, int context)
group_or_size
- If positive, search icons whose size is
specified by the icon group group_or_size.
If negative, search
icons whose size is - group_or_size.
See KIcon.Group and KIcon.StdSizescontext
- The icon context.
public java.util.ArrayList queryIcons(int group_or_size)
public java.util.ArrayList queryIconsByContext(int group_or_size, int context)
group_or_size
- The icon preferred group or size. If available
at this group or size, those icons will be returned, in other case,
icons of undefined size will be returned. Positive numbers are groups,
negative numbers are negated sizes. See KIcon.Group and
KIcon.StdSizescontext
- The icon context.
public java.util.ArrayList queryIconsByContext(int group_or_size)
public java.util.ArrayList queryIconsByDir(java.lang.String iconsDir)
iconsDir
- the directory to search in
public int currentSize(int group)
group
- the group to check.
public KIconEffect iconEffect()
public void reconfigure(java.lang.String _appname, KStandardDirs _dirs)
_appname
- the new application name_dirs
- the new standard directories. If 0, the directories
from KGlobal will be taken.public void addExtraDesktopThemes()
public boolean extraDesktopThemesAdded()
public void enableDelayedIconSetLoading(boolean enable)
enable
- true to enable delayed icon loading, false to disableisDelayedIconSetLoadingEnabled()
,
org.kde.qt.QIconFactory
public boolean isDelayedIconSetLoadingEnabled()
enableDelayedIconSetLoading(boolean)
,
org.kde.qt.QIconFactory
public static org.kde.qt.QPixmap unknown()
protected void finalize() throws java.lang.InternalError
finalize
in class java.lang.Object
java.lang.InternalError
public void dispose()
public boolean isDisposed()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |