00001 /***************************************************************************** 00002 * This file is part of the Gluon Development Platform 00003 * Copyright (c) 2010 Arjen Hiemstra <ahiemstra@heimr.nl> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 */ 00019 00020 #include "abstractundocommand.h" 00021 00022 using namespace GluonCreator; 00023 00024 class AbstractUndoCommand::AbstractUndoCommandPrivate 00025 { 00026 public: 00027 GluonCore::GluonObject* object; 00028 QString commandName; 00029 QString commandDirection; 00030 }; 00031 00032 AbstractUndoCommand::AbstractUndoCommand( QUndoCommand* parent ) 00033 : QUndoCommand( parent ), 00034 d( new AbstractUndoCommandPrivate ) 00035 { 00036 } 00037 00038 AbstractUndoCommand::~AbstractUndoCommand() 00039 { 00040 } 00041 00042 int AbstractUndoCommand::id() const 00043 { 00044 return -1; 00045 } 00046 00047 QString 00048 AbstractUndoCommand::commandName() const 00049 { 00050 return d->commandName; 00051 } 00052 00053 QString 00054 AbstractUndoCommand::commandDirection() const 00055 { 00056 return d->commandDirection; 00057 } 00058 00059 GluonCore::GluonObject* 00060 AbstractUndoCommand::object() const 00061 { 00062 return d->object; 00063 } 00064 00065 void 00066 AbstractUndoCommand::setCommandName( const QString& name ) 00067 { 00068 d->commandName = name; 00069 } 00070 00071 void 00072 AbstractUndoCommand::setCommandDirection( const QString& direction ) 00073 { 00074 d->commandDirection = direction; 00075 } 00076 00077 void 00078 AbstractUndoCommand::setObject( GluonCore::GluonObject* obj ) 00079 { 00080 d->object = obj; 00081 }