server/servercore.h

Go to the documentation of this file.
00001 /* 
00002  * This file is part of Soprano Project.
00003  *
00004  * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public License
00017  * along with this library; see the file COPYING.LIB.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef _SOPRANO_SERVER_CORE_H_
00023 #define _SOPRANO_SERVER_CORE_H_
00024 
00025 #include <QtCore/QObject>
00026 
00027 #include <soprano/error.h>
00028 #include <soprano/soprano_export.h>
00029 
00030 
00031 namespace Soprano {
00032 
00033     class Backend;
00034     class Model;
00035     class BackendSetting;
00036 
00037     namespace Server {
00068         class SOPRANO_SERVER_EXPORT ServerCore : public QObject, public Error::ErrorCache
00069         {
00070             Q_OBJECT
00071 
00072         public:
00073             ServerCore( QObject* parent = 0 );
00074             virtual ~ServerCore();
00075 
00076             static const quint16 DEFAULT_PORT;
00077 
00081             void setBackend( const Backend* backend );
00082 
00086             const Backend* backend() const;
00087 
00095             void setBackendSettings( const QList<BackendSetting>& settings );
00096 
00102             QList<BackendSetting> backendSettings() const;
00103 
00111             virtual Model* model( const QString& name );
00112 
00126             virtual void removeModel( const QString& name );
00127 
00133             virtual QStringList allModels() const;
00134 
00139             bool start( const QString& socketPath = QString() );
00140 
00149             bool listen( quint16 port = DEFAULT_PORT );
00150 
00158             void registerAsDBusObject( const QString& objectPath = QString() );
00159 
00160         private Q_SLOTS:
00161             void slotNewTcpConnection();
00162             void slotNewSocketConnection();
00163             void serverConnectionFinished();
00164 
00165         protected:
00177             // FIXME: 3.0: this method should be const
00178             virtual Model* createModel( const QList<BackendSetting>& settings );
00179 
00180         private:
00181             class Private;
00182             Private* const d;
00183         };
00184     }
00185 }
00186 
00187 #endif

Generated on Fri Mar 7 18:57:44 2008 for Soprano by  doxygen 1.5.4