Back to index

scribus-ng  1.3.4.dfsg+svn20071115
undoobject.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008  *   Copyright (C) 2005 by Riku Leino                                      *
00009  *   riku@scribus.info                                                     *
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  *   This program is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00019  *   GNU General Public License for more details.                          *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU General Public License     *
00022  *   along with this program; if not, write to the                         *
00023  *   Free Software Foundation, Inc.,                                       *
00024  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00025  ***************************************************************************/
00026 
00027 #ifndef UNDOOBJECT_H
00028 #define UNDOOBJECT_H
00029 
00030 #include <qstring.h>
00031 #include <qpixmap.h>
00032 
00033 #include "scribusapi.h"
00034 #include "undostate.h"
00035 
00057 class SCRIBUS_API UndoObject
00058 {
00059 public:
00061        UndoObject();
00062 
00067        UndoObject(const QString &objectName, QPixmap *objectIcon = 0);
00068 
00070        virtual ~UndoObject() {};
00071 
00076        virtual QString getUName();
00077 
00082        virtual void setUName(QString newUName);
00083 
00088        virtual QPixmap* getUPixmap();
00089 
00094        virtual void setUPixmap(QPixmap *newUPixmap);
00095 
00100        ulong getUId() const;
00101 
00111        virtual void restore(UndoState* state, bool isUndo) = 0;
00112 private:
00114        static ulong nextId_;
00115        
00117        ulong id_;
00118        
00124        QString uname_;
00125        
00132        QPixmap *upixmap_;
00133 };
00134 
00135 class SCRIBUS_API DummyUndoObject : public UndoObject
00136 {
00137 public:
00138        DummyUndoObject() {};
00139        virtual ~DummyUndoObject() {};
00141        void restore(UndoState*, bool) {};
00142 };
00143 
00144 #endif