krita
kis_doc_iface.cc
00001 /* This file is part of the KDE project 00002 * Copyright (C) 2002 Laurent Montel <lmontel@mandrakesoft.com> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #include "kis_doc_iface.h" 00020 #include <kapplication.h> 00021 00022 #include "kis_doc.h" 00023 #include "kis_image.h" 00024 00025 #include <dcopclient.h> 00026 00027 KisDocIface::KisDocIface( KisDoc *doc_ ) 00028 : KoDocumentIface( doc_ ) 00029 { 00030 m_doc = doc_; 00031 } 00032 00033 DCOPRef KisDocIface::currentImage() 00034 { 00035 KisImage *img = m_doc->currentImage(); 00036 if( !img ) 00037 return DCOPRef(); 00038 else 00039 return DCOPRef( kapp->dcopClient()->appId(), 00040 img->dcopObject()->objId(), 00041 "KisImageIface"); 00042 } 00043 00044 int KisDocIface::undoLimit () const 00045 { 00046 return m_doc->undoLimit(); 00047 } 00048 00049 void KisDocIface::setUndoLimit(int limit) 00050 { 00051 m_doc->setUndoLimit(limit); 00052 } 00053 00054 int KisDocIface::redoLimit() const 00055 { 00056 return m_doc->redoLimit(); 00057 } 00058 00059 void KisDocIface::setRedoLimit(int limit) 00060 { 00061 m_doc->setRedoLimit(limit); 00062 } 00063 00064 void KisDocIface::renameImage(const QString& oldName, const QString& newName) 00065 { 00066 m_doc->renameImage(oldName,newName); 00067 }