• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KServiceTypeProfile Class Reference

#include <kuserprofile.h>

Public Types

typedef TQValueList< KServiceOffer > OfferList
 

Public Member Functions

int preference (const TQString &_service) const
 
bool allowAsDefault (const TQString &_service) const
 
OfferList offers () const
 

Static Public Member Functions

static KService::Ptr preferredService (const TQString &serviceType, const TQString &genericServiceType)
 
static KServiceTypeProfile * serviceTypeProfile (const TQString &servicetype, const TQString &genericServiceType=TQString::null)
 
static OfferList offers (const TQString &servicetype, const TQString &genericServiceType=TQString::null)
 
static const TQPtrList< KServiceTypeProfile > & serviceTypeProfiles ()
 
static void clear ()
 
static void setConfigurationMode ()
 
static void unsetConfigurationMode ()
 
static bool configurationMode ()
 

Protected Member Functions

 KServiceTypeProfile (const TQString &serviceType, const TQString &genericServiceType=TQString::null)
 
void addService (const TQString &_service, int _preference=1, bool _allow_as_default=true)
 

Detailed Description

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. TDETrader uses KServiceTypeProfile to sort its results, so usually you can just use TDETrader to find the user's preferred service.

See also
KService
KServiceType
KServiceOffer
TDETrader

Represents the user's preferences for services of a service type

Definition at line 117 of file kuserprofile.h.

Member Typedef Documentation

◆ OfferList

typedef TQValueList<KServiceOffer> KServiceTypeProfile::OfferList

Definition at line 120 of file kuserprofile.h.

Constructor & Destructor Documentation

◆ ~KServiceTypeProfile()

KServiceTypeProfile::~KServiceTypeProfile ( )

Definition at line 202 of file kuserprofile.cpp.

◆ KServiceTypeProfile()

KServiceTypeProfile::KServiceTypeProfile ( const TQString &  serviceType,
const TQString &  genericServiceType = TQString::null 
)
protected

Constructor is called when the user profile is read for the first time.

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

Definition at line 194 of file kuserprofile.cpp.

Member Function Documentation

◆ addService()

void KServiceTypeProfile::addService ( const TQString &  _service,
int  _preference = 1,
bool  _allow_as_default = true 
)
protected

Add a service to this profile.

Parameters
_servicethe name of the service
_preferencethe user's preference value, must be positive, bigger is better
_allow_as_defaulttrue if the service should be used as default

Definition at line 206 of file kuserprofile.cpp.

◆ allowAsDefault()

bool KServiceTypeProfile::allowAsDefault ( const TQString &  _service) const
Deprecated:
Remove in KDE 4, unused. Checks whether the given _service can be used as default.
Parameters
_servicethe name of the service to check
Returns
true if allowed as default

Definition at line 225 of file kuserprofile.cpp.

◆ clear()

void KServiceTypeProfile::clear ( )
static

Clear all cached information.

Definition at line 99 of file kuserprofile.cpp.

◆ configurationMode()

static bool KServiceTypeProfile::configurationMode ( )
inlinestatic

Definition at line 220 of file kuserprofile.h.

◆ offers() [1/2]

KServiceTypeProfile::OfferList KServiceTypeProfile::offers ( ) const

Returns the list of all service offers for the service types that are represented by this profile.

Returns
the list of KServiceOffer instances

Definition at line 260 of file kuserprofile.cpp.

◆ offers() [2/2]

KServiceTypeProfile::OfferList KServiceTypeProfile::offers ( const TQString &  servicetype,
const TQString &  genericServiceType = TQString::null 
)
static

Returns the offers associated with a given servicetype, sorted by preference.

This is what TDETrader uses to get the list of offers, before applying the constraints and preferences.

If genericServiceType is specified, a list is returned with the offers associated with the combination of the two service types. This is almost like an "foo in ServiceTypes" constraint in the TDETrader, but the difference is that to order the offers, we will look at entries specifically for those two service types. Typically, this is used for getting the list of embeddable components that can handle a given mimetype. In that case, servicetype is the mimetype and genericServiceType is "KParts/ReadOnlyPart".

Parameters
servicetypethe service type (e.g. a MIME type)
genericServiceTypethe generic service type (e.g. "Application" or "KParts/ReadOnlyPart"). Can be TQString::null, then all generic types will be included
Returns
the list of offers witht he given parameters

Definition at line 110 of file kuserprofile.cpp.

◆ preference()

int KServiceTypeProfile::preference ( const TQString &  _service) const
Deprecated:
Remove in KDE 4, unused. Returns the users preference of the given service.
Parameters
_servicethe name of the service to check
Returns
the user's preference number of the given _service, or 0 the service is unknown.

Definition at line 213 of file kuserprofile.cpp.

◆ preferredService()

KService::Ptr KServiceTypeProfile::preferredService ( const TQString &  serviceType,
const TQString &  genericServiceType 
)
static

Returns the preferred service for _serviceType and _genericServiceType ("Application", type of component, or null).

Parameters
serviceTypethe service type (e.g. a MIME type)
genericServiceTypethe generic service type (e.g. "Application" or "KParts/ReadOnlyPart")
Returns
the preferred service, or 0 if no service is available

Definition at line 303 of file kuserprofile.cpp.

◆ serviceTypeProfile()

KServiceTypeProfile * KServiceTypeProfile::serviceTypeProfile ( const TQString &  servicetype,
const TQString &  genericServiceType = TQString::null 
)
static

Returns the profile for the requested service type.

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

Definition at line 243 of file kuserprofile.cpp.

◆ serviceTypeProfiles()

static const TQPtrList< KServiceTypeProfile > & KServiceTypeProfile::serviceTypeProfiles ( )
inlinestatic

Returns a list of all KServiceTypeProfiles.

Returns
a list of all KServiceTypeProfiles

Definition at line 194 of file kuserprofile.h.

◆ setConfigurationMode()

static void KServiceTypeProfile::setConfigurationMode ( )
inlinestatic

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.

Definition at line 207 of file kuserprofile.h.

◆ unsetConfigurationMode()

static void KServiceTypeProfile::unsetConfigurationMode ( )
inlinestatic

This method deactivates the special mode above of KServiceTypeProfile It is meant for the configuration module only.

Definition at line 215 of file kuserprofile.h.


The documentation for this class was generated from the following files:
  • kuserprofile.h
  • kuserprofile.cpp

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.4
This website is maintained by Timothy Pearson.