//
//     Copyright 2008 Simon Edwards <simon@simonzone.com>

//                 Generated by twine

// This file is part of PyKDE4.

// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.

// PyKDE4 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.


%ModuleHeaderCode
//ctscc
#include <soprano/filtermodel.h>
#include <soprano/model.h>
#include <soprano/nrlmodel.h>
#include <soprano/pluginmanager.h>
#include <soprano/rdfschemamodel.h>
#include <soprano/storagemodel.h>
%End

namespace Soprano
{

class Model : QObject, Soprano::Error::ErrorCache
{
%TypeHeaderCode
#include <soprano/model.h>
%End


public:
    virtual Soprano::Error::ErrorCode  addStatement (const Soprano::Statement& statement) = 0;
    Soprano::Error::ErrorCode  addStatement (const Soprano::Node& subject, const Soprano::Node& predicate, const Soprano::Node& object, const Soprano::Node& context = Soprano::Node());
    Soprano::Error::ErrorCode  addStatements (const QList<Soprano::Statement>& statements);
    virtual Soprano::Error::ErrorCode  removeStatement (const Soprano::Statement& statement) = 0;
    Soprano::Error::ErrorCode  removeStatement (const Soprano::Node& subject, const Soprano::Node& predicate, const Soprano::Node& object, const Soprano::Node& context = Soprano::Node());
    virtual Soprano::Error::ErrorCode  removeAllStatements (const Soprano::Statement& statement) = 0;
    Soprano::Error::ErrorCode  removeAllStatements (const Soprano::Node& subject, const Soprano::Node& predicate, const Soprano::Node& object, const Soprano::Node& context = Soprano::Node());
    Soprano::Error::ErrorCode  removeStatements (const QList<Soprano::Statement>& statements);
    Soprano::Error::ErrorCode  removeContext (const Soprano::Node&);
    Soprano::Error::ErrorCode  removeAllStatements ();
    virtual Soprano::StatementIterator  listStatements (const Soprano::Statement& partial) const = 0;
    Soprano::StatementIterator  listStatements (const Soprano::Node& subject, const Soprano::Node& predicate, const Soprano::Node& object, const Soprano::Node& context = Soprano::Node()) const;
    Soprano::StatementIterator  listStatements () const;
    Soprano::StatementIterator  listStatementsInContext (const Soprano::Node& context) const;
    virtual Soprano::NodeIterator  listContexts () const = 0;
    virtual Soprano::QueryResultIterator  executeQuery (const QString& query, Soprano::Query::QueryLanguage language, const QString& userQueryLanguage = QString()) const = 0;
    virtual bool            containsAnyStatement (const Soprano::Statement& statement) const = 0;
    bool                    containsAnyStatement (const Soprano::Node& subject, const Soprano::Node& predicate, const Soprano::Node& object, const Soprano::Node& context = Soprano::Node()) const;
    virtual bool            containsStatement (const Soprano::Statement& statement) const = 0;
    bool                    containsStatement (const Soprano::Node& subject, const Soprano::Node& predicate, const Soprano::Node& object, const Soprano::Node& context = Soprano::Node()) const;
    bool                    containsContext (const Soprano::Node& context) const;
    virtual bool            isEmpty () const = 0;
    virtual int             statementCount () const = 0;
    virtual Soprano::Error::ErrorCode  write (QTextStream& os) const;
    virtual Soprano::Node   createBlankNode () = 0;

signals:
    void                    statementsAdded ();
    void                    statementsRemoved ();
    void                    statementAdded (const Soprano::Statement& statement);
    void                    statementRemoved (const Soprano::Statement& statement);

protected:
                            Model ();

private:
                            Model (const Soprano::Model&);

public:

//  Subclasses of QObject

%ConvertToSubClassCode

    sipClass = NULL;

    if (dynamic_cast<Soprano::Model*>(sipCpp))
        {
            sipClass = sipClass_Soprano_Model;
            if (dynamic_cast<Soprano::FilterModel*>(sipCpp))
                {
                    sipClass = sipClass_Soprano_FilterModel;
                    if (dynamic_cast<Soprano::NRLModel*>(sipCpp))
                        sipClass = sipClass_Soprano_NRLModel;
//                    else if (dynamic_cast<Soprano::RdfSchemaModel*>(sipCpp))
//                        sipClass = sipClass_Soprano_RdfSchemaModel;
                }
            else if (dynamic_cast<Soprano::StorageModel*>(sipCpp))
                {
                    sipClass = sipClass_Soprano_StorageModel;
                }
        }
    else if (dynamic_cast<Soprano::PluginManager*>(sipCpp))
        sipClass = sipClass_Soprano_PluginManager;
%End

};   // Model

};   // Soprano


