Rev 11169 | Rev 18122 | 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 | |||
11169 | jghali | 42 | UndoObject::UndoObject(const UndoObject& other) |
43 | : m_objectPtr(this) |
||
44 | { |
||
45 | m_id = other.m_id; |
||
46 | m_uname = other.m_uname; |
||
47 | m_upixmap = other.m_upixmap; |
||
48 | } |
||
49 | |||
11168 | jghali | 50 | UndoObject::UndoObject(const QString &objectName, QPixmap *objectIcon) |
51 | : m_objectPtr(this) |
||
1111 | tsoots | 52 | { |
11168 | jghali | 53 | m_id = m_nextId; |
54 | ++m_nextId; |
||
55 | m_uname = objectName; |
||
56 | m_upixmap = objectIcon; |
||
1111 | tsoots | 57 | } |
58 | |||
11168 | jghali | 59 | UndoObject::~UndoObject() |
60 | { |
||
61 | m_objectPtr.nullify(); |
||
62 | } |
||
63 | |||
8195 | avox | 64 | ulong UndoObject::getUId() const |
1111 | tsoots | 65 | { |
11168 | jghali | 66 | return m_id; |
1111 | tsoots | 67 | } |
68 | |||
69 | QString UndoObject::getUName() |
||
70 | { |
||
11168 | jghali | 71 | return m_uname; |
1111 | tsoots | 72 | } |
73 | |||
74 | void UndoObject::setUName(QString newUName) |
||
75 | { |
||
11168 | jghali | 76 | m_uname = newUName; |
1111 | tsoots | 77 | } |
1250 | tsoots | 78 | |
79 | QPixmap* UndoObject::getUPixmap() |
||
80 | { |
||
11168 | jghali | 81 | return m_upixmap; |
1250 | tsoots | 82 | } |
83 | |||
84 | void UndoObject::setUPixmap(QPixmap *newUPixmap) |
||
85 | { |
||
11168 | jghali | 86 | m_upixmap = newUPixmap; |
1250 | tsoots | 87 | } |
11168 | jghali | 88 | |
89 | const ScGuardedPtr<UndoObject>& UndoObject::undoObjectPtr() |
||
90 | { |
||
91 | return m_objectPtr; |
||
11229 | fschmid | 92 | } |