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.

kbuildservicegroupfactory.h 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* This file is part of the KDE project
  2. Copyright (C) 2000 Waldo Bastian <bastian@kde.org>
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License version 2as published by the Free Software Foundation.
  6. This library is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  9. Library General Public License for more details.
  10. You should have received a copy of the GNU Library General Public License
  11. along with this library; see the file COPYING.LIB. If not, write to
  12. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  13. Boston, MA 02110-1301, USA.
  14. */
  15. #ifndef __k_build_service_group_factory_h__
  16. #define __k_build_service_group_factory_h__
  17. #include <kservicegroupfactory.h>
  18. #include <tqdict.h>
  19. #include <tqstringlist.h>
  20. /**
  21. * Service group factory for building tdesycoca
  22. * @internal
  23. */
  24. class KBuildServiceGroupFactory : public KServiceGroupFactory
  25. {
  26. public:
  27. /**
  28. * Create factory
  29. */
  30. KBuildServiceGroupFactory();
  31. virtual ~KBuildServiceGroupFactory();
  32. /**
  33. * Create new entry.
  34. */
  35. virtual KServiceGroup * createEntry(const TQString &, const char *);
  36. virtual KServiceGroup * createEntry(int) { assert(0); return 0L; }
  37. /**
  38. * Adds the entry @p newEntry to the menu @p menuName
  39. */
  40. void addNewEntryTo( const TQString &menuName, KService *newEntry);
  41. /**
  42. * Adds the entry @p newEntry to the "parent group" @p parent, creating
  43. * the group if necassery.
  44. * A "parent group" is a group of services that all have the same
  45. * "X-TDE-ParentApp".
  46. */
  47. KServiceGroup *addNewChild( const TQString &parent, const char *resource, KSycocaEntry *newEntry);
  48. /**
  49. * Add new menu @p menuName defined by @p file
  50. * When @p entry is non-null it is re-used, otherwise a new group is created.
  51. * A pointer to the group is returned.
  52. */
  53. KServiceGroup *addNew( const TQString &menuName, const TQString& file, KServiceGroup *entry, bool isDeleted);
  54. /**
  55. * Add a new menu entry
  56. */
  57. virtual void addEntry( KSycocaEntry *newEntry, const char *resource );
  58. /**
  59. * Write out servicegroup specific index files.
  60. */
  61. virtual void save(TQDataStream &str);
  62. /**
  63. * Write out header information
  64. */
  65. virtual void saveHeader(TQDataStream &str);
  66. /**
  67. * Returns all resource types for this service factory
  68. */
  69. static TQStringList resourceTypes();
  70. };
  71. #endif