chalk

kis_doc_iface.cpp
1/* This file is part of the KDE project
2 * Copyright (C) 2002 Laurent Montel <lmontel@mandrakesoft.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#include "kis_doc_iface.h"
20#include <tdeapplication.h>
21
22#include "kis_doc.h"
23#include "kis_image.h"
24
25#include <dcopclient.h>
26
27KisDocIface::KisDocIface( KisDoc *doc_ )
28 : KoDocumentIface( doc_ )
29{
30 m_doc = doc_;
31}
32
33DCOPRef KisDocIface::currentImage()
34{
35 KisImage *img = m_doc->currentImage();
36 if( !img )
37 return DCOPRef();
38 else
39 return DCOPRef( kapp->dcopClient()->appId(),
40 img->dcopObject()->objId(),
41 "KisImageIface");
42}
43
44int KisDocIface::undoLimit () const
45{
46 return m_doc->undoLimit();
47}
48
49void KisDocIface::setUndoLimit(int limit)
50{
51 m_doc->setUndoLimit(limit);
52}
53
54int KisDocIface::redoLimit() const
55{
56 return m_doc->redoLimit();
57}
58
59void KisDocIface::setRedoLimit(int limit)
60{
61 m_doc->setRedoLimit(limit);
62}
63
64void KisDocIface::renameImage(const TQString& oldName, const TQString& newName)
65{
66 m_doc->renameImage(oldName,newName);
67}