• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KServiceFactory Class Reference

#include <kservicefactory.h>

Inheritance diagram for KServiceFactory:
Inheritance graph
[legend]

Public Member Functions

 KServiceFactory ()
 
virtual ~KServiceFactory ()
 
KService::List allServices ()
 
virtual KSycocaEntry * createEntry (const QString &, const char *) const
 
virtual KService::Ptr findServiceByDesktopName (const QString &_name)
 
virtual KService::Ptr findServiceByDesktopPath (const QString &_name)
 
virtual KService::Ptr findServiceByMenuId (const QString &_menuId)
 
KService::Ptr findServiceByName (const QString &_name)
 
bool hasOffer (int serviceTypeOffset, int serviceOffersOffset, int testedServiceOffset)
 
KServiceOfferList offers (int serviceTypeOffset, int serviceOffersOffset)
 
KService::List serviceOffers (int serviceTypeOffset, int serviceOffersOffset)
 
- Public Member Functions inherited from KSycocaFactory
virtual ~KSycocaFactory ()
 
virtual void addEntry (const KSycocaEntry::Ptr &newEntry)
 
virtual KSycocaEntry::List allEntries () const
 
KSycocaEntryDict * entryDict ()
 
virtual KSycocaFactoryId factoryId () const =0
 
bool isEmpty () const
 
int offset () const
 
void removeEntry (const QString &entryName)
 
const KSycocaResourceList * resourceList () const
 
virtual void save (QDataStream &str)
 
virtual void saveHeader (QDataStream &str)
 
const KSycocaDict * sycocaDict () const
 

Static Public Member Functions

static KServiceFactory * self ()
 

Protected Member Functions

virtual KService * createEntry (int offset) const
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from KSycocaFactory
 KSycocaFactory (KSycocaFactoryId factory_id)
 
QDataStream * stream () const
 

Protected Attributes

KSycocaDict * m_menuIdDict
 
int m_menuIdDictOffset
 
KSycocaDict * m_nameDict
 
int m_nameDictOffset
 
int m_offerListOffset
 
KSycocaDict * m_relNameDict
 
int m_relNameDictOffset
 
- Protected Attributes inherited from KSycocaFactory
KSycocaEntryDict * m_entryDict
 
KSycocaResourceList * m_resourceList
 

Additional Inherited Members

- Related Functions inherited from KSycocaFactory
enum  KSycocaFactoryId
 

Detailed Description

A sycoca factory for services (e.g. applications) It loads the services from parsing directories (e.g. prefix/share/applications/) but can also create service from data streams or single config files

Exported for kbuildsycoca, but not installed.

Definition at line 41 of file kservicefactory.h.

Constructor & Destructor Documentation

KServiceFactory::KServiceFactory ( )

Create factory.

Definition at line 34 of file kservicefactory.cpp.

KServiceFactory::~KServiceFactory ( )
virtual

Definition at line 72 of file kservicefactory.cpp.

Member Function Documentation

KService::List KServiceFactory::allServices ( )
Returns
all services. Very memory consuming, avoid using.

Definition at line 195 of file kservicefactory.cpp.

virtual KSycocaEntry* KServiceFactory::createEntry ( const QString &  ,
const char *   
) const
inlinevirtual

Construct a KService from a config file.

Implements KSycocaFactory.

Definition at line 54 of file kservicefactory.h.

KService * KServiceFactory::createEntry ( int  offset) const
protectedvirtual

Read an entry from the database.

Implements KSycocaFactory.

Definition at line 174 of file kservicefactory.cpp.

KService::Ptr KServiceFactory::findServiceByDesktopName ( const QString &  _name)
virtual

Find a service (by desktop file name, e.g.

"konsole")

Definition at line 107 of file kservicefactory.cpp.

KService::Ptr KServiceFactory::findServiceByDesktopPath ( const QString &  _name)
virtual

Find a service ( by desktop path, e.g.

"System/konsole.desktop")

Definition at line 127 of file kservicefactory.cpp.

KService::Ptr KServiceFactory::findServiceByMenuId ( const QString &  _menuId)
virtual

Find a service ( by menu id, e.g.

"kde-konsole.desktop")

Definition at line 154 of file kservicefactory.cpp.

KService::Ptr KServiceFactory::findServiceByName ( const QString &  _name)

Find a service (by translated name, e.g.

"Terminal") (Not virtual because not used inside kbuildsycoca4, only an external service for some KDE apps)

Definition at line 86 of file kservicefactory.cpp.

bool KServiceFactory::hasOffer ( int  serviceTypeOffset,
int  serviceOffersOffset,
int  testedServiceOffset 
)

Test if a specific service is associated with a specific servicetype.

Parameters
serviceTypeOffsetthe offset of the service type being tested
serviceOffersOffsetallows to jump to the right entries for the service type directly.
testedServiceOffsetthe offset of the service being tested

Definition at line 280 of file kservicefactory.cpp.

QList< KServiceOffer > KServiceFactory::offers ( int  serviceTypeOffset,
int  serviceOffersOffset 
)
Returns
the services supporting the given service type The serviceOffersOffset allows to jump to the right entries directly.

Definition at line 209 of file kservicefactory.cpp.

KServiceFactory * KServiceFactory::self ( )
static
Returns
the unique service factory, creating it if necessary

Definition at line 81 of file kservicefactory.cpp.

KService::List KServiceFactory::serviceOffers ( int  serviceTypeOffset,
int  serviceOffersOffset 
)
Returns
the services supporting the given service type; without information about initialPreference The serviceOffersOffset allows to jump to the right entries directly.

Definition at line 245 of file kservicefactory.cpp.

void KServiceFactory::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Virtual hook, used to add new "virtual" functions while maintaining binary compatibility.

Unused in this class.

Reimplemented from KSycocaFactory.

Definition at line 312 of file kservicefactory.cpp.

Member Data Documentation

KSycocaDict* KServiceFactory::m_menuIdDict
protected

Definition at line 117 of file kservicefactory.h.

int KServiceFactory::m_menuIdDictOffset
protected

Definition at line 118 of file kservicefactory.h.

KSycocaDict* KServiceFactory::m_nameDict
protected

Definition at line 113 of file kservicefactory.h.

int KServiceFactory::m_nameDictOffset
protected

Definition at line 114 of file kservicefactory.h.

int KServiceFactory::m_offerListOffset
protected

Definition at line 112 of file kservicefactory.h.

KSycocaDict* KServiceFactory::m_relNameDict
protected

Definition at line 115 of file kservicefactory.h.

int KServiceFactory::m_relNameDictOffset
protected

Definition at line 116 of file kservicefactory.h.


The documentation for this class was generated from the following files:
  • kservicefactory.h
  • kservicefactory.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal