|
||||||||
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.KService
public class KService
Represent a service, i.e. an application bound to one or several mimetypes (or servicetypes) as written in its desktop entry file. A service may be a library, too. The starting point you need is often the static methods. Service types are stored as desktop files in the "service" resource..
KServiceType
,
KServiceGroup
Field Summary | |
---|---|
static int |
DCOP_Multi
|
static int |
DCOP_None
Describes the DCOP type of the service. |
static int |
DCOP_Unique
|
static int |
DCOP_Wait
|
Constructor Summary | |
---|---|
protected |
KService(java.lang.Class dummy)
|
|
KService(KDesktopFile config)
Construct a service and take all information from a desktop file. |
|
KService(org.kde.qt.QDataStream _str,
int offset)
Construct a service from a stream. |
|
KService(java.lang.String _fullpath)
Construct a service and take all information from a config file. |
|
KService(java.lang.String _name,
java.lang.String _exec,
java.lang.String _icon)
Construct a temporary service with a given name, exec-line and icon. |
Method Summary | |
---|---|
protected java.util.ArrayList |
accessServiceTypes()
|
boolean |
allowAsDefault()
Checks whether a service is used as a default setting, for example as plugin in a file manager. |
boolean |
allowMultipleFiles()
Checks whether this service can handle several files as startup arguments. |
java.util.ArrayList |
categories()
Returns a list of VFolder categories. |
java.lang.String |
comment()
Returns the descriptive comment for the service, if there is one. |
int |
DCOPServiceType()
Returns the DCOPServiceType supported by this service. |
java.lang.String |
desktopEntryName()
Returns the filename of the service desktop entry without any extension. |
java.lang.String |
desktopEntryPath()
Returns the path to the location where the service desktop entry is stored. |
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
java.lang.String |
exec()
Returns the executable. |
protected void |
finalize()
Deletes the wrapped C++ instance |
java.lang.String |
genericName()
Returns the generic name for the service, if there is one (e.g. |
boolean |
hasServiceType(java.lang.String _service)
Checks whether the service supports this service type |
java.lang.String |
icon()
Returns the name of the icon. |
java.lang.String |
init()
Returns the name of the init function to call (KControl modules). |
protected void |
init(KDesktopFile config)
|
int |
initialPreference()
What preference to associate with this service initially (before the user has had any chance to define a profile for it). |
int |
initialPreferenceForMimeType(java.lang.String mimeType)
What preference to associate with this service initially for handling the specified mimetype. |
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
boolean |
isValid()
Checks whether the service is valid. |
java.util.ArrayList |
keywords()
Returns a list of descriptive keywords the service, if there are any. |
java.lang.String |
library()
Returns the name of the service's library. |
void |
load(org.kde.qt.QDataStream arg1)
Load the service from a stream. |
java.lang.String |
locateLocal()
Returns a path that can be used for saving changes to this service |
java.lang.String |
menuId()
Returns the menu ID of the service desktop entry. |
java.lang.String |
name()
Returns the name of the service. |
static java.lang.String |
newServicePath(boolean showInMenu,
java.lang.String suggestedName)
|
static java.lang.String |
newServicePath(boolean showInMenu,
java.lang.String suggestedName,
java.lang.StringBuffer menuId)
|
static java.lang.String |
newServicePath(boolean showInMenu,
java.lang.String suggestedName,
java.lang.StringBuffer menuId,
java.lang.String[] reservedMenuIds)
Returns a path that can be used to create a new KService based on suggestedName. |
boolean |
noDisplay()
Whether the entry should be suppressed in menus. |
java.lang.String |
parentApp()
Name of the application this service belongs to. |
java.lang.String |
path()
Returns the working directory to run the program in. |
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)
Returns the pixmap that represents the icon. |
org.kde.qt.QVariant |
property(java.lang.String _name)
Returns the requested property. |
org.kde.qt.QVariant |
property(java.lang.String _name,
int t)
Returns the requested property. |
java.util.ArrayList |
propertyNames()
Returns the list of all properties that this service can have. |
static void |
rebuildKSycoca(org.kde.qt.QWidget parent)
Rebuild KSycoca and show a progress dialog while doing so. |
void |
save(org.kde.qt.QDataStream arg1)
Save the service to a stream. |
java.util.ArrayList |
serviceTypes()
Returns the service types that this service supports. |
void |
setInitialPreference(int i)
|
void |
setMenuId(java.lang.String menuId)
Set the menu id |
void |
setTerminal(boolean b)
Sets whether to use a terminal or not |
void |
setTerminalOptions(java.lang.String options)
Sets the terminal options to use |
java.lang.String |
storageId()
Returns a normalized ID suitable for storing in configuration files. |
boolean |
substituteUid()
Checks whether the service runs with a different user id. |
boolean |
terminal()
Checks whethe the service should be run in a terminal. |
java.lang.String |
terminalOptions()
Returns any options associated with the terminal the service runs in, if it requires a terminal. |
java.lang.String |
type()
Returns the type of the service. |
java.lang.String |
untranslatedGenericName()
Returns the untranslated (US English) generic name for the service, if there is one (e.g. |
java.lang.String |
username()
Returns the user name, if the service runs with a different user id. |
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 |
---|
public static final int DCOP_None
public static final int DCOP_Unique
public static final int DCOP_Multi
public static final int DCOP_Wait
Constructor Detail |
---|
protected KService(java.lang.Class dummy)
public KService(java.lang.String _name, java.lang.String _exec, java.lang.String _icon)
_name
- the name of the service_exec
- the executable_icon
- the name of the iconpublic KService(java.lang.String _fullpath)
_fullpath
- Full path to the config file.public KService(KDesktopFile config)
config
- the desktop file to readpublic KService(org.kde.qt.QDataStream _str, int offset)
Method Detail |
---|
public java.lang.String type()
public java.lang.String name()
name
in class KSycocaEntry
public java.lang.String exec()
public java.lang.String library()
public java.lang.String init()
public java.lang.String icon()
public org.kde.qt.QPixmap pixmap(int _group, int _force_size, int _state, java.lang.StringBuffer _path)
icon()
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 boolean terminal()
public java.lang.String terminalOptions()
public boolean substituteUid()
username()
public java.lang.String username()
#substututeUida
public java.lang.String desktopEntryPath()
public java.lang.String desktopEntryName()
public java.lang.String menuId()
public java.lang.String storageId()
public int DCOPServiceType()
public java.lang.String path()
public java.lang.String comment()
public java.lang.String genericName()
public java.lang.String untranslatedGenericName()
public java.util.ArrayList keywords()
public java.util.ArrayList categories()
public java.util.ArrayList serviceTypes()
public boolean hasServiceType(java.lang.String _service)
_service
- The name of the service type you are
interested in determining whether this services supports.
public boolean allowAsDefault()
public boolean allowMultipleFiles()
public int initialPreference()
public int initialPreferenceForMimeType(java.lang.String mimeType)
public void setInitialPreference(int i)
public boolean noDisplay()
public java.lang.String parentApp()
public org.kde.qt.QVariant property(java.lang.String _name)
_name
- the name of the property
KServiceType
public org.kde.qt.QVariant property(java.lang.String _name, int t)
_name
- the name of the propertyt
- the assumed type of the property
KServiceType
public java.util.ArrayList propertyNames()
public boolean isValid()
isValid
in class KSycocaEntry
public java.lang.String locateLocal()
public void load(org.kde.qt.QDataStream arg1)
load
in class KSycocaEntry
public void save(org.kde.qt.QDataStream arg1)
save
in class KSycocaEntry
public void setMenuId(java.lang.String menuId)
public void setTerminal(boolean b)
public void setTerminalOptions(java.lang.String options)
public static java.lang.String newServicePath(boolean showInMenu, java.lang.String suggestedName, java.lang.StringBuffer menuId, java.lang.String[] reservedMenuIds)
suggestedName.
showInMenu
- true, if the service should be shown in the KDE menu
false, if the service should be hidden from the menusuggestedName
- name to base the file on, if a service with such
name already exists, a prefix will be added to make it unique.menuId
- If provided, menuId will be set to the menu id to use for
the KServicereservedMenuIds
- If provided, the path and menu id will be chosen
in such a way that the new menu id does not conflict with any
of the reservedMenuIds
public static java.lang.String newServicePath(boolean showInMenu, java.lang.String suggestedName, java.lang.StringBuffer menuId)
public static java.lang.String newServicePath(boolean showInMenu, java.lang.String suggestedName)
public static void rebuildKSycoca(org.kde.qt.QWidget parent)
parent
- Parent widget for the progress dialogprotected void init(KDesktopFile config)
protected java.util.ArrayList accessServiceTypes()
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 |