krita

kis_tool.cc

00001 /*
00002  *  Copyright (c) 2002, 2003 Patrick Julien <freak@codepimps.org>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #include <qwidget.h>
00020 #include <qstring.h>
00021 #include <kaction.h>
00022 #include <qlabel.h>
00023 
00024 #include <klocale.h>
00025 #include <kdebug.h>
00026 
00027 #include "kis_tool.h"
00028 #include "kis_tool.moc"
00029 
00030 
00031 class KisTool::KisToolPrivate 
00032 {
00033 public:
00034     QString uiname;
00035     QLabel * optionWidget;
00036 };
00037 
00038 KisTool::KisTool(const QString & name)
00039 {
00040     m_action = 0;
00041     m_ownAction = false;
00042     d = new KisToolPrivate();
00043     d->uiname = name;
00044     d->optionWidget = 0;
00045 }
00046 
00047 KisTool::~KisTool()
00048 {
00049     if (m_ownAction) {
00050         delete m_action;
00051         m_action = 0;
00052     }
00053     delete d;
00054 }
00055 
00056 QWidget* KisTool::createOptionWidget(QWidget* parent)
00057 {
00058     
00059     d->optionWidget = new QLabel(i18n("No options for %1.").arg(d->uiname), parent);
00060     d->optionWidget->setCaption(d->uiname);
00061     d->optionWidget->setAlignment(Qt::AlignCenter);
00062     return d->optionWidget;
00063 }
00064 
00065 QWidget* KisTool::optionWidget()
00066 {
00067     return d->optionWidget;
00068 }
00069 
KDE Home | KDE Accessibility Home | Description of Access Keys