NepomukDaemons
servicecontrol.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 _NEPOMUK_SERVICE_CONTROL_H_ 00020 #define _NEPOMUK_SERVICE_CONTROL_H_ 00021 00022 #include <QtCore/QObject> 00023 00024 #include <KService> 00025 00026 namespace Nepomuk { 00027 class ServiceControl : public QObject 00028 { 00029 Q_OBJECT 00030 00031 public: 00032 ServiceControl( const QString& serviceName, const KService::Ptr& service, QObject* parent = 0 ); 00033 ~ServiceControl(); 00034 00035 static QString dbusServiceName( const QString& serviceName ); 00036 00037 enum Errors { 00038 ErrorUnknownServiceName = -9, 00039 ErrorServiceAlreadyRunning = -10, 00040 ErrorFailedToStart = -11, 00041 ErrorMissingDependency = -12 00042 }; 00043 00044 Q_SIGNALS: 00045 void serviceInitialized( bool success ); 00046 00047 public Q_SLOTS: 00048 void start(); 00049 void setServiceInitialized( bool success ); 00050 bool isInitialized() const; 00051 void shutdown(); 00052 00053 private: 00054 QString m_serviceName; 00055 KService::Ptr m_service; 00056 bool m_initialized; 00057 }; 00058 } 00059 00060 #endif