• 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 | Protected Attributes | List of all members
KServiceType Class Reference

#include <kservicetype.h>

Inheritance diagram for KServiceType:
KMimeType KDEDesktopMimeType KExecMimeType KFolderType

Public Types

typedef TDESharedPtr< KServiceType > Ptr
 
typedef TQValueList< Ptr > List
 

Public Member Functions

 KServiceType (const TQString &_fullpath, const TQString &_name, const TQString &_icon, const TQString &_comment)
 
 KServiceType (const TQString &_fullpath)
 
 KServiceType (KDesktopFile *config)
 
 KServiceType (TQDataStream &_str, int offset)
 
TQString icon () const
 
TQString comment () const
 
TQString name () const
 
TQString desktopEntryPath () const
 
bool isDerived () const
 
TQString parentServiceType () const
 
bool inherits (const TQString &servTypeName) const
 
virtual TQVariant property (const TQString &_name) const
 
virtual TQStringList propertyNames () const
 
bool isValid () const
 
virtual TQVariant::Type propertyDef (const TQString &_name) const
 
virtual TQStringList propertyDefNames () const
 
virtual const TQMap< TQString, TQVariant::Type > & propertyDefs () const
 
virtual void save (TQDataStream &)
 
virtual void load (TQDataStream &)
 
Ptr parentType ()
 
void addService (KService::Ptr service)
 
KService::List services ()
 

Static Public Member Functions

static Ptr serviceType (const TQString &_name)
 
static KService::List offers (const TQString &_servicetype)
 
static List allServiceTypes ()
 

Protected Member Functions

void init (KDesktopFile *config)
 
virtual void virtual_hook (int id, void *data)
 

Protected Attributes

TQString m_strName
 
TQString m_strIcon
 
TQString m_strComment
 
TQStringVariantMap m_mapProps
 
TQMap< TQString, TQVariant::Type > m_mapPropDefs
 
bool m_bValid:1
 
bool m_bDerived:1
 

Detailed Description

A service type is the generic notion for a mimetype, a type of service instead of a type of file.

For instance, KOfficeFilter is a service type. It is associated to services according to the user profile (kuserprofile.h). Service types are stored as desktop files in $TDEHOME/share/servicetypes.

See also
KService

Definition at line 45 of file kservicetype.h.

Constructor & Destructor Documentation

◆ KServiceType() [1/3]

KServiceType::KServiceType ( const TQString &  _fullpath,
const TQString &  _name,
const TQString &  _icon,
const TQString &  _comment 
)

Constructor.

You may pass in arguments to create a servicetype with specific properties.

Parameters
_fullpaththe path of the service type's desktop file
_namethe name of the service type
_iconthe icon name of the service type (can be null)
_commenta comment (can be null)

Definition at line 106 of file kservicetype.cpp.

◆ KServiceType() [2/3]

KServiceType::KServiceType ( const TQString &  _fullpath)

Construct a service type and take all informations from a config file.

Parameters
_fullpathpath of the desktop file, set to "" if calling from a inherited constructor.

Definition at line 40 of file kservicetype.cpp.

◆ KServiceType() [3/3]

KServiceType::KServiceType ( KDesktopFile *  config)

Construct a service type and take all informations from a deskop file.

Parameters
configthe configuration file

Definition at line 48 of file kservicetype.cpp.

Member Function Documentation

◆ allServiceTypes()

KServiceType::List KServiceType::allServiceTypes ( )
static

Returns a list of all the supported servicetypes.

Useful for showing the list of available servicetypes in a listbox, for example. More memory consuming than the ones above, don't use unless really necessary.

Returns
the list of all services

Definition at line 317 of file kservicetype.cpp.

◆ comment()

TQString KServiceType::comment ( ) const
inline

Returns the descriptive comment associated, if any.

Returns
the comment, or TQString::null

Definition at line 100 of file kservicetype.h.

◆ desktopEntryPath()

TQString KServiceType::desktopEntryPath ( ) const
inline

Returns the relative path to the desktop entry file responsible for this servicetype.

For instance inode/directory.desktop, or kpart.desktop

Returns
the path of the desktop file

Definition at line 114 of file kservicetype.h.

◆ icon()

TQString KServiceType::icon ( ) const
inline

Returns the icon associated with this service type.

Some derived classes offer special functions which take for example an URL and returns a special icon for this URL. An example is KMimeType, KFolderType and others.

Returns
the name of the icon, can be TQString::null.

Definition at line 94 of file kservicetype.h.

◆ inherits()

bool KServiceType::inherits ( const TQString &  servTypeName) const

Checks whether this service type is or inherits from servTypeName.

Returns
true if this servicetype is or inherits from servTypeName
Since
3.1

Definition at line 154 of file kservicetype.cpp.

◆ isDerived()

bool KServiceType::isDerived ( ) const
inline

Checks whether this service type inherits another one.

Returns
true if this service type inherits another one
See also
parentServiceType()

Definition at line 121 of file kservicetype.h.

◆ isValid()

bool KServiceType::isValid ( ) const
inline

Checks whether the service type is valid.

Returns
true if the service is valid (e.g. name is not empty)

Definition at line 158 of file kservicetype.h.

◆ name()

TQString KServiceType::name ( ) const
inline

Returns the name of this service type.

Returns
the name of the service type

Definition at line 106 of file kservicetype.h.

◆ offers()

KService::List KServiceType::offers ( const TQString &  _servicetype)
static

Returns all services supporting the given servicetype name.

This doesn't take care of the user profile. In fact it is used by KServiceTypeProfile, which is used by TDETrader, and that's the one you should use.

Parameters
_servicetypethe name of the service type to search
Returns
the list of all services of the given type

Definition at line 248 of file kservicetype.cpp.

◆ parentServiceType()

TQString KServiceType::parentServiceType ( ) const

If this service type inherits from another service type, return the name of the parent.

Returns
the parent service type, or TQString:: null if not set
See also
isDerived()

Definition at line 148 of file kservicetype.cpp.

◆ property()

TQVariant KServiceType::property ( const TQString &  _name) const
virtual

Returns the requested property.

Some often used properties have convenience access functions like name(), comment() etc.

Parameters
_namethe name of the property
Returns
the property, or invalid if not found

Reimplemented in KMimeType.

Definition at line 171 of file kservicetype.cpp.

◆ propertyDef()

TQVariant::Type KServiceType::propertyDef ( const TQString &  _name) const
virtual

Returns the type of the property with the given _name.

Parameters
_namethe name of the property
Returns
the property type, or null if not found

Definition at line 207 of file kservicetype.cpp.

◆ propertyNames()

TQStringList KServiceType::propertyNames ( ) const
virtual

Returns the list of all properties of this service type.

Returns
the list of properties

Reimplemented in KMimeType.

Definition at line 191 of file kservicetype.cpp.

◆ serviceType()

KServiceType::Ptr KServiceType::serviceType ( const TQString &  _name)
static

Returns a pointer to the servicetype '_name' or 0L if the service type is unknown.

VERY IMPORTANT : don't store the result in a KServiceType * !

Parameters
_namethe name of the service type to search
Returns
the pointer to the service type, or 0

Definition at line 227 of file kservicetype.cpp.


The documentation for this class was generated from the following files:
  • kservicetype.h
  • kservicetype.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.1
This website is maintained by Timothy Pearson.