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

KDED

  • sources
  • kde-4.12
  • kdelibs
  • 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!
30 class KBuildServiceGroupFactory;
31 class KBuildMimeTypeFactory;
32 
37 class KBuildServiceFactory : public KServiceFactory
38 {
39 public:
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 
88 private:
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
KSharedPtr< KService >
KBuildServiceFactory::findServiceByMenuId
virtual KService::Ptr findServiceByMenuId(const QString &menuId)
Reimplemented from KServiceFactory.
Definition: kbuildservicefactory.cpp:80
kmimetype.h
KBuildServiceFactory::~KBuildServiceFactory
virtual ~KBuildServiceFactory()
Definition: kbuildservicefactory.cpp:65
KService
name
const char * name(StandardAction id)
KBuildServiceFactory::createEntry
virtual KSycocaEntry * createEntry(const QString &file, const char *resource) const
Construct a KService from a config file.
Definition: kbuildservicefactory.cpp:85
QString
QHash< QString, KService::Ptr >
KSycocaFactory
KBuildServiceFactory::resourceTypes
static QStringList resourceTypes()
Returns all resource types for this service factory.
Definition: kbuildservicefactory.cpp:60
kservicefactory.h
KOfferHash
Definition: kmimeassociations.h:37
KSycocaEntry
QStringList
KBuildServiceFactory::addEntry
virtual void addEntry(const KSycocaEntry::Ptr &newEntry)
Add a new entry.
Definition: kbuildservicefactory.cpp:381
kmimeassociations.h
KBuildServiceGroupFactory
Service group factory for building ksycoca.
Definition: kbuildservicegroupfactory.h:30
KBuildServiceFactory
Service factory for building ksycoca.
Definition: kbuildservicefactory.h:37
QSet< QString >
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
KBuildMimeTypeFactory
Mime-type factory for building ksycoca.
Definition: kbuildmimetypefactory.h:32
KBuildServiceFactory::findServiceByDesktopName
virtual KService::Ptr findServiceByDesktopName(const QString &name)
Reimplemented from KServiceFactory.
Definition: kbuildservicefactory.cpp:70
KBuildServiceFactory::postProcessServices
void postProcessServices()
Definition: kbuildservicefactory.cpp:192
KBuildServiceFactory::save
virtual void save(QDataStream &str)
Write out service specific index files.
Definition: kbuildservicefactory.cpp:124
KBuildServiceFactory::saveHeader
virtual void saveHeader(QDataStream &str)
Write out header information.
Definition: kbuildservicefactory.cpp:114
KServiceFactory
KBuildServiceFactory::KBuildServiceFactory
KBuildServiceFactory(KSycocaFactory *serviceTypeFactory, KBuildMimeTypeFactory *mimeTypeFactory, KBuildServiceGroupFactory *serviceGroupFactory)
Create factory.
Definition: kbuildservicefactory.cpp:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:13 by doxygen 1.8.7 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 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