kexiaction.cpp
1/***************************************************************************
2 * This file is part of the KDE project
3 * copyright (C) 2006 by Sebastian Sauer (mail@dipe.org)
4 * copyright (C) 2006 by Bernd Steindorff (bernd@itii.de)
5 * copyright (C) 2006 by Sascha Kupper (kusato@kfnv.de)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this program; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 ***************************************************************************/
20
21#include "kexiaction.h"
22#include "../lib/exception.h"
23
24#include <ksharedptr.h>
25
26using namespace KexiMacro;
27
28KexiAction::KexiAction(const TQString& name, const TQString& text)
29 : KoMacro::Action(name)
30{
31 m_mainwin = dynamic_cast< KexiMainWindow* >( KoMacro::Manager::self()->guiClient() );
32
33 if(! m_mainwin) {
34 throw KoMacro::Exception("Invalid KexiMainWindow instance.");
35 }
36
37 // Set the caption this action has.
39}
40
44
46{
47 return m_mainwin;
48}
KexiMainWindow * mainWin() const
virtual ~KexiAction()
Destructor.
KexiAction(const TQString &name, const TQString &text)
Constructor.
Kexi's main window interface This interface is implemented by KexiMainWindowImpl class.
void setText(const TQString &text)
Set the i18n-caption text this Action has.
Definition action.cpp:110
const TQString text() const
Definition action.cpp:105
Base Exception class.
Definition exception.h:35
static Manager * self()
Definition manager.cpp:76
KXMLGUIClient * guiClient() const
Definition manager.cpp:101