make designMode property available from js
[kdelibs.git] / kded / kbuildsycoca.h
blob87ff6fdebe74650de7da99e7e6fc71efc2045cfe
1 /* This file is part of the KDE libraries
2 * Copyright (C) 1999 David Faure <faure@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 version 2 as published by the Free Software Foundation;
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.
13 * You should have received a copy of the GNU Library General Public License
14 * along with this library; see the file COPYING.LIB. If not, write to
15 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 **/
18 #ifndef KDED_KBUILDSYCOCA_H
19 #define KDED_KBUILDSYCOCA_H
21 #include <sys/stat.h>
23 #include <QtCore/QObject>
24 #include <QtCore/QString>
26 #include <kservice.h>
27 #include <ksycoca.h>
28 #include <ksycocatype.h>
29 #include <ksycocaentry.h>
30 #include <kservicegroup.h>
32 #include "vfolder_menu.h"
34 class QDataStream;
36 // No need for this in libkio - apps only get readonly access
37 class KBuildSycoca : public KSycoca
39 Q_OBJECT
40 public:
41 KBuildSycoca();
42 virtual ~KBuildSycoca();
44 /**
45 * Recreate the database file
47 bool recreate();
49 static bool checkTimestamps( quint32 timestamp, const QStringList &dirs );
51 static QStringList existingResourceDirs();
53 void setTrackId(const QString &id) { m_trackId = id; }
55 protected Q_SLOTS:
56 void slotCreateEntry(const QString &file, KService::Ptr *entry);
58 protected:
60 /**
61 * Look up gnome mimetypes.
63 void processGnomeVfs();
65 /**
66 * Add single entry to the sycoca database.
67 * Either from a previous database or regenerated from file.
69 KSycocaEntry::Ptr createEntry(const QString &file, bool addToFactory);
71 /**
72 * Convert a VFolderMenu::SubMenu to KServiceGroups.
74 void createMenu(const QString &caption, const QString &name, VFolderMenu::SubMenu *menu);
76 /**
77 * Build the whole system cache, from .desktop files
79 bool build();
81 /**
82 * Save the ksycoca file
84 void save();
86 /**
87 * Clear the factories
89 void clear();
91 static bool checkDirTimestamps( const QString& dir, const QDateTime& stamp, bool top );
93 /**
94 * @internal
95 * @return true if building (i.e. if a KBuildSycoca);
97 virtual bool isBuilding() { return true; }
99 QStringList m_allResourceDirs;
100 QString m_trackId;
103 #endif