00001 00002 /* This file is part of Rocs, 00003 Copyright (C) 2008 by: 00004 Tomaz Canabrava <tomaz.canabrava@gmail.com> 00005 Ugo Sangiori <ugorox@gmail.com> 00006 00007 Rocs is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 Rocs is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Step; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 #include "AbstractAction.h" 00022 #include "GraphScene.h" 00023 #include "graph.h" 00024 #include "graphDocument.h" 00025 #include <QPointF> 00026 #include <KDebug> 00027 00028 AbstractAction::AbstractAction( GraphScene* scene, QObject* parent ) 00029 : KToggleAction( parent ) 00030 { 00031 _graphDocument = 0; 00032 _graph = 0; 00033 _graphScene = scene; 00034 00035 connect( this, SIGNAL( triggered() ), 00036 this, SLOT( sendExecuteBit() ) ); 00037 } 00038 00039 00040 void AbstractAction::setActiveGraphDocument( GraphDocument* graphDocument ) 00041 { 00042 _graphDocument = graphDocument; 00043 } 00044 00045 void AbstractAction::setActiveGraph( Graph* graph ) 00046 { 00047 _graph = graph; 00048 } 00049 00050 void AbstractAction::sendExecuteBit() 00051 { 00052 _graphScene -> setAction( this ); 00053 } 00054 00055 const QString& AbstractAction::name() const 00056 { 00057 return _name; 00058 } 00059 void AbstractAction::executePress( QPointF ) {} 00060 void AbstractAction::executeMove( QPointF ) {} 00061 void AbstractAction::executeRelease( QPointF ) {} 00062 void AbstractAction::executeKeyPress( QKeyEvent* ) {} 00063 void AbstractAction::executeKeyRelease( QKeyEvent* ) {} 00064