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

KDED

  • kded
kbuildservicefactory.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 1999, 2007 David Faure <faure@kde.org>
3 1999 Waldo Bastian <bastian@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KDED_KBUILD_SERVICE_FACTORY_H
22#define KDED_KBUILD_SERVICE_FACTORY_H
23
24#include <QtCore/QStringList>
25
26#include "kmimeassociations.h"
27#include <kmimetype.h>
28#include <kservicefactory.h>
29// We export the services to the service group factory!
30class KBuildServiceGroupFactory;
31class KBuildMimeTypeFactory;
32
37class KBuildServiceFactory : public KServiceFactory
38{
39public:
43 KBuildServiceFactory( KSycocaFactory *serviceTypeFactory,
44 KBuildMimeTypeFactory *mimeTypeFactory,
45 KBuildServiceGroupFactory *serviceGroupFactory );
46
47 virtual ~KBuildServiceFactory();
48
50 virtual KService::Ptr findServiceByDesktopName(const QString &name);
52 virtual KService::Ptr findServiceByDesktopPath(const QString &name);
54 virtual KService::Ptr findServiceByMenuId(const QString &menuId);
55
59 virtual KSycocaEntry * createEntry(const QString &file, const char *resource) const;
60
61 virtual KService * createEntry( int ) const { assert(0); return 0; }
62
66 virtual void addEntry(const KSycocaEntry::Ptr& newEntry);
67
71 virtual void save(QDataStream &str);
72
79 virtual void saveHeader(QDataStream &str);
80
84 static QStringList resourceTypes();
85
86 void postProcessServices();
87
88private:
89 void populateServiceTypes();
90 void saveOfferList(QDataStream &str);
91 void collectInheritedServices();
92 void collectInheritedServices(const QString& mime, QSet<QString>& visitedMimes);
93
94 QHash<QString, KService::Ptr> m_nameMemoryHash; // m_nameDict is not useable while building ksycoca
95 QHash<QString, KService::Ptr> m_relNameMemoryHash; // m_relNameDict is not useable while building ksycoca
96 QHash<QString, KService::Ptr> m_menuIdMemoryHash; // m_menuIdDict is not useable while building ksycoca
97 QSet<KSycocaEntry::Ptr> m_dupeDict;
98
99 KOfferHash m_offerHash;
100
101 KSycocaFactory *m_serviceTypeFactory;
102 KBuildMimeTypeFactory *m_mimeTypeFactory;
103 KBuildServiceGroupFactory *m_serviceGroupFactory;
104};
105
106#endif
KBuildMimeTypeFactory
Mime-type factory for building ksycoca.
Definition: kbuildmimetypefactory.h:33
KBuildServiceFactory
Service factory for building ksycoca.
Definition: kbuildservicefactory.h:38
KBuildServiceFactory::findServiceByDesktopPath
virtual KService::Ptr findServiceByDesktopPath(const QString &name)
Reimplemented from KServiceFactory.
Definition: kbuildservicefactory.cpp:75
KBuildServiceFactory::createEntry
virtual KService * createEntry(int) const
Definition: kbuildservicefactory.h:61
KBuildServiceFactory::resourceTypes
static QStringList resourceTypes()
Returns all resource types for this service factory.
Definition: kbuildservicefactory.cpp:60
KBuildServiceFactory::createEntry
virtual KSycocaEntry * createEntry(const QString &file, const char *resource) const
Construct a KService from a config file.
Definition: kbuildservicefactory.cpp:85
KBuildServiceFactory::findServiceByDesktopName
virtual KService::Ptr findServiceByDesktopName(const QString &name)
Reimplemented from KServiceFactory.
Definition: kbuildservicefactory.cpp:70
KBuildServiceFactory::~KBuildServiceFactory
virtual ~KBuildServiceFactory()
Definition: kbuildservicefactory.cpp:65
KBuildServiceFactory::saveHeader
virtual void saveHeader(QDataStream &str)
Write out header information.
Definition: kbuildservicefactory.cpp:114
KBuildServiceFactory::findServiceByMenuId
virtual KService::Ptr findServiceByMenuId(const QString &menuId)
Reimplemented from KServiceFactory.
Definition: kbuildservicefactory.cpp:80
KBuildServiceFactory::addEntry
virtual void addEntry(const KSycocaEntry::Ptr &newEntry)
Add a new entry.
Definition: kbuildservicefactory.cpp:381
KBuildServiceFactory::postProcessServices
void postProcessServices()
Definition: kbuildservicefactory.cpp:192
KBuildServiceGroupFactory
Service group factory for building ksycoca.
Definition: kbuildservicegroupfactory.h:31
KOfferHash
Definition: kmimeassociations.h:38
KServiceFactory
KService
KSharedPtr< KService >
KSycocaEntry
KSycocaFactory
QHash
QSet
kmimeassociations.h
kmimetype.h
kservicefactory.h
name
const char * name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDED

Skip menu "KDED"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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