/*
    This file is part of Kaplan
    Copyright (c) 2001 Matthias Hoelzer-Kluepfel <mhk@kde.org>
    Copyright (c) 2002 Daniel Molkentin <molkentin@kde.org>

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

    This program 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, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

// $Id: kpplugin.cpp,v 1.3 2002/08/31 21:35:58 danimo Exp $

#include <dcopclient.h>

#include "kpcore.h"

#include "kpplugin.h"

using namespace Kaplan;

class Plugin::Private
{
public:
	Kaplan::Core *core;
    DCOPClient *dcopClient;
    QCString name;
};


Plugin::Plugin(Kaplan::Core *core, QObject *parent, const char *name)
: QObject(parent, name)
{
	d = new Kaplan::Plugin::Private;
    d->name = name;
	d->core = core;
    d->dcopClient = 0L;
}


Plugin::~Plugin()
{
	delete d;
}


Kaplan::Core *Plugin::core() const
{
	return d->core;
}

DCOPClient * Plugin::dcopClient() const
{
    if (!d->dcopClient)
    {
        d->dcopClient = new DCOPClient();
        d->dcopClient->registerAs(d->name, false);
    }

    return d->dcopClient;
}


#include "kpplugin.moc"

// vim: ts=4 sw=4 et
