Subversion Repositories Scribus

Rev

Rev 10223 | Rev 11169 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
1111 tsoots 7
/***************************************************************************
8
 *   Copyright (C) 2005 by Riku Leino                                      *
5116 tsoots 9
 *   riku@scribus.info                                                     *
1111 tsoots 10
 *                                                                         *
11
 *   This program is free software; you can redistribute it and/or modify  *
12
 *   it under the terms of the GNU General Public License as published by  *
13
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 *   (at your option) any later version.                                   *
15
 *                                                                         *
16
 *   This program is distributed in the hope that it will be useful,       *
17
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
18
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
19
 *   GNU General Public License for more details.                          *
20
 *                                                                         *
21
 *   You should have received a copy of the GNU General Public License     *
22
 *   along with this program; if not, write to the                         *
23
 *   Free Software Foundation, Inc.,                                       *
24
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
25
 ***************************************************************************/
26
 
27
#include "undoobject.h"
11168 jghali 28
#include "undostate.h"
1111 tsoots 29
 
11168 jghali 30
ulong UndoObject::m_nextId = 1;
1111 tsoots 31
 
32
 
11168 jghali 33
UndoObject::UndoObject()
34
                  : m_objectPtr(this)
1111 tsoots 35
{
11168 jghali 36
        m_id = m_nextId;
37
        ++m_nextId;
38
        m_uname = "";
39
        m_upixmap = NULL;
1111 tsoots 40
}
41
 
11168 jghali 42
UndoObject::UndoObject(const QString &objectName, QPixmap *objectIcon)
43
                  : m_objectPtr(this)
1111 tsoots 44
{
11168 jghali 45
        m_id = m_nextId;
46
        ++m_nextId;
47
        m_uname = objectName;
48
        m_upixmap = objectIcon;
1111 tsoots 49
}
50
 
11168 jghali 51
UndoObject::~UndoObject()
52
{
53
        m_objectPtr.nullify();
54
}
55
 
8195 avox 56
ulong UndoObject::getUId() const
1111 tsoots 57
{
11168 jghali 58
        return m_id;
1111 tsoots 59
}
60
 
61
QString UndoObject::getUName()
62
{
11168 jghali 63
        return m_uname;
1111 tsoots 64
}
65
 
66
void UndoObject::setUName(QString newUName)
67
{
11168 jghali 68
        m_uname = newUName;
1111 tsoots 69
}
1250 tsoots 70
 
71
QPixmap* UndoObject::getUPixmap()
72
{
11168 jghali 73
        return m_upixmap;
1250 tsoots 74
}
75
 
76
void UndoObject::setUPixmap(QPixmap *newUPixmap)
77
{
11168 jghali 78
        m_upixmap = newUPixmap;
1250 tsoots 79
}
11168 jghali 80
 
81
const ScGuardedPtr<UndoObject>& UndoObject::undoObjectPtr()
82
{
83
        return m_objectPtr;
84
}