NepomukDaemons
servicemanager.h
Go to the documentation of this file.00001 /* This file is part of the KDE Project 00002 Copyright (c) 2008 Sebastian Trueg <trueg@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef _SERVICE_MANAGER_H_ 00020 #define _SERVICE_MANAGER_H_ 00021 00022 #include <QtCore/QObject> 00023 #include <QtDBus/QDBusMessage> 00024 00025 namespace Nepomuk { 00026 00027 class ServiceController; 00028 00034 class ServiceManager : public QObject 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 ServiceManager( QObject* parent = 0 ); 00040 ~ServiceManager(); 00041 00042 static ServiceManager* self() { return s_self; } 00043 static void messageFilter( const QDBusMessage& ); 00044 00050 QStringList runningServices() const; 00051 00059 QStringList availableServices() const; 00060 00065 bool isServiceInitialized( const QString& servicename ) const; 00066 00067 Q_SIGNALS: 00072 void serviceInitialized( const QString& name ); 00073 00074 public Q_SLOTS: 00078 void startAllServices(); 00079 00083 void stopAllServices(); 00084 00089 bool startService( const QString& name ); 00090 00095 bool stopService( const QString& name ); 00096 00101 bool isServiceAutostarted( const QString& name ); 00102 00106 void setServiceAutostarted( const QString& name, bool autostart ); 00107 00108 private: 00109 static ServiceManager* s_self; 00110 00111 class Private; 00112 Private* const d; 00113 00114 Q_PRIVATE_SLOT( d, void _k_serviceInitialized(ServiceController*) ) 00115 }; 00116 } 00117 00118 #endif