/***************************************************************************
 *   Copyright (C) 2004 by Trenton Carr                                    *
 *   trenton.carr@gmail.com                                                *
 *                                                                         *
 *   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.,                                       *
 *   51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.             *
 ***************************************************************************/
 
#include "kmathparabola_part.h"

#include <kcomponentdata.h>

#include "parabolas.h"

KMathParabolaPart::KMathParabolaPart( QWidget *parentWidget, const char *widgetName,
                                  QObject *parent, const char *name )
    : KMathBasePart(parentWidget, widgetName, parent, name)
{
    setInstance( KMathParabolaPartFactory::instance() );

    m_widget = new Parabolas( parentWidget, widgetName );

    setWidget(m_widget);

    setXMLFile("kmathparabola_part.rc");
}


// It's usually safe to leave the factory code alone.. with the
// notable exception of the KAboutData data
#include <kaboutdata.h>
#include <klocale.h>

KInstance*  KMathParabolaPartFactory::s_instance = 0L;
KAboutData* KMathParabolaPartFactory::s_about = 0L;

KMathParabolaPartFactory::KMathParabolaPartFactory()
    : KParts::Factory()
{
}

KMathParabolaPartFactory::~KMathParabolaPartFactory()
{
    delete s_instance;
    delete s_about;

    s_instance = 0L;
}

KParts::Part* KMathParabolaPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
                                                        QObject *parent, const char *name,
                                                        const char *classname, const QStringList &args )
{
    // Create an instance of our Part
    KMathParabolaPart* obj = new KMathParabolaPart( parentWidget, widgetName, parent, name );
    return obj;
}

KInstance* KMathParabolaPartFactory::instance()
{
    if( !s_instance )
    {
        s_about = new KAboutData("kmathparabolapart", I18N_NOOP("KMathParabolaPart"), "0.3");
        s_about->addAuthor("Trenton Carr", 0, "trentoncarr@telkomsa.net");
        s_instance = new KInstance(s_about);
    }
    return s_instance;
}

K_EXPORT_COMPONENT_FACTORY( libkmathparabolapart, KMathParabolaPartFactory )

#include "kmathparabola_part.moc"
