/*
    This file is part of kenvy24 KDE multimedia utility
    Copyright (c) 2007  Valentin RUSU kenvy24@rusu.info

    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) version 3 or, at the discretion of KDE e.V. (which shall
    act as a proxy as in section 14 of the GPLv3), 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, see <http://www.gnu.org/licenses/>.
*/

#ifndef KENVY24PART_H_INCLUDED
#define KENVY24PART_H_INCLUDED

#include <QWidget>
#include <QApplication>

#include <kparts/partmanager.h>
#include <kdebug.h>
#include <kmessagebox.h>
#include <klibloader.h>

#include "kenvy24partbase.h"
#include "kenvy24partwidget.h"

template <class UI>
class KEnvy24Part : public KEnvy24PartBase
{
protected:
    UI*  uiBuilder;
    KEnvy24PartWidget*    ui;

public:
    KEnvy24Part( QWidget* parentWidget, QObject* parent, const char* name ) :
        KEnvy24PartBase( parent, name ),
        uiBuilder(0),
        ui(0)
    {
        kDebug() << name << " is being constructed";

        KGlobal::locale()->insertCatalog( name );

        ui = new KEnvy24PartWidget( parentWidget, this );
        uiBuilder = new UI();
        uiBuilder->setupUi( ui );
        setWidget( ui );
    }

    virtual ~KEnvy24Part()
    {
        if ( uiBuilder )
            delete uiBuilder, uiBuilder = 0;
    }

};

#endif // KENVY24PART_H_INCLUDED
// kate: space-indent on; indent-width 4; replace-tabs on;
