org.kde.koala
Class KServiceTypeProfile

java.lang.Object
  extended by org.kde.koala.KServiceTypeProfile
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KServiceTypeProfile
extends java.lang.Object
implements org.kde.qt.QtSupport

KServiceTypeProfile represents the user's preferences for services of a service type. It consists of a list of services (service offers) for the service type that is sorted by the user's preference. KTrader uses KServiceTypeProfile to sort its results, so usually you can just use KTrader to find the user's preferred service.

See Also:
KService, KServiceType, KServiceOffer, KTrader

Constructor Summary
protected KServiceTypeProfile(java.lang.Class dummy)
           
  KServiceTypeProfile(java.lang.String serviceType)
           
  KServiceTypeProfile(java.lang.String serviceType, java.lang.String genericServiceType)
          Constructor is called when the user profile is read for the first time.
 
Method Summary
protected  void addService(java.lang.String _service)
           
protected  void addService(java.lang.String _service, int _preference)
           
protected  void addService(java.lang.String _service, int _preference, boolean _allow_as_default)
          Add a service to this profile.
static void clear()
          Clear all cached information
static boolean configurationMode()
           
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
protected  void finalize()
          Deletes the wrapped C++ instance
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
static KServiceTypeProfile serviceTypeProfile(java.lang.String servicetype)
           
static KServiceTypeProfile serviceTypeProfile(java.lang.String servicetype, java.lang.String genericServiceType)
          Returns the profile for the requested service type.
static void setConfigurationMode()
          This method activates a special mode of KServiceTypeProfile, in which all/all and all/allfiles are excluded from the results of the queries.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KServiceTypeProfile

protected KServiceTypeProfile(java.lang.Class dummy)

KServiceTypeProfile

public KServiceTypeProfile(java.lang.String serviceType,
                           java.lang.String genericServiceType)
Constructor is called when the user profile is read for the first time.

Parameters:
serviceType - the service type (e.g. a MIME type)
genericServiceType - the generic service type (e.g. "Application" or "KParts/ReadOnlyPart"). Can be null, then the "Application" generic type will be used

KServiceTypeProfile

public KServiceTypeProfile(java.lang.String serviceType)
Method Detail

serviceTypeProfile

public static KServiceTypeProfile serviceTypeProfile(java.lang.String servicetype,
                                                     java.lang.String genericServiceType)
Returns the profile for the requested service type.

Parameters:
servicetype - the service type (e.g. a MIME type)
genericServiceType - the generic service type (e.g. "Application" or "KParts/ReadOnlyPart"). Can be null, then the "Application" generic type will be used
Returns:
the KServiceTypeProfile with the given arguments, or 0 if not found

serviceTypeProfile

public static KServiceTypeProfile serviceTypeProfile(java.lang.String servicetype)

clear

public static void clear()
Clear all cached information


setConfigurationMode

public static void setConfigurationMode()
This method activates a special mode of KServiceTypeProfile, in which all/all and all/allfiles are excluded from the results of the queries. It is meant for the configuration module _only_.


configurationMode

public static boolean configurationMode()

addService

protected void addService(java.lang.String _service,
                          int _preference,
                          boolean _allow_as_default)
Add a service to this profile.

Parameters:
_service - the name of the service
_preference - the user's preference value, must be positive, bigger is better
_allow_as_default - true if the service should be used as default

addService

protected void addService(java.lang.String _service,
                          int _preference)

addService

protected void addService(java.lang.String _service)

finalize

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

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

dispose

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


isDisposed

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