TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kbuildservicefactory.h 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* This file is part of the KDE project
  2. Copyright (C) 1999 David Faure <faure@kde.org>
  3. 1999 Waldo Bastian <bastian@kde.org>
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef __k_build_service_factory_h__
  18. #define __k_build_service_factory_h__
  19. #include <tqptrdict.h>
  20. #include <tqstringlist.h>
  21. #include <kservicefactory.h>
  22. // We export the services to the service group factory!
  23. #include <kbuildservicegroupfactory.h>
  24. /**
  25. * Service factory for building tdesycoca
  26. * @internal
  27. */
  28. class KBuildServiceFactory : public KServiceFactory
  29. {
  30. public:
  31. /**
  32. * Create factory
  33. */
  34. KBuildServiceFactory( KSycocaFactory *serviceTypeFactory,
  35. KBuildServiceGroupFactory *serviceGroupFactory );
  36. virtual ~KBuildServiceFactory();
  37. KService *findServiceByName(const TQString &_name);
  38. /**
  39. * Construct a KService from a config file.
  40. */
  41. virtual KSycocaEntry * createEntry(const TQString &file, const char *resource);
  42. virtual KService * createEntry( int ) { assert(0); return 0L; }
  43. /**
  44. * Add a new entry.
  45. */
  46. void addEntry(KSycocaEntry *newEntry, const char *resource);
  47. /**
  48. * Write out service specific index files.
  49. */
  50. virtual void save(TQDataStream &str);
  51. /**
  52. * Write out header information
  53. *
  54. * Don't forget to call the parent first when you override
  55. * this function.
  56. */
  57. virtual void saveHeader(TQDataStream &str);
  58. /**
  59. * Returns all resource types for this service factory
  60. */
  61. static TQStringList resourceTypes();
  62. private:
  63. void saveOfferList(TQDataStream &str);
  64. void saveInitList(TQDataStream &str);
  65. TQDict<KService> m_serviceDict;
  66. TQPtrDict<KService> m_dupeDict;
  67. KSycocaFactory *m_serviceTypeFactory;
  68. KBuildServiceGroupFactory *m_serviceGroupFactory;
  69. };
  70. #endif