kexi
kexiaction.cpp
00001 /*************************************************************************** 00002 * This file is part of the KDE project 00003 * copyright (C) 2006 by Sebastian Sauer (mail@dipe.org) 00004 * copyright (C) 2006 by Bernd Steindorff (bernd@itii.de) 00005 * copyright (C) 2006 by Sascha Kupper (kusato@kfnv.de) 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Library General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this program; see the file COPYING. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 ***************************************************************************/ 00020 00021 #include "kexiaction.h" 00022 #include "../lib/exception.h" 00023 00024 #include <ksharedptr.h> 00025 00026 using namespace KexiMacro; 00027 00028 KexiAction::KexiAction(const QString& name, const QString& text) 00029 : KoMacro::Action(name) 00030 { 00031 m_mainwin = dynamic_cast< KexiMainWindow* >( KoMacro::Manager::self()->guiClient() ); 00032 00033 if(! m_mainwin) { 00034 throw KoMacro::Exception("Invalid KexiMainWindow instance."); 00035 } 00036 00037 // Set the caption this action has. 00038 setText(text); 00039 } 00040 00041 KexiAction::~KexiAction() 00042 { 00043 } 00044 00045 KexiMainWindow* KexiAction::mainWin() const 00046 { 00047 return m_mainwin; 00048 }