1 | /* This file is part of the KDE project |
2 | Copyright (C) 1999 David Faure <faure@kde.org> |
3 | |
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 | |
9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 | Boston, MA 02110-1301, USA. |
18 | */ |
19 | |
20 | #ifndef KDED_KBUILD_SERVICE_TYPE_FACTORY_H |
21 | #define KDED_KBUILD_SERVICE_TYPE_FACTORY_H |
22 | |
23 | #include <kservicetypefactory.h> |
24 | #include <QtCore/QStringList> |
25 | |
26 | /** |
27 | * Service-type factory for building ksycoca |
28 | * @internal |
29 | */ |
30 | class KBuildServiceTypeFactory : public KServiceTypeFactory |
31 | { |
32 | public: |
33 | /** |
34 | * Create factory |
35 | */ |
36 | KBuildServiceTypeFactory(); |
37 | |
38 | virtual ~KBuildServiceTypeFactory(); |
39 | |
40 | /** |
41 | * Find a service type in the database file |
42 | * @return a pointer to the servicetype in the memory dict (don't free!) |
43 | */ |
44 | virtual KServiceType::Ptr findServiceTypeByName(const QString &_name); |
45 | |
46 | /** |
47 | * Construct a KServiceType from a config file. |
48 | */ |
49 | virtual KSycocaEntry * createEntry(const QString &file, const char *resource) const; |
50 | |
51 | virtual KServiceType * createEntry( int ) const { assert(0); return 0L; } |
52 | |
53 | /** |
54 | * Add entry |
55 | */ |
56 | virtual void addEntry(const KSycocaEntry::Ptr& newEntry); |
57 | |
58 | /** |
59 | * Write out service type specific index files. |
60 | */ |
61 | virtual void save(QDataStream &str); |
62 | |
63 | /** |
64 | * Write out header information |
65 | * |
66 | * Don't forget to call the parent first when you override |
67 | * this function. |
68 | */ |
69 | virtual void (QDataStream &str); |
70 | |
71 | /** |
72 | * Returns all resource types for this factory |
73 | */ |
74 | static QStringList resourceTypes(); |
75 | }; |
76 | |
77 | #endif |
78 | |